[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS gsasl/gl
From: |
gsasl-commit |
Subject: |
CVS gsasl/gl |
Date: |
Sun, 19 Sep 2004 12:21:03 +0200 |
Update of /home/cvs/gsasl/gl
In directory dopio:/tmp/cvs-serv2389/gl
Modified Files:
getaddrinfo.c getaddrinfo.h progname.c progname.h
Log Message:
Update.
--- /home/cvs/gsasl/gl/getaddrinfo.c 2004/09/05 20:37:46 1.1
+++ /home/cvs/gsasl/gl/getaddrinfo.c 2004/09/19 10:21:02 1.2
@@ -1,6 +1,6 @@
/* Get address information (partial implementation).
- Copyright (C) 2004 Free Software Foundation, Inc.
- Written by Simon Josefsson <address@hidden>.
+ Copyright (C) 1997, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Simon Josefsson <address@hidden>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -142,13 +142,13 @@
void
freeaddrinfo (struct addrinfo *ai)
{
- struct addrinfo *p;
-
- while (ai != NULL)
+ while (ai)
{
- p = ai;
+ struct addrinfo *cur;
+
+ cur = ai;
ai = ai->ai_next;
- free (p);
+ free (cur);
}
}
--- /home/cvs/gsasl/gl/getaddrinfo.h 2004/09/05 20:37:46 1.1
+++ /home/cvs/gsasl/gl/getaddrinfo.h 2004/09/19 10:21:02 1.2
@@ -1,6 +1,6 @@
/* Get address information.
- Copyright (C) 2004 Free Software Foundation, Inc.
- Written by Simon Josefsson <address@hidden>.
+ Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+ Contributed by Simon Josefsson <address@hidden>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
--- /home/cvs/gsasl/gl/progname.c 2004/08/03 16:11:47 1.1
+++ /home/cvs/gsasl/gl/progname.c 2004/09/19 10:21:02 1.2
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004 Free Software Foundation, Inc.
Written by Bruno Haible <address@hidden>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -51,3 +51,16 @@
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. */
+const char *
+get_short_program_name (void)
+{
+ const char *slash = NULL;
+ if (program_name)
+ slash = strrchr (program_name, '/');
+ return slash != NULL ? slash + 1 : program_name;
+}
--- /home/cvs/gsasl/gl/progname.h 2004/08/03 21:31:14 1.2
+++ /home/cvs/gsasl/gl/progname.h 2004/09/19 10:21:02 1.3
@@ -16,8 +16,8 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef _PROGNAME_H
-#define _PROGNAME_H
+#ifndef PROGNAME_H
+#define PROGNAME_H
/* Programs using this file should do the following in main():
set_program_name (argv[0]);
@@ -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 const char *get_short_program_name (void);
#ifdef __cplusplus
@@ -57,4 +47,4 @@
#endif
-#endif /* _PROGNAME_H */
+#endif /* PROGNAME_H */