util.c

Fri, 15 Mar 2013 10:12:47 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Fri, 15 Mar 2013 10:12:47 +0000
changeset 116
5f66d3bb1c68
parent 112
ccc57312b8d0
child 117
c7ad4b23a277
permissions
-rw-r--r--

Option help display line wrapping fix

/*
 * libtu/util.c
 *
 * Copyright (c) Tuomo Valkonen 1999-2002. 
 *
 * You may distribute and modify this library under the terms of either
 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
 */

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "locale.h"
#include "util.h"
#include "misc.h"


static const char *progname=NULL;


void libtu_init(const char *argv0)
{
    progname=argv0;

#ifndef CF_NO_GETTEXT
    textdomain(simple_basename(argv0));
#endif
}


const char *libtu_progname()
{
    return progname;
}


const char *libtu_progbasename()
{
    const char *s=strrchr(progname, '/');
    
    return (s==NULL ? progname : s+1);
}

mercurial