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

58 lines
1.1 KiB
C
Raw Normal View History

2001-08-17 05:46:24 +00:00
#ifndef _MBTASK_H
#define _MBTASK_H
2002-06-05 21:07:36 +00:00
/* $Id$ */
2002-02-22 21:15:21 +00:00
/*
* 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"
2001-08-17 05:46:24 +00:00
/*
* 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