shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS shishi/gl


From: shishi-commit
Subject: CVS shishi/gl
Date: Wed, 08 Sep 2004 14:30:23 +0200

Update of /home/cvs/shishi/gl
In directory dopio:/tmp/cvs-serv4150/gl

Modified Files:
        progname.c progname.h 
Log Message:
Use short progname in syslog.

--- /home/cvs/shishi/gl/progname.c      2003/12/10 22:42:23     1.1
+++ /home/cvs/shishi/gl/progname.c      2004/09/08 12:30:23     1.2
@@ -51,3 +51,15 @@
     argv0 = base + 3;
   program_name = argv0;
 }
+
+/* Return short program name of the current executable, based on the
+   earlier call to set_program_name.  Return NULL if unknown.  The
+   short program name is computed by removing all directory names and
+   path separators. */
+char *
+get_short_program_name (void)
+{
+  const char *slash;
+  slash = strrchr (program_name, '/');
+  return slash != NULL ? slash + 1 : program_name;
+}
--- /home/cvs/shishi/gl/progname.h      2004/08/07 14:06:59     1.3
+++ /home/cvs/shishi/gl/progname.h      2004/09/08 12:30:23     1.4
@@ -35,21 +35,11 @@
 /* Set program_name, based on argv[0].  */
 extern void set_program_name (const char *argv0);
 
-#if ENABLE_RELOCATABLE
-
-/* Set program_name, based on argv[0], and original installation prefix and
-   directory, for relocatability.  */
-extern void set_program_name_and_installdir (const char *argv0,
-                                            const char *orig_installprefix,
-                                            const char *orig_installdir);
-#define set_program_name(ARG0) \
-  set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
-
-/* Return the full pathname of the current executable, based on the earlier
-   call to set_program_name_and_installdir.  Return NULL if unknown.  */
-extern char *get_full_program_name (void);
-
-#endif
+/* Return short program name of the current executable, based on the
+   earlier call to set_program_name.  Return NULL if unknown.  The
+   short program name is computed by removing all directory names and
+   path separators. */
+extern char *get_short_program_name (void);
 
 
 #ifdef __cplusplus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]