summaryrefslogtreecommitdiff
path: root/jam-files/engine/pathsys.h
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-05-13 03:35:30 +0200
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-05-13 03:35:30 +0200
commit670a8f984fc6d8342180c59ae9e96b0b76f34d3d (patch)
tree9f2ce7eec1a77e56b3bb1ad0ad40f212d7a996b0 /jam-files/engine/pathsys.h
parenteb3ee28dc0eb1d3e5ed01ba0df843be329ae450d (diff)
parent2f64af3e06a518b93f7ca2c30a9d0aeb2c947031 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'jam-files/engine/pathsys.h')
-rw-r--r--jam-files/engine/pathsys.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/jam-files/engine/pathsys.h b/jam-files/engine/pathsys.h
new file mode 100644
index 00000000..73775810
--- /dev/null
+++ b/jam-files/engine/pathsys.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
+ *
+ * This file is part of Jam - see jam.c for Copyright information.
+ */
+
+/*
+ * pathsys.h - PATHNAME struct
+ */
+
+/*
+ * PATHNAME - a name of a file, broken into <grist>dir/base/suffix(member)
+ *
+ * <grist> is salt to distinguish between targets that otherwise would
+ * have the same name: it never appears in the bound name of a target.
+ * (member) is an archive member name: the syntax is arbitrary, but must
+ * agree in path_parse(), path_build() and the Jambase.
+ *
+ * On VMS, we keep track of whether the original path was a directory
+ * (without a file), so that $(VAR:D) can climb to the parent.
+ */
+
+#ifndef PATHSYS_VP_20020211_H
+# define PATHSYS_VP_20020211_H
+
+#include "strings.h"
+
+typedef struct _pathname PATHNAME;
+typedef struct _pathpart PATHPART;
+
+struct _pathpart
+{
+ char * ptr;
+ int len;
+};
+
+struct _pathname
+{
+ PATHPART part[6];
+#ifdef OS_VMS
+ int parent;
+#endif
+
+#define f_grist part[0]
+#define f_root part[1]
+#define f_dir part[2]
+#define f_base part[3]
+#define f_suffix part[4]
+#define f_member part[5]
+};
+
+void path_build( PATHNAME * f, string * file, int binding );
+void path_build1( PATHNAME * f, string * file );
+
+void path_parse( char * file, PATHNAME * f );
+void path_parent( PATHNAME * f );
+
+#ifdef NT
+
+/** Returns newstr-allocated string with long equivivalent of 'short_name'.
+ If none exists -- i.e. 'short_path' is already long path, it's returned
+ unaltered. */
+char * short_path_to_long_path( char * short_path );
+
+#endif
+
+#ifdef USE_PATHUNIX
+/** Returns a static pointer to the system dependent path to the temporary
+ directory. NOTE: *without* a trailing path separator.
+*/
+const char * path_tmpdir( void );
+
+/** Returns a new temporary name.
+*/
+const char * path_tmpnam( void );
+
+/** Returns a new temporary path.
+*/
+const char * path_tmpfile( void );
+#endif
+
+/** Give the first argument to 'main', return a full path to
+ our executable. Returns null in the unlikely case it
+ cannot be determined. Caller is responsible for freeing
+ the string.
+
+ Implemented in jam.c
+*/
+char * executable_path (char *argv0);
+
+#endif