Releasing version 3-2014010504
[notion/jeffpc.git] / libtu / util.c
blobe4168710063991efba56097040f2fd8b12257b4a
1 /*
2 * libtu/util.c
4 * Copyright (c) Tuomo Valkonen 1999-2002.
6 * You may distribute and modify this library under the terms of either
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
8 */
10 #include <stdarg.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
15 #include "locale.h"
16 #include "util.h"
17 #include "misc.h"
20 static const char *progname=NULL;
23 void libtu_init(const char *argv0)
25 progname=argv0;
27 #ifndef CF_NO_GETTEXT
28 textdomain(simple_basename(argv0));
29 #endif
33 const char *libtu_progname()
35 return progname;
39 const char *libtu_progbasename()
41 const char *s=strrchr(progname, '/');
43 return (s==NULL ? progname : s+1);