osprey/common/util/file_util.c File Reference

#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"

Include dependency graph for file_util.c:

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


Define Documentation

#define is_absolute_file_name ( file_name   )     ((file_name)[0] == '/')

Definition at line 389 of file file_util.c.

Referenced by find_toolroot(), and Make_Absolute_Path().


Function Documentation

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 
)

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 
)

Definition at line 144 of file file_util.c.

References FALSE, INT16, strcmp(), and strlen().

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  ) 

char* Make_Absolute_Path ( char *  filename  ) 

char* Make_Temp_File ( char *  tmp,
char *  prefix 
)

Definition at line 236 of file file_util.c.

References getpid, INT16, len, malloc, sprintf(), strcpy, and strlen().

char* New_Extension ( const char *  name,
const char *  ext 
)

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().

BOOL Same_File ( FILE file1,
FILE file2 
)

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().


Variable Documentation

char* cwd = NULL [static]

INT cwd_size [static]

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.


Generated on Wed Apr 8 14:43:03 2009 for Open64 by  doxygen 1.5.6