00001 /* 00002 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc. 00003 * 00004 * This file is part of Jam - see jam.c for Copyright information. 00005 */ 00006 00007 /* 00008 * pathsys.h - PATHNAME struct 00009 * 00010 * Changes: 00011 * 00012 * 11/04/02 (seiwald) - const-ing for string literals 00013 */ 00014 00015 /* 00016 * PATHNAME - a name of a file, broken into <grist>dir/base/suffix(member) 00017 * 00018 * <grist> is salt to distinguish between targets that otherwise would 00019 * have the same name: it never appears in the bound name of a target. 00020 * (member) is an archive member name: the syntax is arbitrary, but must 00021 * agree in path_parse(), path_build() and the Jambase. 00022 * 00023 * On VMS, we keep track of whether the original path was a directory 00024 * (without a file), so that $(VAR:D) can climb to the parent. 00025 */ 00026 00027 typedef struct _pathname PATHNAME; 00028 typedef struct _pathpart PATHPART; 00029 00030 struct _pathpart { 00031 const char *ptr; 00032 int len; 00033 }; 00034 00035 struct _pathname { 00036 PATHPART part[6]; 00037 # ifdef OS_VMS 00038 int parent; 00039 # endif 00040 00041 # define f_grist part[0] 00042 # define f_root part[1] 00043 # define f_dir part[2] 00044 # define f_base part[3] 00045 # define f_suffix part[4] 00046 # define f_member part[5] 00047 00048 } ; 00049 00050 void path_build( PATHNAME *f, char *file, int binding ); 00051 void path_parse( const char *file, PATHNAME *f ); 00052 void path_parent( PATHNAME *f ); 00053