libevent基礎檔案util c

2021-08-15 09:23:33 字數 401 閱讀 5377

util.h定義了一些基本資料型別,類似這些:

#define ev_uint32_t unsigned int

#define ev_uint8_t unsigned char

#define ev_off_t off_t

#define ev_ssize_t ssize_t

見名即能知意,這裡不貼出。

還定義了型別的大小限制,類似這些:

#define ev_uint64_max ((((ev_uint64_t)0xfffffffful) << 32) | 0xfffffffful)

#define ev_uint8_max  255

除此之外還定義了以下函式,函式原型定義在evutil.c檔案中(只保留linux平台的**,其他平台**已經刪去):

python 基礎 檔案

引入模組 import zipfile zip檔案格式是通用的文件壓縮標準,在ziplib模組中,使用zipfile類來操作zip檔案,下面具體介紹一下 zipfile.zipfile file mode compression allowzip64 功能 建立乙個zipfile物件,表示乙個zip...

檔案基礎IO

linux程序預設開啟三個檔案描述符,標準輸入0,標準輸出1,標準錯誤2 對應的外設一般是 鍵盤,顯示器,顯示器。檔案描述符 檔案描述符就是從0開始的小整數,當我們開啟檔案時,作業系統在記憶體中要建立相應的資料結構來描述目標檔案。於是就有了file結構體。表示乙個已經開啟的檔案物件。而程序執行ope...

Python基礎 檔案

讀取整個檔案 with open text files file path as file object contents file object.read print contents 逐行讀取 with open filename as file object for line in file ...