2 * Copyright (c) 1983 Regents of the University of California.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that: (1) source distributions retain this entire copyright
7 * notice and comment, and (2) distributions including binaries display
8 * the following acknowledgement: ``This product includes software
9 * developed by the University of California, Berkeley and its contributors''
10 * in the documentation or other materials provided with the distribution
11 * and in all advertising materials mentioning features or use of this
12 * software. Neither the name of the University nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 static char sccsid
[] = "@(#)printlist.c 5.5 (Berkeley) 6/1/90";
27 * these are the lists of names:
28 * there is the list head and then the listname
29 * is a pointer to the list head
30 * (for ease of passing to stringlist functions).
32 struct stringlist kfromhead
= { 0 , 0 };
33 struct stringlist
*kfromlist
= &kfromhead
;
34 struct stringlist ktohead
= { 0 , 0 };
35 struct stringlist
*ktolist
= &ktohead
;
36 struct stringlist fhead
= { 0 , 0 };
37 struct stringlist
*flist
= &fhead
;
38 struct stringlist Fhead
= { 0 , 0 };
39 struct stringlist
*Flist
= &Fhead
;
40 struct stringlist ehead
= { 0 , 0 };
41 struct stringlist
*elist
= &ehead
;
42 struct stringlist Ehead
= { 0 , 0 };
43 struct stringlist
*Elist
= &Ehead
;
45 addlist( listp
, funcname
)
46 struct stringlist
*listp
;
49 struct stringlist
*slp
;
51 slp
= (struct stringlist
*) malloc( sizeof(struct stringlist
));
52 if ( slp
== (struct stringlist
*) 0 ) {
53 fprintf( stderr
, "gprof: ran out room for printlist\n" );
56 slp
-> next
= listp
-> next
;
57 slp
-> string
= funcname
;
62 onlist( listp
, funcname
)
63 struct stringlist
*listp
;
66 struct stringlist
*slp
;
68 for ( slp
= listp
-> next
; slp
; slp
= slp
-> next
) {
69 if ( ! strcmp( slp
-> string
, funcname
) ) {
72 if ( funcname
[0] == '_' && ! strcmp( slp
-> string
, &funcname
[1] ) ) {
This page took 0.03954 seconds and 4 git commands to generate.