Use PROCESS_NAME_STRING macro to handle NO_PROCESS_NAMES

This commit is contained in:
David Kopf 2011-08-03 11:08:40 -04:00
parent 6ec85fe079
commit 44f4ee9315
8 changed files with 13 additions and 15 deletions

View file

@ -90,7 +90,7 @@ update_processwindow(void)
CTK_WIDGET_ADD(&processwindow, &processidlabels[i]); CTK_WIDGET_ADD(&processwindow, &processidlabels[i]);
CTK_LABEL_NEW(&processnamelabels[i], CTK_LABEL_NEW(&processnamelabels[i],
4, i + 1, 22, 1, (char *)p->name); 4, i + 1, 22, 1, PROCESS_NAME_STRING(p));
CTK_WIDGET_ADD(&processwindow, &processnamelabels[i]); CTK_WIDGET_ADD(&processwindow, &processnamelabels[i]);
++i; ++i;

View file

@ -58,7 +58,7 @@ PROCESS_THREAD(shell_ps_process, ev, data)
shell_output_str(&ps_command, "Processes:", ""); shell_output_str(&ps_command, "Processes:", "");
for(p = PROCESS_LIST(); p != NULL; p = p->next) { for(p = PROCESS_LIST(); p != NULL; p = p->next) {
shell_output_str(&ps_command, (char *)p->name, ""); shell_output_str(&ps_command, PROCESS_NAME_STRING(p), "");
} }
PROCESS_END(); PROCESS_END();

View file

@ -359,16 +359,13 @@ make_processes(void *p)
{ {
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n"; static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20]; char name[40],tstate[20];
#if PROCESS_CONF_NO_PROCESS_NAMES
strcpy(name, "Not Available"); strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
#else
strncpy(name, ((struct process *)p)->name, 40);
#endif
petsciiconv_toascii(name, 40); petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]); httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name, return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,
// *((char **)&(((struct process *)p)->thread)), // *((char **) &(((struct process *)p)->thread)),
*(char **)(&(((struct process *)p)->thread)), //minimal net * (char **)(&(((struct process *)p)->thread)), //minimal net
tstate); tstate);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/

View file

@ -207,8 +207,8 @@ static unsigned short
make_processes(void *p) make_processes(void *p)
{ {
char name[40]; char name[40];
strncpy(name, ((struct process *)p)->name, 40); strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40); petsciiconv_toascii(name, 40);
return snprintf((char *)uip_appdata, uip_mss(), return snprintf((char *)uip_appdata, uip_mss(),

View file

@ -61,7 +61,8 @@ dlloader_load(char *path, char *arg)
} }
/* Start the process. */ /* Start the process. */
printf("Starting '%s'\n", (*p)->name);
printf("Starting '%s'\n", PROCESS_NAME_STRING(*p));
process_start(*p, arg); process_start(*p, arg);
return LOADER_OK; return LOADER_OK;

View file

@ -268,7 +268,7 @@ make_processes(void *p)
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n"; static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20]; char name[40],tstate[20];
strncpy(name, ((struct process *)p)->name, 40); strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40); petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]); httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name, return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,

View file

@ -269,7 +269,7 @@ make_processes(void *p)
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n"; static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20]; char name[40],tstate[20];
strncpy(name, ((struct process *)p)->name, 40); strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40); petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]); httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name, return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,

View file

@ -197,7 +197,7 @@ make_processes(void *p)
{ {
char name[40]; char name[40];
strncpy(name, ((struct process *)p)->name, 40); strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40); petsciiconv_toascii(name, 40);
return sprintf((char *)uip_appdata, return sprintf((char *)uip_appdata,