10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*8563SKenjiro.Tsuji@Sun.COM * Common Development and Distribution License (the "License"). 6*8563SKenjiro.Tsuji@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*8563SKenjiro.Tsuji@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 270Sstevel@tonic-gate /* All Rights Reserved */ 280Sstevel@tonic-gate 290Sstevel@tonic-gate /* Copyright (c) 1987, 1988 Microsoft Corporation */ 300Sstevel@tonic-gate /* All Rights Reserved */ 310Sstevel@tonic-gate 320Sstevel@tonic-gate #ifndef _DEFLT_H 330Sstevel@tonic-gate #define _DEFLT_H 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifdef __cplusplus 360Sstevel@tonic-gate extern "C" { 370Sstevel@tonic-gate #endif 380Sstevel@tonic-gate 390Sstevel@tonic-gate #define DEFLT "/etc/default" 400Sstevel@tonic-gate 410Sstevel@tonic-gate /* 420Sstevel@tonic-gate * Following for defcntl(3). 430Sstevel@tonic-gate * If you add new args, make sure that the default is: 440Sstevel@tonic-gate * OFF new-improved-feature-off, i.e. current state of affairs 450Sstevel@tonic-gate * ON new-improved-feature-on 460Sstevel@tonic-gate * or that you change the code for deflt(3) to have the old value as the 470Sstevel@tonic-gate * default. (for compatibility). 480Sstevel@tonic-gate */ 490Sstevel@tonic-gate 500Sstevel@tonic-gate /* ... cmds */ 510Sstevel@tonic-gate #define DC_GETFLAGS 0 /* get current flags */ 520Sstevel@tonic-gate #define DC_SETFLAGS 1 /* set flags */ 530Sstevel@tonic-gate 540Sstevel@tonic-gate /* ... args */ 550Sstevel@tonic-gate #define DC_CASE 0001 /* ON: respect case; OFF: ignore case */ 560Sstevel@tonic-gate #define DC_NOREWIND 0002 /* ON: don't rewind in defread */ 570Sstevel@tonic-gate /* OFF: do rewind in defread */ 580Sstevel@tonic-gate #define DC_STRIP_QUOTES 0004 /* ON: strip quotes; OFF: leave quotes */ 590Sstevel@tonic-gate 600Sstevel@tonic-gate #define DC_STD ((0) | (DC_CASE)) 610Sstevel@tonic-gate 620Sstevel@tonic-gate #ifdef __STDC__ 630Sstevel@tonic-gate extern int defcntl(int, int); 640Sstevel@tonic-gate extern int defopen(char *); 650Sstevel@tonic-gate extern char *defread(char *); 66*8563SKenjiro.Tsuji@Sun.COM 67*8563SKenjiro.Tsuji@Sun.COM extern int defcntl_r(int, int, void *); 68*8563SKenjiro.Tsuji@Sun.COM extern void *defopen_r(const char *); 69*8563SKenjiro.Tsuji@Sun.COM extern char *defread_r(const char *, void *); 70*8563SKenjiro.Tsuji@Sun.COM extern void defclose_r(void *); 710Sstevel@tonic-gate #else 720Sstevel@tonic-gate extern int defcntl(); 730Sstevel@tonic-gate extern int defopen(); 740Sstevel@tonic-gate extern char *defread(); 75*8563SKenjiro.Tsuji@Sun.COM 76*8563SKenjiro.Tsuji@Sun.COM extern int defcntl_r(); 77*8563SKenjiro.Tsuji@Sun.COM extern void *defopen_r(); 78*8563SKenjiro.Tsuji@Sun.COM extern char *defread_r(); 79*8563SKenjiro.Tsuji@Sun.COM extern void defclose_r(); 800Sstevel@tonic-gate #endif 810Sstevel@tonic-gate 820Sstevel@tonic-gate #define TURNON(flags, mask) ((flags) |= (mask)) 830Sstevel@tonic-gate #define TURNOFF(flags, mask) ((flags) &= ~(mask)) 840Sstevel@tonic-gate #define ISON(flags, mask) (((flags) & (mask)) == (mask)) 850Sstevel@tonic-gate #define ISOFF(flags, mask) (((flags) & (mask)) != (mask)) 860Sstevel@tonic-gate 870Sstevel@tonic-gate #ifdef __cplusplus 880Sstevel@tonic-gate } 890Sstevel@tonic-gate #endif 900Sstevel@tonic-gate 910Sstevel@tonic-gate #endif /* _DEFLT_H */ 92