From 543a46659b52f8fef68c4121357e04370e0b351b Mon Sep 17 00:00:00 2001 From: kojima Date: Fri, 9 Feb 2001 16:05:49 +0000 Subject: [PATCH] aded new stuffs --- configure.in | 2 +- util/wdread.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++ util/wmchlocale.in | 122 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 util/wdread.c create mode 100644 util/wmchlocale.in diff --git a/configure.in b/configure.in index 4b5e1073..f8b6b33b 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,7 @@ AC_INIT(src/WindowMaker.h) -AM_INIT_AUTOMAKE(WindowMaker, 0.63.1) +AM_INIT_AUTOMAKE(WindowMaker, 0.64.0) AM_PROG_LIBTOOL diff --git a/util/wdread.c b/util/wdread.c new file mode 100644 index 00000000..d0e84558 --- /dev/null +++ b/util/wdread.c @@ -0,0 +1,131 @@ +/* wdread.c - read value from defaults database + * + * WindowMaker window manager + * + * Copyright (c) 1997, 1998 Alfredo K. Kojima + * (cowardly remade from wdwrite.c; by judas@hell on Jan 26 2001) + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#define PROG_VERSION "wdread (Window Maker) 0.2" + + +/* + * WindowMaker defaults DB reader + */ + + +#include "../src/wconfig.h" + +#include +#include +#include +#include + +#include +#include + + +char *ProgName; + +char* +gethomedir() +{ + char *home = getenv("HOME"); + struct passwd *user; + + if (home) + return home; + + user = getpwuid(getuid()); + if (!user) { + perror(ProgName); + return "/"; + } + if (!user->pw_dir) { + return "/"; + } else { + return user->pw_dir; + } +} + + + +void wAbort() +{ + exit(0); +} + +void help() +{ + printf("Syntax:\n%s [OPTIONS]