diff options
author | Adam Heath <doogie@debian.org> | 2003-09-13 19:31:50 +0000 |
---|---|---|
committer | Adam Heath <doogie@debian.org> | 2003-09-13 19:31:50 +0000 |
commit | 285c4bbec46fd06b985c8652b0c05d12f65a3b9b (patch) | |
tree | 21d95fba4f22854d00cdf44de71efcdd965ac6da /lib | |
parent | 60b296589d6784333744503f409b3569a2f7ea95 (diff) | |
download | dpkg-285c4bbec46fd06b985c8652b0c05d12f65a3b9b.tar.gz |
Change standard_startup and standard_shutdown into macros.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.in | 2 | ||||
-rw-r--r-- | lib/startup.c | 65 |
2 files changed, 1 insertions, 66 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in index 74484383b..05b91e57c 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -9,7 +9,7 @@ include ../Makefile.conf SOURCES = compat.c database.c dbmodify.c dump.c ehandle.c fields.c \ lock.c mlib.c myopt.c nfmalloc.c parse.c parsehelp.c \ showcright.c showpkg.c tarfn.c varbuf.c vercmp.c md5.c \ - utils.c startup.c + utils.c OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) GENFILES = $(OBJECTS) libdpkg.a diff --git a/lib/startup.c b/lib/startup.c deleted file mode 100644 index 1458ca3df..000000000 --- a/lib/startup.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * dpkg - main program for package management - * main.c - main program - * - * Copyright (C) 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk> - * - * This 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, - * or (at your option) any later version. - * - * This 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 dpkg; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <signal.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <errno.h> -#include <unistd.h> -#include <dirent.h> -#include <limits.h> -#include <ctype.h> - -#include <config.h> -#include <dpkg.h> -#include <dpkg-db.h> -#include <version.h> -#include <myopt.h> - -void standard_startup(jmp_buf *ejbuf, int argc, const char *const **argv, const char *prog, int loadcfg, const struct cmdinfo cmdinfos[]) { - - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - - if (setjmp(*ejbuf)) { /* expect warning about possible clobbering of argv */ - error_unwind(ehflag_bombout); exit(2); - } - push_error_handler(ejbuf,print_error_fatal,0); - - umask(022); /* Make sure all our status databases are readable. */ - - if (loadcfg) - loadcfgfile(prog, cmdinfos); - - myopt(argv,cmdinfos); -} - -void standard_shutdown(int freemem) { - set_error_display(0,0); - error_unwind(ehflag_normaltidy); - if (freemem) - nffreeall(); -} |