|
|
typedef struct _xf86_file_ {
INT32 fileno;
INT32 magic;
FILE* filehnd;
char* fname;
} XF86FILE_priv;
XF86FILE_priv stdhnd[3] = {
{ 0, XF86FILE_magic, NULL, "$stdinp$" },
{ 0, XF86FILE_magic, NULL, "$stdout$" },
{ 0, XF86FILE_magic, NULL, "$stderr$" }
};
XF86FILE* xf86stdin = (XF86FILE*)&stdhnd[0];
XF86FILE* xf86stdout = (XF86FILE*)&stdhnd[1];
XF86FILE* xf86stderr = (XF86FILE*)&stdhnd[2];
/////
#define stdin xf86stdin
////////
getstring(char *s)
{
char *cp;
if (fgets(s, 80, stdin) == NULL)
exit(1);
cp = strchr(s, '\n');
if (cp)
*cp=0;
}
/////////////
我们有看明白这个stdin到底社个什么东西。大家帮忙解释一下。 |
|