FACT++  1.0
int main ( int  argc,
char *  argv[] 
)

Definition at line 791 of file did.c.

References app_context, app_initialize(), Curr_view_opt, Curr_view_opt_par, dic_disable_padding(), dim_no_threads(), dim_set_dns_node(), dim_usleep(), dis_disable_padding(), do_got_service_list(), do_show_clients(), gui_initialize(), i, sprintf(), and toplevel_widget.

792 {
793  int i;
794  char opt_str[20], *ptr;
795  XtInputMask mask;
796  void do_got_service_list();
797  void do_show_clients();
798  void app_initialize();
799 
800  dim_no_threads();
803 
804  if(argc > 1)
805  {
806  if(argv[1][0] == '-')
807  {
808  sprintf(opt_str,"%s",&argv[1][1]);
809  if((!strncmp(opt_str,"node",4)) ||
810  (!strncmp(opt_str,"NODE",4)))
811  Curr_view_opt = 0;
812  else if((!strncmp(opt_str,"all",3)) ||
813  (!strncmp(opt_str,"ALL",3)))
814  Curr_view_opt = 1;
815  else if((!strncmp(opt_str,"dns",3)) ||
816  (!strncmp(opt_str,"DNS",3))) {
817  char text[132];
818  sprintf(text,"DIM_DNS_NODE=%s",opt_str+4);
819  putenv(text);
820  dim_set_dns_node(opt_str+4);
821  }
822  else if((!strncmp(opt_str,"service",7)) ||
823  (!strncmp(opt_str,"SERVICE",7)))
824  Curr_view_opt = 2;
825  else if((!strncmp(opt_str,"error",5)) ||
826  (!strncmp(opt_str,"ERROR",5)))
827  Curr_view_opt = 3;
828  else if((!strncmp(opt_str,"help",4)) ||
829  (!strncmp(opt_str,"HELP",4)))
830  {
831  printf("Did - DIM Information Display\n");
832  printf("\t-all Show ALL Servers\n");
833  printf("\t-dns=<str> Show Servers with DIM_DNS_NODE provided by <str>\n");
834  printf("\t-service=<str> Show Servers providing Service <str>\n");
835  printf("\t-node=<nodename> Show Servers on Node <nodename>\n");
836  printf("\t-error Show Servers in Error\n");
837  printf("\t-help Show this message\n\n");
838  exit(0);
839  }
840  else
841  Curr_view_opt = -1;
842  if((Curr_view_opt == 0) || (Curr_view_opt == 2))
843  {
844  if(!(ptr = strchr(argv[1],'=')))
845  {
846  if( (ptr = strchr(argv[2],'=')) )
847  {
848  ptr++;
849  if(!(*ptr))
850  ptr = argv[3];
851  }
852  else
853  ptr++;
854  }
855  else
856  {
857  ptr++;
858  if(!(*ptr))
859  ptr = argv[2];
860  }
861  for(i = 0;*ptr; ptr++, i++)
862  Curr_view_opt_par[i] = (char)toupper((int)*ptr);
863  Curr_view_opt_par[i] = '\0';
864  }
865  }
866  }
867 
868  toplevel_widget = (Widget)gui_initialize(argc, argv);
869  app_initialize();
870  /*
871  * Sit around forever waiting to process X-events. We never leave
872  * XtAppMainLoop. From here on, we only execute our callback routines.
873  */
874 
875  while(1)
876  {
877  {
878  DISABLE_AST
879  mask = XtAppPending(app_context);
880  ENABLE_AST
881  }
882  if(mask)
883  {
884  DISABLE_AST
885  XtAppProcessEvent(app_context, mask);
886  if(Got_Service_List)
887  {
889  Got_Service_List = 0;
890  }
891  if(Got_Client_List)
892  {
894  Got_Client_List = 0;
895  }
896  ENABLE_AST
897  }
898  else
899  {
900  dim_usleep(100000);
901  /*
902  usleep(100000);
903  */
904  }
905  }
906 
907 }
void dis_disable_padding()
Definition: copy_swap.c:30
int dim_set_dns_node(char *node)
Definition: open_dns.c:50
SERVER * Got_Client_List
Definition: did.c:29
int i
Definition: db_dim_client.c:21
void dim_usleep(int usecs)
Definition: dtq.c:293
XtAppContext app_context
Definition: did.h:38
Widget gui_initialize(int argc, char **argv)
Definition: did.c:764
void do_got_service_list(SERVER *servp)
Definition: did.c:2857
void app_initialize(int tag)
Definition: did.c:911
void dim_no_threads()
Definition: dtq.c:80
char Curr_view_opt_par[80]
Definition: did.c:11
int Curr_view_opt
Definition: did.c:10
void dic_disable_padding()
Definition: copy_swap.c:25
Widget toplevel_widget
Definition: did.h:39
void do_show_clients(SERVER *servp)
Definition: did.c:2947
SERVER * Got_Service_List
Definition: did.c:28
sprintf(name1,"NewService%d", i)

+ Here is the call graph for this function: