| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2e95972 commit e662af4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,7 @@ | |||
| 30 | 30 | * !Ifilename | |
| 31 | 31 | * !Dfilename | |
| 32 | 32 | * !Ffilename | |
| 33 | + * !Pfilename | ||
| 33 | 34 | * | |
| 34 | 35 | */ | |
| 35 | 36 | ||
@@ -57,6 +58,7 @@ FILEONLY *symbolsonly; | |||
| 57 | 58 | typedef void FILELINE(char * file, char * line); | |
| 58 | 59 | FILELINE * singlefunctions; | |
| 59 | 60 | FILELINE * entity_system; | |
| 61 | + FILELINE * docsection; | ||
| 60 | 62 | ||
| 61 | 63 | #define MAXLINESZ 2048 | |
| 62 | 64 | #define MAXFILES 250 | |
@@ -288,13 +290,37 @@ void singfunc(char * filename, char * line) | |||
| 288 | 290 | exec_kernel_doc(vec); | |
| 289 | 291 | } | |
| 290 | 292 | ||
| 293 | + /* | ||
| 294 | + * Insert specific documentation section from a file. | ||
| 295 | + * Call kernel-doc with the following parameters: | ||
| 296 | + * kernel-doc -docbook -function "doc section" filename | ||
| 297 | + */ | ||
| 298 | + void docsect(char *filename, char *line) | ||
| 299 | + { | ||
| 300 | + char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ | ||
| 301 | + char *s; | ||
| 302 | + | ||
| 303 | + for (s = line; *s; s++) | ||
| 304 | + if (*s == '\n') | ||
| 305 | + *s = '\0'; | ||
| 306 | + | ||
| 307 | + vec[0] = KERNELDOC; | ||
| 308 | + vec[1] = DOCBOOK; | ||
| 309 | + vec[2] = FUNCTION; | ||
| 310 | + vec[3] = line; | ||
| 311 | + vec[4] = filename; | ||
| 312 | + vec[5] = NULL; | ||
| 313 | + exec_kernel_doc(vec); | ||
| 314 | + } | ||
| 315 | + | ||
| 291 | 316 | /* | |
| 292 | 317 | * Parse file, calling action specific functions for: | |
| 293 | 318 | * 1) Lines containing !E | |
| 294 | 319 | * 2) Lines containing !I | |
| 295 | 320 | * 3) Lines containing !D | |
| 296 | 321 | * 4) Lines containing !F | |
| 297 | - * 5) Default lines - lines not matching the above | ||
| 322 | + * 5) Lines containing !P | ||
| 323 | + * 6) Default lines - lines not matching the above | ||
| 298 | 324 | */ | |
| 299 | 325 | void parse_file(FILE *infile) | |
| 300 | 326 | { | |
@@ -328,6 +354,15 @@ void parse_file(FILE *infile) | |||
| 328 | 354 | s++; | |
| 329 | 355 | singlefunctions(line +2, s); | |
| 330 | 356 | break; | |
| 357 | + case 'P': | ||
| 358 | + /* filename */ | ||
| 359 | + while (*s && !isspace(*s)) s++; | ||
| 360 | + *s++ = '\0'; | ||
| 361 | + /* DOC: section name */ | ||
| 362 | + while (isspace(*s)) | ||
| 363 | + s++; | ||
| 364 | + docsection(line + 2, s); | ||
| 365 | + break; | ||
| 331 | 366 | default: | |
| 332 | 367 | defaultline(line); | |
| 333 | 368 | } | |
@@ -374,6 +409,7 @@ int main(int argc, char *argv[]) | |||
| 374 | 409 | externalfunctions = find_export_symbols; | |
| 375 | 410 | symbolsonly = find_export_symbols; | |
| 376 | 411 | singlefunctions = noaction2; | |
| 412 | + docsection = noaction2; | ||
| 377 | 413 | parse_file(infile); | |
| 378 | 414 | ||
| 379 | 415 | /* Rewind to start from beginning of file again */ | |
@@ -383,6 +419,7 @@ int main(int argc, char *argv[]) | |||
| 383 | 419 | externalfunctions = extfunc; | |
| 384 | 420 | symbolsonly = printline; | |
| 385 | 421 | singlefunctions = singfunc; | |
| 422 | + docsection = docsect; | ||
| 386 | 423 | ||
| 387 | 424 | parse_file(infile); | |
| 388 | 425 | } | |
@@ -396,6 +433,7 @@ int main(int argc, char *argv[]) | |||
| 396 | 433 | externalfunctions = adddep; | |
| 397 | 434 | symbolsonly = adddep; | |
| 398 | 435 | singlefunctions = adddep2; | |
| 436 | + docsection = adddep2; | ||
| 399 | 437 | parse_file(infile); | |
| 400 | 438 | printf("\n"); | |
| 401 | 439 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments