Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 113 of file finger.c.
Referenced by main().
{ int *used = NULL; char **ap, **nargv, **np, **p; WORD wVersionRequested; WSADATA wsaData; int iErr; if ((nargv = (char**) malloc((argc+1) * sizeof(char *))) == NULL || (used = (int*) calloc(argc, sizeof(int))) == NULL) err(1, NULL); /* Pull out all network requests into nargv. */ for (ap = p = argv, np = nargv; *p; ++p) if (index(*p, '@')) *np++ = *p; else *ap++ = *p; *np++ = NULL; *ap++ = NULL; /* If there are local requests */ if (*argv) { fprintf(stderr, "Warning: Can't do local finger\n"); } /* Start winsock */ wVersionRequested = MAKEWORD( 1, 1 ); iErr = WSAStartup( wVersionRequested, &wsaData ); if ( iErr != 0 ) { /* Tell the user that we couldn't find a usable */ /* WinSock DLL. */ fprintf(stderr, "WSAStartup failed\n"); return; } /* Handle network requests. */ for (p = nargv; *p;) netfinger(*p++); /* Bring down winsock */ WSACleanup(); free(nargv); free(used); exit(0); }