|
藍森林 http://www.lslnet.com 2006年6月6日 10:18
如何得到FILE結構的各個成員?
在看流的時候需要FILE結構,書上沒介紹,網上也沒有看見。 |
如何得到FILE結構的各個成員?
solaris sparc:
[code]
struct __FILE_TAG /* needs to be binary-compatible with old versions */
{
#ifdef _STDIO_REVERSE
unsigned char *_ptr; /* next character from/to here in buffer */
ssize_t _cnt; /* number of available characters in buffer */
#else
ssize_t _cnt; /* number of available characters in buffer */
unsigned char *_ptr; /* next character from/to here in buffer */
#endif
unsigned char *_base; /* the buffer */
unsigned char _flag; /* the state of the stream */
unsigned char _file; /* UNIX System file descriptor */
unsigned __orientation:2; /* the orientation of the stream */
unsigned __ionolock:1; /* turn off implicit locking */
unsigned __filler:5;
};
[/code] |
如何得到FILE結構的各個成員?
在stdio.h文件中找它的結構吧! |
如何得到FILE結構的各個成員?
如果想要得到當前系統的某些類型、系統維護的數據結構,一般的使用如下的方法:
1、如果是一個系統調用,那麼去man這個系統調用函數,在man中說明了該系統調用相關的系統頭文件信息。然後到/usr/include(大多數系統在這個目錄中)目錄及其子目錄下面可以找到對應的頭文件。
2、如果在找到的頭文件中沒有你期望的東西,這個頭文件本身有包含了其他的系統頭文件,一般定義在開始部分,按照這個定義繼續查找,若有多個,一次類推。 |
如何得到FILE結構的各個成員?
謝謝各位的回復。 |
如何得到FILE結構的各個成員?
鍵盤老大,能不能詳細說明一下FILE結構在stdio.h中要怎麼看,如果有現成的文檔,麻煩你老人家指一下,謝謝 |
| |