123 |
void add_new_symbol(struct symfile *sym, char * symname) |
void add_new_symbol(struct symfile *sym, char * symname) |
124 |
{ |
{ |
125 |
sym->symbollist = |
sym->symbollist = |
126 |
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); |
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); |
127 |
sym->symbollist[sym->symbolcnt++].name = strdup(symname); |
sym->symbollist[sym->symbolcnt++].name = strdup(symname); |
128 |
} |
} |
129 |
|
|
178 |
fprintf(stderr, "docproc: "); |
fprintf(stderr, "docproc: "); |
179 |
perror(real_filename); |
perror(real_filename); |
180 |
} |
} |
181 |
while(fgets(line, MAXLINESZ, fp)) { |
while (fgets(line, MAXLINESZ, fp)) { |
182 |
char *p; |
char *p; |
183 |
char *e; |
char *e; |
184 |
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != 0) || |
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != 0) || |
185 |
((p = strstr(line, "EXPORT_SYMBOL")) != 0)) { |
((p = strstr(line, "EXPORT_SYMBOL")) != 0)) { |
186 |
/* Skip EXPORT_SYMBOL{_GPL} */ |
/* Skip EXPORT_SYMBOL{_GPL} */ |
187 |
while (isalnum(*p) || *p == '_') |
while (isalnum(*p) || *p == '_') |
188 |
p++; |
p++; |
256 |
void singfunc(char * filename, char * line) |
void singfunc(char * filename, char * line) |
257 |
{ |
{ |
258 |
char *vec[200]; /* Enough for specific functions */ |
char *vec[200]; /* Enough for specific functions */ |
259 |
int i, idx = 0; |
int i, idx = 0; |
260 |
int startofsym = 1; |
int startofsym = 1; |
261 |
vec[idx++] = KERNELDOC; |
vec[idx++] = KERNELDOC; |
262 |
vec[idx++] = DOCBOOK; |
vec[idx++] = DOCBOOK; |
263 |
|
|
264 |
/* Split line up in individual parameters preceeded by FUNCTION */ |
/* Split line up in individual parameters preceeded by FUNCTION */ |
265 |
for (i=0; line[i]; i++) { |
for (i=0; line[i]; i++) { |
266 |
if (isspace(line[i])) { |
if (isspace(line[i])) { |
267 |
line[i] = '\0'; |
line[i] = '\0'; |
268 |
startofsym = 1; |
startofsym = 1; |
269 |
continue; |
continue; |
270 |
} |
} |
271 |
if (startofsym) { |
if (startofsym) { |
272 |
startofsym = 0; |
startofsym = 0; |
273 |
vec[idx++] = FUNCTION; |
vec[idx++] = FUNCTION; |
274 |
vec[idx++] = &line[i]; |
vec[idx++] = &line[i]; |
275 |
} |
} |
276 |
} |
} |
277 |
vec[idx++] = filename; |
vec[idx++] = filename; |
278 |
vec[idx] = NULL; |
vec[idx] = NULL; |
279 |
exec_kernel_doc(vec); |
exec_kernel_doc(vec); |
291 |
{ |
{ |
292 |
char line[MAXLINESZ]; |
char line[MAXLINESZ]; |
293 |
char * s; |
char * s; |
294 |
while(fgets(line, MAXLINESZ, infile)) { |
while (fgets(line, MAXLINESZ, infile)) { |
295 |
if (line[0] == '!') { |
if (line[0] == '!') { |
296 |
s = line + 2; |
s = line + 2; |
297 |
switch (line[1]) { |
switch (line[1]) { |
307 |
break; |
break; |
308 |
case 'D': |
case 'D': |
309 |
while (*s && !isspace(*s)) s++; |
while (*s && !isspace(*s)) s++; |
310 |
*s = '\0'; |
*s = '\0'; |
311 |
symbolsonly(line+2); |
symbolsonly(line+2); |
312 |
break; |
break; |
313 |
case 'F': |
case 'F': |
314 |
/* filename */ |
/* filename */ |
315 |
while (*s && !isspace(*s)) s++; |
while (*s && !isspace(*s)) s++; |
316 |
*s++ = '\0'; |
*s++ = '\0'; |
317 |
/* function names */ |
/* function names */ |
318 |
while (isspace(*s)) |
while (isspace(*s)) |
319 |
s++; |
s++; |
320 |
singlefunctions(line +2, s); |
singlefunctions(line +2, s); |
331 |
} |
} |
332 |
|
|
333 |
|
|
334 |
int main(int argc, char *argv[]) |
int main(int argc, char **argv) |
335 |
{ |
{ |
336 |
FILE * infile; |
FILE * infile; |
337 |
if (argc != 3) { |
if (argc != 3) { |
340 |
} |
} |
341 |
/* Open file, exit on error */ |
/* Open file, exit on error */ |
342 |
infile = fopen(argv[2], "r"); |
infile = fopen(argv[2], "r"); |
343 |
if (infile == NULL) { |
if (infile == NULL) { |
344 |
fprintf(stderr, "docproc: "); |
fprintf(stderr, "docproc: "); |
345 |
perror(argv[2]); |
perror(argv[2]); |
346 |
exit(2); |
exit(2); |
347 |
} |
} |
348 |
|
|
349 |
if (strcmp("doc", argv[1]) == 0) |
if (strcmp("doc", argv[1]) == 0) |
350 |
{ |
{ |