summaryrefslogtreecommitdiffstats
path: root/ksysv/leveldb.h
blob: ef6dea95d40c928fdbf9b8fb2e329e6391c205b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/***************************************************************************
    begin                : Sun Oct 3 1999
    copyright            : (C) 1999 by Red Hat Software
    email                : putzer@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

/* modifications (c) 1999 Peter Putzer */

#ifndef H_LEVELDB
#define H_LEVELDB


#ifdef __cplusplus

extern "C" {
#endif

#include <glob.h>

struct service {
    char * name;
    int levels, kPriority, sPriority;
    char * desc;
};

int parseLevels(const char * str, int emptyOk);

/* returns 0 on success, 1 if the service is not chtdeconfig-able, -1 if an
   I/O error occurs (in which case errno can be checked) */
int readServiceInfo(const char* RUNLEVELS, const char* name, struct service * service);
int currentRunlevel(void);
int isOn(const char* RUNLEVELS, const char* name, int where);
int isConfigured(const char* RUNLEVELS, const char* name, int level);
int doSetService(const char* RUNLEVELS, struct service s, int level, int on);
int findServiceEntries(const char* RUNLEVELS, const char* name, int level, glob_t * globresptr);

#ifdef __cplusplus
}
#endif

#endif