#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <sys/param.h>#include <stdlib.h>#include <stdio.h>#include <cmplrs/rcodes.h>#include "defs.h"#include "file_util.h"

Go to the source code of this file.
Defines | |
| #define | is_absolute_file_name(file_name) ((file_name)[0] == '/') |
Functions/Subroutines | |
| BOOL | Is_File (const char *fname) |
| BOOL | Same_File (FILE *file1, FILE *file2) |
| BOOL | Find_File (char *name, char *ext) |
| BOOL | Has_Extension (char *name, char *ext) |
| char * | New_Extension (const char *name, const char *ext) |
| char * | Remove_Extension (char *name) |
| char * | Make_Temp_File (char *tmp, char *prefix) |
| char * | Get_Current_Working_Directory (void) |
| char * | Full_Path_Name (char *base, char *path, INT pathlen) |
| char * | Last_Pathname_Component (char *pname) |
| static char * | normalize_path (char *path) |
| char * | Make_Absolute_Path (char *filename) |
Variables | |
| static char * | source_file = __FILE__ |
| static char * | rcs_id = "$Source: /depot/CVSROOT/javi/src/sw/cmplr/common/util/file_util.c,v $ $Revision: 1.1 $" |
| static char * | cwd = NULL |
| static INT | cwd_size |
Definition at line 389 of file file_util.c.
Referenced by find_toolroot(), and Make_Absolute_Path().
| BOOL Find_File | ( | char * | name, | |
| char * | ext | |||
| ) |
Definition at line 113 of file file_util.c.
References FALSE, Has_Extension(), INT16, Is_File(), len, strcat(), strlen(), and TRUE.
| char* Full_Path_Name | ( | char * | base, | |
| char * | path, | |||
| INT | pathlen | |||
| ) |
Definition at line 283 of file file_util.c.
References cwd, cwd_size, exit(), Get_Current_Working_Directory(), INT, NULL, RC_SYSTEM_ERROR, strcat(), strcpy, and strlen().
| char* Get_Current_Working_Directory | ( | void | ) |
Definition at line 259 of file file_util.c.
References cwd, getcwd, getenv(), MAXPATHLEN, and NULL.
Referenced by cwh_dst_init_file(), DST_build(), Full_Path_Name(), and Make_Absolute_Path().
| BOOL Has_Extension | ( | char * | name, | |
| char * | ext | |||
| ) |
| BOOL Is_File | ( | const char * | fname | ) |
Definition at line 61 of file file_util.c.
References FALSE, NULL, S_IFREG, and stat::st_mode.
Referenced by Diag_Set_File(), Find_File(), and Set_Error_File().
| char* Last_Pathname_Component | ( | char * | pname | ) |
Definition at line 330 of file file_util.c.
References strlen().
Referenced by Derive_Anl_Filename(), DST_build(), Move_Locations_To_Anl_File(), Phase_Init(), Prepare_Listing_File(), Prepare_Source(), Process_Cc1_Command_Line(), Process_Command_Line(), Process_Filename_Options(), and Process_GDAR().
| char* Make_Absolute_Path | ( | char * | filename | ) |
Definition at line 395 of file file_util.c.
References cwd, cwd_size, exit(), Get_Current_Working_Directory(), INT64, is_absolute_file_name, malloc, normalize_path(), NULL, perror(), RC_SYSTEM_ERROR, strcpy, strlen(), and void.
Referenced by cwh_dst_enter_path().
| char* Make_Temp_File | ( | char * | tmp, | |
| char * | prefix | |||
| ) |
| char* New_Extension | ( | const char * | name, | |
| const char * | ext | |||
| ) |
Definition at line 173 of file file_util.c.
References i, INT16, len, malloc, strcat(), strcpy, and strlen().
Referenced by Derive_Anl_Filename(), DRA_Make_File_Name(), Move_Locations_To_Anl_File(), PDGCS_initialize(), Phase_Init(), Prepare_Listing_File(), Prepare_Source(), Process_Command_Line(), and Process_Filename_Options().
| static char* normalize_path | ( | char * | path | ) | [static] |
Definition at line 352 of file file_util.c.
References inp, NULL, outp, and tmp.
Referenced by Make_Absolute_Path().
| char* Remove_Extension | ( | char * | name | ) |
Definition at line 205 of file file_util.c.
References i, INT16, len, malloc, strcpy, and strlen().
Referenced by Process_GDAR().
Definition at line 86 of file file_util.c.
References FALSE, fileno, fstat, NULL, stat::st_dev, and stat::st_ino.
Referenced by Close_File(), Diag_Set_File(), Init_Error_File(), and Set_Error_Trace().
char* cwd = NULL [static] |
Definition at line 255 of file file_util.c.
Referenced by __attribute__(), CG_End_Final(), end_final(), Full_Path_Name(), Get_Current_Working_Directory(), get_cwd(), main(), and Make_Absolute_Path().
Definition at line 256 of file file_util.c.
Referenced by Full_Path_Name(), and Make_Absolute_Path().
char* rcs_id = "$Source: /depot/CVSROOT/javi/src/sw/cmplr/common/util/file_util.c,v $ $Revision: 1.1 $" [static] |
Definition at line 38 of file file_util.c.
char* source_file = __FILE__ [static] |
Definition at line 37 of file file_util.c.
1.5.6