This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-mbse/mbtask/mbtask.h
2003-02-08 15:28:31 +00:00

60 lines
1.2 KiB
C

#ifndef _MBTASK_H
#define _MBTASK_H
/* $Id$ */
/*
* Defines.
* SLOWRUN is number of seconds for scheduling mailer calls. Leave at 20!
*/
#define MAXTASKS 10
#define SLOWRUN 20
#define TMPNAME "TMP."
#define LCKNAME "LOCKTASK"
#define TOSSWAIT_TIME 30
/*
* Running tasks information
*/
typedef struct _onetask {
char name[16]; /* Name of the task */
char cmd[PATH_MAX]; /* Command to binary */
char opts[128]; /* Commandline opts */
int tasktype; /* Type of task */
pid_t pid; /* Pid of task */
int running; /* Running or not */
int status; /* Waitpid status */
int rc; /* Exit code */
} onetask;
/*
* Logging flagbits, ' ' ? ! + -
*/
#define DLOG_ALLWAYS 0x00000001
#define DLOG_ERROR 0x00000002
#define DLOG_ATTENT 0x00000004
#define DLOG_NORMAL 0x00000008
#define DLOG_VERBOSE 0x00000010
time_t file_time(char *);
void load_maincfg(void);
void load_taskcfg(void);
pid_t launch(char *, char *, char *, int);
int runtasktype(int);
int checktasks(int);
void die(int);
void scheduler(void);
int locktask(char *);
void ulocktask(void);
#endif