keyword.c revision 2446
1280849Scy/*- 2258945Sroberto * Copyright (c) 1990, 1993, 1994 3280849Scy * The Regents of the University of California. All rights reserved. 4330567Sgordon * 5258945Sroberto * Redistribution and use in source and binary forms, with or without 6258945Sroberto * modification, are permitted provided that the following conditions 7258945Sroberto * are met: 8280849Scy * 1. Redistributions of source code must retain the above copyright 9258945Sroberto * notice, this list of conditions and the following disclaimer. 10258945Sroberto * 2. Redistributions in binary form must reproduce the above copyright 11258945Sroberto * notice, this list of conditions and the following disclaimer in the 12258945Sroberto * documentation and/or other materials provided with the distribution. 13258945Sroberto * 3. All advertising materials mentioning features or use of this software 14258945Sroberto * must display the following acknowledgement: 15258945Sroberto * This product includes software developed by the University of 16258945Sroberto * California, Berkeley and its contributors. 17258945Sroberto * 4. Neither the name of the University nor the names of its contributors 18280849Scy * may be used to endorse or promote products derived from this software 19280849Scy * without specific prior written permission. 20258945Sroberto * 21316722Sdelphij * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22280849Scy * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23280849Scy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24280849Scy * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25280849Scy * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26280849Scy * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27280849Scy * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28280849Scy * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29280849Scy * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30280849Scy * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31280849Scy * SUCH DAMAGE. 32280849Scy */ 33280849Scy 34280849Scy#ifndef lint 35280849Scystatic char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94"; 36280849Scy#endif /* not lint */ 37258945Sroberto 38280849Scy#include <sys/param.h> 39258945Sroberto#include <sys/time.h> 40258945Sroberto#include <sys/resource.h> 41258945Sroberto#include <sys/proc.h> 42258945Sroberto 43258945Sroberto#include <err.h> 44258945Sroberto#include <errno.h> 45258945Sroberto#include <stddef.h> 46258945Sroberto#include <stdio.h> 47258945Sroberto#include <stdlib.h> 48258945Sroberto#include <string.h> 49280849Scy 50258945Sroberto#include "ps.h" 51258945Sroberto 52258945Sroberto#ifdef P_PPWAIT 53258945Sroberto#define NEWVM 54258945Sroberto#endif 55258945Sroberto 56280849Scy#ifdef NEWVM 57258945Sroberto#include <sys/ucred.h> 58258945Sroberto#include <sys/sysctl.h> 59258945Sroberto#endif 60258945Sroberto 61258945Srobertostatic VAR *findvar __P((char *)); 62258945Srobertostatic int vcmp __P((const void *, const void *)); 63280849Scy 64280849Scy#ifdef NOTINUSE 65258945Srobertoint utime(), stime(), ixrss(), idrss(), isrss(); 66258945Sroberto {{"utime"}, "UTIME", USER, utime, 4}, 67258945Sroberto {{"stime"}, "STIME", USER, stime, 4}, 68258945Sroberto {{"ixrss"}, "IXRSS", USER, ixrss, 4}, 69258945Sroberto {{"idrss"}, "IDRSS", USER, idrss, 4}, 70258945Sroberto {{"isrss"}, "ISRSS", USER, isrss, 4}, 71258945Sroberto#endif 72258945Sroberto 73258945Sroberto/* Compute offset in common structures. */ 74258945Sroberto#define POFF(x) offsetof(struct proc, x) 75258945Sroberto#define EOFF(x) offsetof(struct eproc, x) 76280849Scy#define UOFF(x) offsetof(struct usave, x) 77258945Sroberto#define ROFF(x) offsetof(struct rusage, x) 78280849Scy 79330567Sgordon#define UIDFMT "u" 80280849Scy#define UIDLEN 5 81330567Sgordon#define PIDFMT "d" 82258945Sroberto#define PIDLEN 5 83280849Scy#define USERLEN 8 84258945Sroberto 85258945SrobertoVAR var[] = { 86258945Sroberto#ifdef NEWVM 87258945Sroberto {"%cpu", "%CPU", NULL, 0, pcpu, 4}, 88258945Sroberto {"%mem", "%MEM", NULL, 0, pmem, 4}, 89280849Scy {"acflag", "ACFLG", NULL, 0, pvar, 3, POFF(p_acflag), USHORT, "x"}, 90258945Sroberto {"acflg", "", "acflag"}, 91280849Scy {"blocked", "", "sigmask"}, 92258945Sroberto {"caught", "", "sigcatch"}, 93280849Scy {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 16}, 94280849Scy {"cpu", "CPU", NULL, 0, pvar, 3, POFF(p_estcpu), ULONG, "d"}, 95280849Scy {"cputime", "", "time"}, 96280849Scy {"f", "F", NULL, 0, pvar, 7, POFF(p_flag), LONG, "x"}, 97258945Sroberto {"flags", "", "f"}, 98280849Scy {"ignored", "", "sigignore"}, 99258945Sroberto {"inblk", "INBLK", NULL, USER, rvar, 4, ROFF(ru_inblock), LONG, "d"}, 100280849Scy {"inblock", "", "inblk"}, 101258945Sroberto {"jobc", "JOBC", NULL, 0, evar, 4, EOFF(e_jobc), SHORT, "d"}, 102280849Scy {"ktrace", "KTRACE", NULL, 0, pvar, 8, POFF(p_traceflag), LONG, "x"}, 103258945Sroberto {"ktracep", "KTRACEP", NULL, 0, pvar, 8, POFF(p_tracep), LONG, "x"}, 104280849Scy {"lim", "LIM", NULL, 0, maxrss, 5}, 105258945Sroberto {"login", "LOGIN", NULL, LJUST, logname, MAXLOGNAME}, 106280849Scy {"logname", "", "login"}, 107280849Scy {"lstart", "STARTED", NULL, LJUST|USER, lstarted, 28}, 108258945Sroberto {"majflt", "MAJFLT", NULL, USER, rvar, 4, ROFF(ru_majflt), LONG, "d"}, 109280849Scy {"minflt", "MINFLT", NULL, USER, rvar, 4, ROFF(ru_minflt), LONG, "d"}, 110280849Scy {"msgrcv", "MSGRCV", NULL, USER, rvar, 4, ROFF(ru_msgrcv), LONG, "d"}, 111258945Sroberto {"msgsnd", "MSGSND", NULL, USER, rvar, 4, ROFF(ru_msgsnd), LONG, "d"}, 112280849Scy {"ni", "", "nice"}, 113258945Sroberto {"nice", "NI", NULL, 0, pvar, 2, POFF(p_nice), CHAR, "d"}, 114258945Sroberto {"nivcsw", "NIVCSW", NULL, USER, rvar, 5, ROFF(ru_nivcsw), LONG, "d"}, 115258945Sroberto {"nsignals", "", "nsigs"}, 116258945Sroberto {"nsigs", "NSIGS", NULL, USER, rvar, 4, ROFF(ru_nsignals), LONG, "d"}, 117258945Sroberto {"nswap", "NSWAP", NULL, USER, rvar, 4, ROFF(ru_nswap), LONG, "d"}, 118280849Scy {"nvcsw", "NVCSW", NULL, USER, rvar, 5, ROFF(ru_nvcsw), LONG, "d"}, 119280849Scy {"nwchan", "WCHAN", NULL, 0, pvar, 6, POFF(p_wchan), KPTR, "x"}, 120258945Sroberto {"oublk", "OUBLK", NULL, USER, rvar, 4, ROFF(ru_oublock), LONG, "d"}, 121258945Sroberto {"oublock", "", "oublk"}, 122258945Sroberto {"p_ru", "P_RU", NULL, 0, pvar, 6, POFF(p_ru), KPTR, "x"}, 123280849Scy {"paddr", "PADDR", NULL, 0, evar, 6, EOFF(e_paddr), KPTR, "x"}, 124280849Scy {"pagein", "PAGEIN", NULL, USER, pagein, 6}, 125280849Scy {"pcpu", "", "%cpu"}, 126280849Scy {"pending", "", "sig"}, 127280849Scy {"pgid", "PGID", NULL, 0, evar, PIDLEN, EOFF(e_pgid), ULONG, PIDFMT}, 128280849Scy {"pid", "PID", NULL, 0, pvar, PIDLEN, POFF(p_pid), LONG, PIDFMT}, 129280849Scy {"pmem", "", "%mem"}, 130280849Scy {"ppid", "PPID", NULL, 0, evar, PIDLEN, EOFF(e_ppid), LONG, PIDFMT}, 131258945Sroberto {"pri", "PRI", NULL, 0, pri, 3}, 132258945Sroberto {"re", "RE", NULL, 0, pvar, 3, POFF(p_swtime), ULONG, "d"}, 133258945Sroberto {"rgid", "RGID", NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_rgid), 134258945Sroberto ULONG, UIDFMT}, 135258945Sroberto {"rlink", "RLINK", NULL, 0, pvar, 8, POFF(p_back), KPTR, "x"}, 136258945Sroberto {"rss", "RSS", NULL, 0, p_rssize, 4}, 137258945Sroberto {"rssize", "", "rsz"}, 138258945Sroberto {"rsz", "RSZ", NULL, 0, rssize, 4}, 139258945Sroberto {"rtprio", "RTPRIO", NULL, 0, pvar, 7, POFF(p_rtprio), LONG, "d"}, 140258945Sroberto {"ruid", "RUID", NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_ruid), 141258945Sroberto ULONG, UIDFMT}, 142258945Sroberto {"ruser", "RUSER", NULL, LJUST, runame, USERLEN}, 143258945Sroberto {"sess", "SESS", NULL, 0, evar, 6, EOFF(e_sess), KPTR, "x"}, 144258945Sroberto {"sig", "PENDING", NULL, 0, pvar, 8, POFF(p_siglist), LONG, "x"}, 145258945Sroberto {"sigcatch", "CAUGHT", NULL, 0, pvar, 8, POFF(p_sigcatch), LONG, "x"}, 146258945Sroberto {"sigignore", "IGNORED", 147258945Sroberto NULL, 0, pvar, 8, POFF(p_sigignore), LONG, "x"}, 148258945Sroberto {"sigmask", "BLOCKED", NULL, 0, pvar, 8, POFF(p_sigmask), LONG, "x"}, 149258945Sroberto {"sl", "SL", NULL, 0, pvar, 3, POFF(p_slptime), ULONG, "d"}, 150258945Sroberto {"start", "STARTED", NULL, LJUST|USER, started, 8}, 151258945Sroberto {"stat", "", "state"}, 152280849Scy {"state", "STAT", NULL, 0, state, 4}, 153258945Sroberto {"svgid", "SVGID", 154280849Scy NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_svgid), ULONG, UIDFMT}, 155258945Sroberto {"svuid", "SVUID", 156258945Sroberto NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_svuid), ULONG, UIDFMT}, 157258945Sroberto {"tdev", "TDEV", NULL, 0, tdev, 4}, 158280849Scy {"time", "TIME", NULL, USER, cputime, 9}, 159280849Scy {"tpgid", "TPGID", NULL, 0, evar, 4, EOFF(e_tpgid), ULONG, PIDFMT}, 160258945Sroberto {"tsess", "TSESS", NULL, 0, evar, 6, EOFF(e_tsess), KPTR, "x"}, 161280849Scy {"tsiz", "TSIZ", NULL, 0, tsize, 4}, 162258945Sroberto {"tt", "TT", NULL, LJUST, tname, 3}, 163280849Scy {"tty", "TTY", NULL, LJUST, longtname, 8}, 164280849Scy {"ucomm", "UCOMM", NULL, LJUST, ucomm, MAXCOMLEN}, 165280849Scy {"uid", "UID", NULL, 0, evar, UIDLEN, EOFF(e_ucred.cr_uid), 166258945Sroberto ULONG, UIDFMT}, 167280849Scy {"upr", "UPR", NULL, 0, pvar, 3, POFF(p_usrpri), CHAR, "d"}, 168258945Sroberto {"user", "USER", NULL, LJUST, uname, USERLEN}, 169258945Sroberto {"usrpri", "", "upr"}, 170258945Sroberto {"vsize", "", "vsz"}, 171258945Sroberto {"vsz", "VSZ", NULL, 0, vsize, 5}, 172280849Scy {"wchan", "WCHAN", NULL, LJUST, wchan, 6}, 173258945Sroberto {"xstat", "XSTAT", NULL, 0, pvar, 4, POFF(p_xstat), USHORT, "x"}, 174258945Sroberto#else 175258945Sroberto {"%cpu", "%CPU", NULL, 0, pcpu, 4}, 176258945Sroberto {"%mem", "%MEM", NULL, 0, pmem, 4}, 177258945Sroberto {"acflag", "ACFLG", NULL, USER, uvar, 3, UOFF(u_acflag), SHORT, "x"}, 178258945Sroberto {"acflg", "", "acflag"}, 179258945Sroberto {"blocked", "", "sigmask"}, 180280849Scy {"caught", "", "sigcatch"}, 181258945Sroberto {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 16}, 182258945Sroberto {"cpu", "CPU", NULL, 0, pvar, 3, POFF(p_cpu), ULONG, "d"}, 183258945Sroberto {"cputime", "", "time"}, 184258945Sroberto {"f", "F", NULL, 0, pvar, 7, POFF(p_flag), LONG, "x"}, 185258945Sroberto {"flags", "", "f"}, 186258945Sroberto {"ignored", "", "sigignore"}, 187258945Sroberto {"inblk", "INBLK", NULL, USER, rvar, 4, ROFF(ru_inblock), LONG, "d"}, 188280849Scy {"inblock", "", "inblk"}, 189258945Sroberto {"jobc", "JOBC", NULL, 0, evar, 4, EOFF(e_jobc), SHORT, "d"}, 190258945Sroberto {"ktrace", "KTRACE", NULL, 0, pvar, 8, POFF(p_traceflag), LONG, "x"}, 191258945Sroberto {"ktracep", "KTRACEP", NULL, 0, pvar, 8, POFF(p_tracep), LONG, "x"}, 192258945Sroberto {"lim", "LIM", NULL, 0, maxrss, 5}, 193258945Sroberto {"logname", "LOGNAME", NULL, LJUST, logname, MAXLOGNAME}, 194258945Sroberto {"lstart", "STARTED", NULL, LJUST|USER, lstarted, 28}, 195258945Sroberto {"majflt", "MAJFLT", NULL, USER, rvar, 4, ROFF(ru_majflt), LONG, "d"}, 196258945Sroberto {"minflt", "MINFLT", NULL, USER, rvar, 4, ROFF(ru_minflt), LONG, "d"}, 197258945Sroberto {"msgrcv", "MSGRCV", NULL, USER, rvar, 4, ROFF(ru_msgrcv), LONG, "d"}, 198280849Scy {"msgsnd", "MSGSND", NULL, USER, rvar, 4, ROFF(ru_msgsnd), LONG, "d"}, 199280849Scy {"ni", "", "nice"}, 200280849Scy {"nice", "NI", NULL, 0, pvar, 2, POFF(p_nice), CHAR, "d"}, 201280849Scy {"nivcsw", "NIVCSW", NULL, USER, rvar, 5, ROFF(ru_nivcsw), LONG, "d"}, 202280849Scy {"nsignals", "", "nsigs"}, 203280849Scy {"nsigs", "NSIGS", NULL, USER, rvar, 4, ROFF(ru_nsignals), LONG, "d"}, 204280849Scy {"nswap", "NSWAP", NULL, USER, rvar, 4, ROFF(ru_nswap), LONG, "d"}, 205280849Scy {"nvcsw", "NVCSW", NULL, USER, rvar, 5, ROFF(ru_nvcsw), LONG, "d"}, 206280849Scy {"nwchan", "WCHAN", NULL, 0, pvar, 6, POFF(p_wchan), KPTR, "x"}, 207280849Scy {"oublk", "OUBLK", NULL, USER, rvar, 4, ROFF(ru_oublock), LONG, "d"}, 208280849Scy {"oublock", "", "oublk"}, 209258945Sroberto {"p_ru", "P_RU", NULL, 0, pvar, 6, POFF(p_ru), KPTR, "x"}, 210258945Sroberto {"paddr", "PADDR", NULL, 0, evar, 6, EOFF(e_paddr), KPTR, "x"}, 211258945Sroberto {"pagein", "PAGEIN", NULL, USER, pagein, 6}, 212258945Sroberto {"pcpu", "", "%cpu"}, 213258945Sroberto {"pending", "", "sig"}, 214258945Sroberto {"pgid", "PGID", NULL, 0, evar, PIDLEN, EOFF(e_pgid), ULONG, PIDFMT}, 215258945Sroberto {"pid", "PID", NULL, 0, pvar, PIDLEN, POFF(p_pid), LONG, PIDFMT}, 216258945Sroberto {"pmem", "", "%mem"}, 217258945Sroberto {"poip", "POIP", NULL, 0, pvar, 4, POFF(p_poip), SHORT, "d"}, 218258945Sroberto {"ppid", "PPID", NULL, 0, pvar, PIDLEN, POFF(p_ppid), LONG, PIDFMT}, 219258945Sroberto {"pri", "PRI", NULL, 0, pri, 3}, 220258945Sroberto {"re", "RE", NULL, 0, pvar, 3, POFF(p_swtime), ULONG, "d"}, 221258945Sroberto {"rgid", "RGID", NULL, 0, pvar, UIDLEN, POFF(p_rgid), USHORT, UIDFMT}, 222258945Sroberto {"rlink", "RLINK", NULL, 0, pvar, 8, POFF(p_rlink), KPTR, "x"}, 223258945Sroberto {"rss", "RSS", NULL, 0, p_rssize, 4}, 224258945Sroberto {"rssize", "", "rsz"}, 225258945Sroberto {"rsz", "RSZ", NULL, 0, rssize, 4}, 226258945Sroberto {"ruid", "RUID", NULL, 0, pvar, UIDLEN, POFF(p_ruid), USHORT, UIDFMT}, 227258945Sroberto {"rtprio", "RTPRIO", NULL, 0, pvar, 7, POFF(p_rtprio), LONG, "d"}, 228258945Sroberto {"ruser", "RUSER", NULL, LJUST, runame, USERLEN}, 229258945Sroberto {"sess", "SESS", NULL, 0, evar, 6, EOFF(e_sess), KPTR, "x"}, 230258945Sroberto {"sig", "PENDING", NULL, 0, pvar, 8, POFF(p_sig), LONG, "x"}, 231258945Sroberto {"sigcatch", "CAUGHT", NULL, 0, pvar, 8, POFF(p_sigcatch), LONG, "x"}, 232258945Sroberto {"sigignore", "IGNORED", 233258945Sroberto NULL, 0, pvar, 8, POFF(p_sigignore), LONG, "x"}, 234258945Sroberto {"sigmask", "BLOCKED", NULL, 0, pvar, 8, POFF(p_sigmask), LONG, "x"}, 235258945Sroberto {"sl", "SL", NULL, 0, pvar, 3, POFF(p_slptime), ULONG, "d"}, 236258945Sroberto {"start", "STARTED", NULL, LJUST|USER, started, 8}, 237258945Sroberto {"stat", "", "state"}, 238258945Sroberto {"state", "STAT", NULL, 0, state, 4}, 239258945Sroberto {"svgid", "SVGID", 240258945Sroberto NULL, 0, pvar, UIDLEN, POFF(p_svgid), USHORT, UIDFMT}, 241258945Sroberto {"svuid", "SVUID", 242280849Scy NULL, 0, pvar, UIDLEN, POFF(p_svuid), USHORT, UIDFMT}, 243258945Sroberto {"tdev", "TDEV", NULL, 0, tdev, 4}, 244 {"time", "TIME", NULL, USER, cputime, 9}, 245 {"tpgid", "TPGID", NULL, 0, evar, 4, EOFF(e_tpgid), ULONG, PIDFMT}, 246 {"trs", "TRS", NULL, 0, trss, 3}, 247 {"tsess", "TSESS", NULL, 0, evar, 6, EOFF(e_tsess), KPTR, "x"}, 248 {"tsiz", "TSIZ", NULL, 0, tsize, 4}, 249 {"tt", "TT", NULL, LJUST, tname, 3}, 250 {"tty", "TTY", NULL, LJUST, longtname, 8}, 251 {"ucomm", "UCOMM", NULL, LJUST, ucomm, MAXCOMLEN}, 252 {"uid", "UID", NULL, 0, pvar, UIDLEN, POFF(p_uid),USHORT, UIDFMT}, 253 {"upr", "UPR", NULL, 0, pvar, 3, POFF(p_usrpri), CHAR, "d"}, 254 {"uprocp", "UPROCP", NULL, USER, uvar, 6, UOFF(u_procp), KPTR, "x"}, 255 {"user", "USER", NULL, LJUST, uname, USERLEN}, 256 {"usrpri", "", "upr"}, 257 {"vsize", "", "vsz"}, 258 {"vsz", "VSZ", NULL, 0, vsize, 5}, 259 {"wchan", "WCHAN", NULL, LJUST, wchan, 6}, 260 {"xstat", "XSTAT", NULL, 0, pvar, 4, POFF(p_xstat), USHORT, "x"}, 261#endif 262 {""}, 263}; 264 265void 266showkey() 267{ 268 VAR *v; 269 int i; 270 char *p, *sep; 271 272 i = 0; 273 sep = ""; 274 for (v = var; *(p = v->name); ++v) { 275 int len = strlen(p); 276 if (termwidth && (i += len + 1) > termwidth) { 277 i = len; 278 sep = "\n"; 279 } 280 (void) printf("%s%s", sep, p); 281 sep = " "; 282 } 283 (void) printf("\n"); 284} 285 286void 287parsefmt(p) 288 char *p; 289{ 290 static struct varent *vtail; 291 292#define FMTSEP " \t,\n" 293 while (p && *p) { 294 char *cp; 295 VAR *v; 296 struct varent *vent; 297 298 while ((cp = strsep(&p, FMTSEP)) != NULL && *cp == '\0') 299 /* void */; 300 if (!(v = findvar(cp))) 301 continue; 302 if ((vent = malloc(sizeof(struct varent))) == NULL) 303 err(1, NULL); 304 vent->var = v; 305 vent->next = NULL; 306 if (vhead == NULL) 307 vhead = vtail = vent; 308 else { 309 vtail->next = vent; 310 vtail = vent; 311 } 312 } 313 if (!vhead) 314 errx(1, "no valid keywords"); 315} 316 317static VAR * 318findvar(p) 319 char *p; 320{ 321 VAR *v, key; 322 char *hp; 323 int vcmp(); 324 325 key.name = p; 326 327 hp = strchr(p, '='); 328 if (hp) 329 *hp++ = '\0'; 330 331 key.name = p; 332 v = bsearch(&key, var, sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp); 333 334 if (v && v->alias) { 335 if (hp) { 336 warnx("%s: illegal keyword specification", p); 337 eval = 1; 338 } 339 parsefmt(v->alias); 340 return ((VAR *)NULL); 341 } 342 if (!v) { 343 warnx("%s: keyword not found", p); 344 eval = 1; 345 } 346 if (hp) 347 v->header = hp; 348 return (v); 349} 350 351static int 352vcmp(a, b) 353 const void *a, *b; 354{ 355 return (strcmp(((VAR *)a)->name, ((VAR *)b)->name)); 356} 357