1 /* @(#)deflts.h 1.9 11/11/24 Copyright 1997-2011 J. Schilling */ 2 /* 3 * Definitions for reading program defaults. 4 * 5 * Copyright (c) 1997-2011 J. Schilling 6 */ 7 /* 8 * The contents of this file are subject to the terms of the 9 * Common Development and Distribution License, Version 1.0 only 10 * (the "License"). You may not use this file except in compliance 11 * with the License. 12 * 13 * See the file CDDL.Schily.txt in this distribution for details. 14 * A copy of the CDDL is also available via the Internet at 15 * http://www.opensource.org/licenses/cddl1.txt 16 * 17 * When distributing Covered Code, include this CDDL HEADER in each 18 * file and include the License file CDDL.Schily.txt from this distribution. 19 */ 20 21 #ifndef _SCHILY_DEFLTS_H 22 #define _SCHILY_DEFLTS_H 23 24 #ifndef _SCHILY_MCONFIG_H 25 #include <schily/mconfig.h> 26 #endif 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 #define DEFLT "/etc/default" 33 34 /* 35 * cmd's to defltcntl() 36 */ 37 #define DC_GETFLAGS 0 /* Get actual flags */ 38 #define DC_SETFLAGS 1 /* Set new flags */ 39 40 /* 41 * flags to defltcntl() 42 * 43 * Make sure that when adding features, the default behaviour 44 * is the same as old behaviour. 45 */ 46 #define DC_CASE 0x0001 /* Don't ignore case */ 47 48 #define DC_STD DC_CASE /* Default flags */ 49 50 /* 51 * Macros to handle flags 52 */ 53 #ifndef TURNON 54 #define TURNON(flags, mask) flags |= mask 55 #define TURNOFF(flags, mask) flags &= ~(mask) 56 #define ISON(flags, mask) (((flags) & (mask)) == (mask)) 57 #define ISOFF(flags, mask) (((flags) & (mask)) != (mask)) 58 #endif 59 60 extern int defltopen __PR((const char *name)); 61 extern int defltclose __PR((void)); 62 extern int defltsect __PR((const char *name)); 63 extern int defltfirst __PR((void)); 64 extern char *defltread __PR((const char *name)); 65 extern char *defltnext __PR((const char *name)); 66 extern int defltcntl __PR((int cmd, int flags)); 67 68 #ifdef __cplusplus 69 } 70 #endif 71 72 #endif /* _SCHILY_DEFLTS_H */ 73