| 560 | } /* Parse */ |
| 561 | |
| 562 | static FILE *OpenConfFile( char *FileName ) |
| 563 | /* ------------------------------------------------------------------------ ** |
| 564 | * Open a config file. |
| 565 | * |
| 566 | * Input: FileName - The pathname of the config file to be opened. |
| 567 | * |
| 568 | * Output: A pointer of type (FILE *) to the opened file, or NULL if the |
| 569 | * file could not be opened. |
| 570 | * |
| 571 | * ------------------------------------------------------------------------ ** |
| 572 | */ |
| 573 | { |
| 574 | FILE *OpenedFile; |
| 575 | char *func = "params.c:OpenConfFile() -"; |
| 576 | |
| 577 | if( NULL == FileName || 0 == *FileName ) |
| 578 | { |
| 579 | rprintf(FLOG, "%s No config filename specified.\n", func); |
| 580 | return( NULL ); |
| 581 | } |
| 582 | |
| 583 | OpenedFile = fopen( FileName, "r" ); |
| 584 | if( NULL == OpenedFile ) |
| 585 | { |
| 586 | rsyserr(FLOG, errno, "unable to open config file \"%s\"", |
| 587 | FileName); |
| 588 | } |
| 589 | |
| 590 | return( OpenedFile ); |
| 591 | } /* OpenConfFile */ |
| 592 | |
| 593 | int pm_process( char *FileName, |
| 594 | BOOL (*sfunc)(char *), |
no test coverage detected