|
C-Menu 0.2.9
A User Interface Toolkit
|
Find the full path of a file in the directories specified by the. More...
#include <argp.h>#include <cm.h>#include <fcntl.h>#include <limits.h>#include <stdbool.h>#include <stddef.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <sys/types.h>#include <unistd.h>Go to the source code of this file.
Enumerations | |
| enum | { WH_ALL = 1 , WH_VERBOSE = 2 } |
Functions | |
| void | whence (char *file_spec_p, int flags) |
| Find the full path of a file in the directories specified by the PATH environment variable. | |
| int | next_path (char *dp, char **sp) |
| Extract the next directory path from the PATH string. | |
| int | file_spec_parts (char *file_spec, char *file_path, char *file_name) |
| Split a file specification into directory and file name components. | |
| void | ABEND (char *pgmid, int rc, char *err_msg) |
| Exit the program with an error message. | |
| void | normalend () |
| Exit the program successfully. | |
| int | main (int argc, char **argv) |
Variables | |
| char * | path_p |
| char | path_s [MAXLEN] |
| char * | file_name [MAXLEN+1] |
| int | wh_flags = 0 |
| const char * | argp_program_version = CM_VERSION |
| const char * | argp_program_bug_address = "billxwaller@gmail.com" |
Find the full path of a file in the directories specified by the.
Definition in file whence.c.
| void ABEND | ( | char * | pgmid, |
| int | rc, | ||
| char * | err_msg ) |
Exit the program with an error message.
| pgmid | The name of the program |
| rc | The return code to exit with |
| err_msg | The error message to display |
Definition at line 235 of file whence.c.
| int file_spec_parts | ( | char * | file_spec, |
| char * | file_path, | ||
| char * | file_name ) |
Split a file specification into directory and file name components.
| file_spec | The full file specification to split |
| file_path | A buffer to store the extracted directory path |
| file_name | A buffer to store the extracted file name |
Definition at line 174 of file whence.c.
References strnz__cat(), and strnz__cpy().
Referenced by whence().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 77 of file whence.c.
References ABEND(), normalend(), path_p, WH_VERBOSE, and whence().
| int next_path | ( | char * | dp, |
| char ** | sp ) |
Extract the next directory path from the PATH string.
| dp | A buffer to store the extracted directory path |
| sp | A pointer to the current position in the PATH string |
Definition at line 145 of file whence.c.
Referenced by whence().
| void normalend | ( | ) |
| void whence | ( | char * | file_spec_p, |
| int | flags ) |
Find the full path of a file in the directories specified by the PATH environment variable.
| file_spec_p | The file specification to search for |
| flags | Flags to control the behavior of the search (e.g., verbose mode, list all matches) |
Definition at line 103 of file whence.c.
References file_spec_parts(), next_path(), path_p, path_s, strnz__cat(), strnz__cpy(), WH_ALL, and WH_VERBOSE.
Referenced by main().
| const char* argp_program_bug_address = "billxwaller@gmail.com" |
| const char* argp_program_version = CM_VERSION |