Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

get_auth_data_fn.h File Reference

Go to the source code of this file.

Functions

static void get_auth_data_fn (const char *pServer, const char *pShare, char *pWorkgroup, int maxLenWorkgroup, char *pUsername, int maxLenUsername, char *pPassword, int maxLenPassword)


Function Documentation

static void get_auth_data_fn const char *  pServer,
const char *  pShare,
char *  pWorkgroup,
int  maxLenWorkgroup,
char *  pUsername,
int  maxLenUsername,
char *  pPassword,
int  maxLenPassword
[static]
 

Definition at line 2 of file get_auth_data_fn.h.

References fprintf().

00010 {
00011     char temp[128];
00012     
00013     fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
00014     fgets(temp, sizeof(temp), stdin);
00015     
00016     if (temp[strlen(temp) - 1] == '\n') /* A new line? */
00017     {
00018         temp[strlen(temp) - 1] = '\0';
00019     }
00020     
00021     if (temp[0] != '\0')
00022     {
00023         strncpy(pWorkgroup, temp, maxLenWorkgroup - 1);
00024     }
00025     
00026     fprintf(stdout, "Username: [%s] ", pUsername);
00027     fgets(temp, sizeof(temp), stdin);
00028     
00029     if (temp[strlen(temp) - 1] == '\n') /* A new line? */
00030     {
00031         temp[strlen(temp) - 1] = '\0';
00032     }
00033     
00034     if (temp[0] != '\0')
00035     {
00036         strncpy(pUsername, temp, maxLenUsername - 1);
00037     }
00038     
00039     fprintf(stdout, "Password: ");
00040     fgets(temp, sizeof(temp), stdin);
00041     
00042     if (temp[strlen(temp) - 1] == '\n') /* A new line? */
00043     {
00044         temp[strlen(temp) - 1] = '\0';
00045     }
00046     
00047     if (temp[0] != '\0')
00048     {
00049         strncpy(pPassword, temp, maxLenPassword - 1);
00050     }
00051 }


© sourcejam.com 2005-2008