FACT++  1.0
void get_server_node ( )

Definition at line 1016 of file didMarkus.c.

References create_str(), DID_SEL_NODE, get_nodes(), i, id, MAX_CONNS, MAX_NODE_NAME, put_selection(), and set_something().

Referenced by view_opts().

1017 {
1018 Widget id,sel_id;
1019 int i, j, n_nodes, curr_index = 0;
1020 char nodes_str[MAX_NODE_NAME*MAX_CONNS], max_str[MAX_NODE_NAME];
1021 char *ptr, *nodeptrs[MAX_CONNS], *curr_str, *sptr;
1022 int get_nodes();
1023 
1024  sel_id = put_selection(DID_SEL_NODE,"Node Selection");
1025  id = XmSelectionBoxGetChild(sel_id,XmDIALOG_HELP_BUTTON);
1026  XtUnmanageChild(id);
1027  id = XmSelectionBoxGetChild(sel_id,XmDIALOG_APPLY_BUTTON);
1028  XtUnmanageChild(id);
1029  id = XmSelectionBoxGetChild(sel_id,XmDIALOG_LIST);
1030  XmListDeleteAllItems(id);
1031  n_nodes = get_nodes(nodes_str);
1032  ptr = nodes_str;
1033 
1034  for(i=0;i<n_nodes;i++)
1035  {
1036  nodeptrs[i] = ptr;
1037  sptr = ptr;
1038  ptr = strchr(ptr,'\n');
1039  for(j = 0; j < (int)strlen(sptr); j++)
1040  sptr[j] = tolower(sptr[j]);
1041  *ptr++ = '\0';
1042  }
1043  strcpy(max_str,"zzzzzzzzzzzzzzzzzzzzzzzzzzzz");
1044  for(i=0;i<n_nodes; i++)
1045  {
1046  curr_str = max_str;
1047  for(j=0;j<n_nodes; j++)
1048  {
1049  sptr = nodeptrs[j];
1050  if(!sptr)
1051  continue;
1052 
1053  if(strcmp(sptr,curr_str) < 0)
1054  {
1055  curr_str = sptr;
1056  curr_index = j;
1057  }
1058  }
1059  nodeptrs[curr_index] = 0;
1060  XmListAddItem(id,create_str(curr_str),i+1);
1061  }
1062  /*
1063  for(i=0;i<n_nodes;i++)
1064  {
1065  node = ptr;
1066  ptr = strchr(ptr,'\n');
1067  *ptr++ = '\0';
1068  XmListAddItem(id,create_str(node),i+1);
1069  }
1070  */
1071  set_something(id,XmNlistItemCount,i);
1072  set_something(id,XmNlistVisibleItemCount,(i < 8) ? i : 8);
1073 }
int i
Definition: db_dim_client.c:21
int get_nodes(char *node_ptr)
Definition: didMarkus.c:1097
char id[4]
Definition: FITS.h:71
#define MAX_CONNS
Definition: dim.h:163
Widget put_selection(int tag, char *title)
Definition: didMarkus.c:3058
void set_something()
#define MAX_NODE_NAME
Definition: dim.h:180
XmString create_str()

+ Here is the call graph for this function:

+ Here is the caller graph for this function: