FACT++  1.0
void get_server_node ( )

Definition at line 1031 of file did.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().

1032 {
1033 Widget id,sel_id;
1034 int i, j, n_nodes, curr_index = 0;
1035 char nodes_str[MAX_NODE_NAME*MAX_CONNS*2], max_str[MAX_NODE_NAME];
1036 char *ptr, *nodeptrs[MAX_CONNS*2], *curr_str, *sptr;
1037 int get_nodes();
1038 
1039  sel_id = put_selection(DID_SEL_NODE,"Node Selection");
1040  id = XmSelectionBoxGetChild(sel_id,XmDIALOG_HELP_BUTTON);
1041  XtUnmanageChild(id);
1042  id = XmSelectionBoxGetChild(sel_id,XmDIALOG_APPLY_BUTTON);
1043  XtUnmanageChild(id);
1044  id = XmSelectionBoxGetChild(sel_id,XmDIALOG_LIST);
1045  XmListDeleteAllItems(id);
1046  n_nodes = get_nodes(nodes_str);
1047  ptr = nodes_str;
1048 
1049  for(i=0;i<n_nodes;i++)
1050  {
1051  nodeptrs[i] = ptr;
1052  sptr = ptr;
1053  ptr = strchr(ptr,'\n');
1054  *ptr++ = '\0';
1055  for(j = 0; j < (int)strlen(sptr); j++)
1056  sptr[j] = (char)tolower((int)sptr[j]);
1057  }
1058  strcpy(max_str,"zzzzzzzzzzzzzzzzzzzzzzzzzzzz");
1059  for(i=0;i<n_nodes; i++)
1060  {
1061  curr_str = max_str;
1062  for(j=0;j<n_nodes; j++)
1063  {
1064  sptr = nodeptrs[j];
1065  if(!sptr)
1066  continue;
1067 
1068  if(strcmp(sptr,curr_str) < 0)
1069  {
1070  curr_str = sptr;
1071  curr_index = j;
1072  }
1073  }
1074  nodeptrs[curr_index] = 0;
1075  XmListAddItem(id,create_str(curr_str),i+1);
1076  }
1077  /*
1078  for(i=0;i<n_nodes;i++)
1079  {
1080  node = ptr;
1081  ptr = strchr(ptr,'\n');
1082  *ptr++ = '\0';
1083  XmListAddItem(id,create_str(node),i+1);
1084  }
1085  */
1086  set_something(id,XmNlistItemCount,i);
1087  set_something(id,XmNlistVisibleItemCount,(i < 8) ? i : 8);
1088 }
Widget put_selection(int tag, char *title)
Definition: did.c:3115
int i
Definition: db_dim_client.c:21
char id[4]
Definition: FITS.h:71
#define MAX_CONNS
Definition: dim.h:163
void set_something()
int get_nodes(char *node_ptr)
Definition: did.c:1112
#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: