ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static void userlist ( int  argc,
char **  argv 
) [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);
}

Generated on Sat May 26 2012 04:41:14 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.