2002-01-19 21:58:41 +01:00
|
|
|
/* sysutils.h - System utility functions for Gnupg
|
|
|
|
* Copyright (C) 2002 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of GnuPG.
|
|
|
|
*
|
Change license for some files in common to LGPLv3+/GPLv2+.
Having the LGPL on the common GnuPG code helps to share code
between GnuPG and related projects (like GPGME and Libassuan). This
is good for interoperability and to reduces bugs.
* common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c
* common/b64enc.c, common/convert.c, common/dns-cert.c
* common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c
* common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c
* common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c
* common/helpfile.c, common/homedir.c, common/http.c, common/http.h
* common/i18n.c, common/init.c, common/init.h, common/iobuf.c
* common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h
* common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h
* common/percent.c, common/pka.c, common/pka.h, common/session-env.c
* common/session-env.h, common/sexp-parse.h, common/sexputil.c
* common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c
* common/ssh-utils.h, common/sysutils.c, common/sysutils.h
* common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h
* common/userids.c, common/userids.h, common/xasprintf.c: Change
license to LGPLv3+/GPLv2+/
2012-04-20 15:43:06 +02:00
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of either
|
2002-01-19 21:58:41 +01:00
|
|
|
*
|
Change license for some files in common to LGPLv3+/GPLv2+.
Having the LGPL on the common GnuPG code helps to share code
between GnuPG and related projects (like GPGME and Libassuan). This
is good for interoperability and to reduces bugs.
* common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c
* common/b64enc.c, common/convert.c, common/dns-cert.c
* common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c
* common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c
* common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c
* common/helpfile.c, common/homedir.c, common/http.c, common/http.h
* common/i18n.c, common/init.c, common/init.h, common/iobuf.c
* common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h
* common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h
* common/percent.c, common/pka.c, common/pka.h, common/session-env.c
* common/session-env.h, common/sexp-parse.h, common/sexputil.c
* common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c
* common/ssh-utils.h, common/sysutils.c, common/sysutils.h
* common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h
* common/userids.c, common/userids.h, common/xasprintf.c: Change
license to LGPLv3+/GPLv2+/
2012-04-20 15:43:06 +02:00
|
|
|
* - the GNU Lesser General Public License as published by the Free
|
|
|
|
* Software Foundation; either version 3 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* or
|
|
|
|
*
|
|
|
|
* - 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.
|
|
|
|
*
|
|
|
|
* or both in parallel, as here.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
2002-01-19 21:58:41 +01:00
|
|
|
* 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
|
2007-07-04 21:49:40 +02:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2002-01-19 21:58:41 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GNUPG_COMMON_SYSUTILS_H
|
|
|
|
#define GNUPG_COMMON_SYSUTILS_H
|
|
|
|
|
2007-07-12 17:28:30 +02:00
|
|
|
/* Because we use system handles and not libc low level file
|
|
|
|
descriptors on W32, we need to declare them as HANDLE (which
|
|
|
|
actually is a plain pointer). This is required to eventually
|
|
|
|
support 64 bits Windows systems. */
|
|
|
|
#ifdef HAVE_W32_SYSTEM
|
|
|
|
typedef void *gnupg_fd_t;
|
|
|
|
#define GNUPG_INVALID_FD ((void*)(-1))
|
2007-10-01 16:48:39 +02:00
|
|
|
#define INT2FD(s) ((void *)(s))
|
|
|
|
#define FD2INT(h) ((unsigned int)(h))
|
2007-07-12 17:28:30 +02:00
|
|
|
#else
|
|
|
|
typedef int gnupg_fd_t;
|
|
|
|
#define GNUPG_INVALID_FD (-1)
|
2007-10-01 16:48:39 +02:00
|
|
|
#define INT2FD(s) (s)
|
|
|
|
#define FD2INT(h) (h)
|
2007-07-12 17:28:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2002-01-19 21:58:41 +01:00
|
|
|
void trap_unaligned (void);
|
|
|
|
int disable_core_dumps (void);
|
2004-05-11 11:54:52 +02:00
|
|
|
int enable_core_dumps (void);
|
2002-01-19 21:58:41 +01:00
|
|
|
const unsigned char *get_session_marker (size_t *rlen);
|
2011-04-12 16:30:08 +02:00
|
|
|
unsigned int get_uint_nonce (void);
|
2007-06-26 15:48:44 +02:00
|
|
|
/*int check_permissions (const char *path,int extension,int checkonly);*/
|
2007-06-20 13:16:42 +02:00
|
|
|
void gnupg_sleep (unsigned int seconds);
|
2007-07-12 17:28:30 +02:00
|
|
|
int translate_sys2libc_fd (gnupg_fd_t fd, int for_write);
|
|
|
|
int translate_sys2libc_fd_int (int fd, int for_write);
|
2007-08-22 12:55:07 +02:00
|
|
|
FILE *gnupg_tmpfile (void);
|
2007-12-03 14:05:15 +01:00
|
|
|
void gnupg_reopen_std (const char *pgmname);
|
2008-02-14 20:50:10 +01:00
|
|
|
void gnupg_allow_set_foregound_window (pid_t pid);
|
2010-03-24 13:15:30 +01:00
|
|
|
int gnupg_remove (const char *fname);
|
2010-04-14 13:24:02 +02:00
|
|
|
int gnupg_mkdir (const char *name, const char *modestr);
|
|
|
|
int gnupg_setenv (const char *name, const char *value, int overwrite);
|
|
|
|
int gnupg_unsetenv (const char *name);
|
2002-01-19 21:58:41 +01:00
|
|
|
|
2004-12-15 15:15:54 +01:00
|
|
|
#ifdef HAVE_W32_SYSTEM
|
2014-03-07 09:46:44 +01:00
|
|
|
void *w32_get_user_sid (void);
|
2004-12-20 17:17:25 +01:00
|
|
|
|
2010-03-10 13:24:58 +01:00
|
|
|
#include "../common/w32help.h"
|
2004-12-20 17:17:25 +01:00
|
|
|
|
2004-12-15 15:15:54 +01:00
|
|
|
#endif /*HAVE_W32_SYSTEM*/
|
2002-01-19 21:58:41 +01:00
|
|
|
|
|
|
|
#endif /*GNUPG_COMMON_SYSUTILS_H*/
|