/*
 * ----------------------------------------------------------------
 * Night Light System Functions Header
 * ----------------------------------------------------------------
 * Copyright (C) 1997-2003 Jonas Kvinge <jonas@night-light.net>
 * All rights reserved.
 *
 * 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.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Last modified by:
 * Jonas Kvinge (23.08.2001)
 *
 */

#ifdef SYSCALLS_H
#warning "syscalls.h already included."
#else
#define SYSCALLS_H

struct in_addr;

/* VARIABLES - JONAS (18.07.2001) */

#ifdef SYSCALLS_C
  unsigned short int aerrno = SUCCESS;
#else
  extern signed short int aerrno;
#endif


/* STRUCTURES - JONAS (18.07.2001) */

struct PrintMode_Struct {

  const char *Name;
  const unsigned long int Bitmask;
  const unsigned short int Level;
  const char *Description;

};

struct PrintFile_Struct {

  char *Name;
  unsigned long int Bitmask;
  FILE *FilePT;

};


/* FUNCTION PROTOTYPES - JONAS (18.07.2001) */

void sysinit(void);
#if !WIN32
void sysinitid(void);
signed long int sysseteuidnormal(void);
signed long int sysseteuid(const uid_t UID);
signed long int sysseteuidbyuser(const char *const UserPT);
#endif
void sysinitfiles(void);
void sysclosefiles(void);
void sysopenfiles_fg(void);
#if !WIN32
void sysopenfiles_bg(void);
#endif
void sysflushfiles(void);
#if !WIN32
void syscheckpid(void);
void syswritepid(void);
#endif
void syssetsignals(void);
void syshandlesignal(int Signal);
#if !WIN32
void sysfork(void);
#endif
void sysprint(const unsigned long int Bitmask, const char *const LinePT, ...) __attribute__ ((format (printf, 2, 3)));
void debugprint(const char *const FilePT, const unsigned short int Line, const char *const FunctionPT, const char *const TextLinePT, ...) __attribute__ ((format (printf, 4, 5)));
void sysrehash(void);
void systerm(void);
signed short int sysrun(const char *const CmdPT, char *ResultPT);
#if !WIN32
uid_t sysgetuidfromuser(const char *const UserPT);
char *sysgetnamefromuser(const char *const UserPT);
char *sysgethomedirfromuser(const char *const UserPT);
gid_t sysgetgidfromgroup(const char *const GroupPT);
#endif
void syscleanup(void);
int nl_net_aton(const char *HostIPS, struct in_addr *InAddr);

#endif


syntax highlighted by Code2HTML, v. 0.9.1