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

int main ( int argc  ,
char **  argv 
)

Definition at line 31 of file hostname.c.

{
    if (1 == argc)
    {
        TCHAR ComputerName [MAX_COMPUTERNAME_LENGTH + 1];
        DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0];

        ZeroMemory (ComputerName, sizeof ComputerName );
        if (GetComputerName(ComputerName, & ComputerNameSize))
        {
            printf ("%s\n", ComputerName);
            return EXIT_SUCCESS;
        }
        fprintf (stderr, "%s: Win32 error %ld.\n",
            argv[0], GetLastError());
        return EXIT_FAILURE;
    }else{
        if (0 == strcmp(argv[1],"-s"))
        {
            fprintf(stderr,"%s: -s not supported.\n",argv[0]);
            return EXIT_FAILURE;
        }else{
            printf("Print the current host's name.\n\nhostname\n");
        }
    }
    return EXIT_SUCCESS;
}

Generated on Sun May 27 2012 04:39:57 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.