/* ============ PR_GlobalString Returns a string with a description and the contents of a global, padded to 20 field width ============ */ char *PR_GlobalString (int ofs) { char *s; int i; ddef_t *def; void *val; static char line[128]; val = (void *)&pr_globals[ofs]; def = ED_GlobalAtOfs(ofs); if (!def) { snprintf (line, sizeof(line), "%i(?""?""?)", ofs); // separate the ?'s to shut up gcc } else { s = PR_ValueString ((etype_t)def->type, (eval_t *) val); snprintf (line, sizeof(line), "%i(%s)%s", ofs, PR_GetString(def->s_name), s); } i = strlen(line); for ( ; i<20 ; i++) strlcat (line, " ", sizeof(line)); strlcat (line, " ", sizeof(line)); return line; }
/* ============ PR_GlobalString Returns a string with a description and the contents of a global, padded to 20 field width ============ */ const char *PR_GlobalString (int ofs) { static char line[512]; const char *s; int i; ddef_t *def; void *val; val = (void *)&pr_globals[ofs]; def = ED_GlobalAtOfs(ofs); if (!def) sprintf (line,"%i(?)", ofs); else { s = PR_ValueString (def->type, (eval_t *)val); sprintf (line,"%i(%s)%s", ofs, PR_GetString(def->s_name), s); } i = strlen(line); for ( ; i < 20; i++) strcat (line, " "); strcat (line, " "); return line; }
/* ============ PR_GlobalString Returns a string with a description and the contents of a global, padded to 20 field width ============ */ char *PR_GlobalString (int ofs) { char *s; int i; ddef_t *def; void *val; static char line[128]; val = (void *)&pr_globals[ofs]; def = ED_GlobalAtOfs(ofs); if (!def) sprintf (line,"%i(???)", ofs); else { s = PR_ValueString ((etype_t)def->type, (eval_t *)val); sprintf (line,"%i(%s)%s", ofs, pr_strings + def->s_name, s); } i = strlen(line); for ( ; i<20 ; i++) strcat (line," "); strcat (line," "); return line; }
char *PR_GlobalStringNoContents (int ofs) { int i; ddef_t *def; static char line[128]; def = ED_GlobalAtOfs(ofs); if (!def) snprintf (line, sizeof(line), "%i(?""?""?)", ofs); // separate the ?'s to shut up gcc else snprintf (line, sizeof(line), "%i(%s)", ofs, PR_GetString(def->s_name)); i = strlen(line); for ( ; i<20 ; i++) strlcat (line, " ", sizeof(line)); strlcat (line, " ", sizeof(line)); return line; }
const char *PR_GlobalStringNoContents (int ofs) { static char line[512]; int i; ddef_t *def; def = ED_GlobalAtOfs(ofs); if (!def) sprintf (line,"%i(?)", ofs); else sprintf (line,"%i(%s)", ofs, PR_GetString(def->s_name)); i = strlen(line); for ( ; i < 20; i++) strcat (line, " "); strcat (line, " "); return line; }
char *PR_GlobalStringNoContents (int ofs) { int i; ddef_t *def; static char line[128]; def = ED_GlobalAtOfs(ofs); if (!def) sprintf (line,"%i(???)", ofs); else sprintf (line,"%i(%s)", ofs, pr_strings + def->s_name); i = strlen(line); for ( ; i<20 ; i++) strcat (line," "); strcat (line," "); return line; }