#include <CSql.h>
#include <Network.h>
Include dependency graph for repltable.cxx:
Go to the source code of this file.
Functions | |
void | printUsage () |
int | main (int argc, char **argv) |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 35 of file repltable.cxx.
References IDENTIFIER_LENGTH, OK, and printUsage().
00036 { 00037 char username[IDENTIFIER_LENGTH]; 00038 username [0] = '\0'; 00039 char password[IDENTIFIER_LENGTH]; 00040 password [0] = '\0'; 00041 int c = 0, opt = 10; 00042 char tablename[IDENTIFIER_LENGTH]; 00043 char syncModeStr[IDENTIFIER_LENGTH]; 00044 bool tableNameSpecified = false; 00045 while ((c = getopt(argc, argv, "U:P:t:l:m:u?")) != EOF) 00046 { 00047 switch (c) 00048 { 00049 case 'U' : { strcpy(username, argv[optind - 1]); opt=10; break; } 00050 case 'P' : { strcpy(password, argv[optind - 1]); opt=10; break; } 00051 case 't' : { strcpy(tablename, argv[optind - 1]); 00052 if (opt==10) opt = 2; 00053 tableNameSpecified = true; 00054 break; 00055 } 00056 case '?' : { opt = 10; break; } //print help 00057 case 'r' : { opt = 4; break; } //replicate the table 00058 case 'u' : { opt = 5; break; } //unreplicate the table 00059 default: opt=10; 00060 00061 } 00062 }//while options 00063 if (opt == 10) { 00064 printUsage(); 00065 return 0; 00066 } 00067 00068 //printf("%s %s \n", username, password); 00069 if (username[0] == '\0' ) 00070 { 00071 strcpy(username, "root"); 00072 strcpy(password, "manager"); 00073 } 00074 DbRetVal rv = OK; 00075 if (opt==2) { 00076 } 00077 return 0; 00078 }
Here is the call graph for this function:
void printUsage | ( | ) |
Definition at line 19 of file repltable.cxx.
00020 { 00021 printf("Usage: repltable [-U username] [-P passwd] -t tablename \n" 00022 " [-m TSYNC|ASYNC>][-u] [-r] \n"); 00023 printf(" username -> username to connect with csql.\n"); 00024 printf(" passwd -> password for the above username to connect with csql.\n"); 00025 printf(" tablename -> table name to be replicated in csql with peers.\n"); 00026 printf(" u -> unreplicate the table\n"); 00027 printf(" r -> replicate and load all the records from peer site\n"); 00028 printf(" m -> replication mode for the table\n"); 00029 printf(" -> Modes could be one of TSYNC|ASYNC\n"); 00030 printf(" no option -> replicates with default mode ASYNC\n"); 00031 printf(" Note:Table should not have any records for this command to succeed\n"); 00032 return; 00033 }