1/* 2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc. 3 * 4 * This file is part of Jam - see jam.c for Copyright information. 5 */ 6 7/* 8 * pathsys.h - PATHNAME struct 9 * 10 * 11/04/02 (seiwald) - const-ing for string literals 11 */ 12 13/* 14 * PATHNAME - a name of a file, broken into <grist>dir/base/suffix(member) 15 * 16 * <grist> is salt to distinguish between targets that otherwise would 17 * have the same name: it never appears in the bound name of a target. 18 * (member) is an archive member name: the syntax is arbitrary, but must 19 * agree in path_parse(), path_build() and the Jambase. 20 * 21 * On VMS, we keep track of whether the original path was a directory 22 * (without a file), so that $(VAR:D) can climb to the parent. 23 */ 24 25typedef struct _pathname PATHNAME; 26typedef struct _pathpart PATHPART; 27 28struct _pathpart { 29 const char *ptr; 30 int len; 31}; 32 33struct _pathname { 34 PATHPART part[6]; 35# ifdef OS_VMS 36 int parent; 37# endif 38 39# define f_grist part[0] 40# define f_root part[1] 41# define f_dir part[2] 42# define f_base part[3] 43# define f_suffix part[4] 44# define f_member part[5] 45 46} ; 47 48void path_build( PATHNAME *f, char *file, int binding ); 49void path_parse( const char *file, PATHNAME *f ); 50void path_parent( PATHNAME *f ); 51 52char *normalize_path(const char *path, char *buffer, size_t bufferSize); 53