]> git.decadent.org.uk Git - ion3.git/blob - libtu/util.c
[svn-upgrade] Integrating new upstream version, ion3 (20070708)
[ion3.git] / libtu / util.c
1 /*
2  * libtu/util.c
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2002. 
5  *
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  */
9
10 #include <stdarg.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14
15 #include "locale.h"
16 #include "util.h"
17 #include "misc.h"
18
19
20 static const char *progname=NULL;
21
22
23 void libtu_init(const char *argv0)
24 {
25     progname=argv0;
26
27 #ifndef CF_NO_GETTEXT
28     textdomain(simple_basename(argv0));
29 #endif
30 }
31
32
33 const char *libtu_progname()
34 {
35     return progname;
36 }
37
38
39 const char *libtu_progbasename()
40 {
41     const char *s=strrchr(progname, '/');
42     
43     return (s==NULL ? progname : s+1);
44 }
45