1*6a54128fSAndroid Build Coastguard Worker /* 2*6a54128fSAndroid Build Coastguard Worker * profile.h 3*6a54128fSAndroid Build Coastguard Worker * 4*6a54128fSAndroid Build Coastguard Worker * Copyright (C) 2005 by Theodore Ts'o. 5*6a54128fSAndroid Build Coastguard Worker * 6*6a54128fSAndroid Build Coastguard Worker * %Begin-Header% 7*6a54128fSAndroid Build Coastguard Worker * This file may be redistributed under the terms of the GNU Public 8*6a54128fSAndroid Build Coastguard Worker * License. 9*6a54128fSAndroid Build Coastguard Worker * %End-Header% 10*6a54128fSAndroid Build Coastguard Worker * 11*6a54128fSAndroid Build Coastguard Worker * Copyright (C) 1985-2005 by the Massachusetts Institute of Technology. 12*6a54128fSAndroid Build Coastguard Worker * 13*6a54128fSAndroid Build Coastguard Worker * All rights reserved. 14*6a54128fSAndroid Build Coastguard Worker * 15*6a54128fSAndroid Build Coastguard Worker * Export of this software from the United States of America may require 16*6a54128fSAndroid Build Coastguard Worker * a specific license from the United States Government. It is the 17*6a54128fSAndroid Build Coastguard Worker * responsibility of any person or organization contemplating export to 18*6a54128fSAndroid Build Coastguard Worker * obtain such a license before exporting. 19*6a54128fSAndroid Build Coastguard Worker * 20*6a54128fSAndroid Build Coastguard Worker * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 21*6a54128fSAndroid Build Coastguard Worker * distribute this software and its documentation for any purpose and 22*6a54128fSAndroid Build Coastguard Worker * without fee is hereby granted, provided that the above copyright 23*6a54128fSAndroid Build Coastguard Worker * notice appear in all copies and that both that copyright notice and 24*6a54128fSAndroid Build Coastguard Worker * this permission notice appear in supporting documentation, and that 25*6a54128fSAndroid Build Coastguard Worker * the name of M.I.T. not be used in advertising or publicity pertaining 26*6a54128fSAndroid Build Coastguard Worker * to distribution of the software without specific, written prior 27*6a54128fSAndroid Build Coastguard Worker * permission. Furthermore if you modify this software you must label 28*6a54128fSAndroid Build Coastguard Worker * your software as modified software and not distribute it in such a 29*6a54128fSAndroid Build Coastguard Worker * fashion that it might be confused with the original MIT software. 30*6a54128fSAndroid Build Coastguard Worker * M.I.T. makes no representations about the suitability of this software 31*6a54128fSAndroid Build Coastguard Worker * for any purpose. It is provided "as is" without express or implied 32*6a54128fSAndroid Build Coastguard Worker * warranty. 33*6a54128fSAndroid Build Coastguard Worker * 34*6a54128fSAndroid Build Coastguard Worker * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 35*6a54128fSAndroid Build Coastguard Worker * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 36*6a54128fSAndroid Build Coastguard Worker * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 37*6a54128fSAndroid Build Coastguard Worker */ 38*6a54128fSAndroid Build Coastguard Worker 39*6a54128fSAndroid Build Coastguard Worker #ifndef _PROFILE_H 40*6a54128fSAndroid Build Coastguard Worker #define _PROFILE_H 41*6a54128fSAndroid Build Coastguard Worker 42*6a54128fSAndroid Build Coastguard Worker typedef struct _profile_t *profile_t; 43*6a54128fSAndroid Build Coastguard Worker 44*6a54128fSAndroid Build Coastguard Worker typedef void (*profile_syntax_err_cb_t)(const char *file, long err, 45*6a54128fSAndroid Build Coastguard Worker int line_num); 46*6a54128fSAndroid Build Coastguard Worker 47*6a54128fSAndroid Build Coastguard Worker /* 48*6a54128fSAndroid Build Coastguard Worker * Used by the profile iterator in prof_get.c 49*6a54128fSAndroid Build Coastguard Worker */ 50*6a54128fSAndroid Build Coastguard Worker #define PROFILE_ITER_LIST_SECTION 0x0001 51*6a54128fSAndroid Build Coastguard Worker #define PROFILE_ITER_SECTIONS_ONLY 0x0002 52*6a54128fSAndroid Build Coastguard Worker #define PROFILE_ITER_RELATIONS_ONLY 0x0004 53*6a54128fSAndroid Build Coastguard Worker 54*6a54128fSAndroid Build Coastguard Worker #ifdef __cplusplus 55*6a54128fSAndroid Build Coastguard Worker extern "C" { 56*6a54128fSAndroid Build Coastguard Worker #endif /* __cplusplus */ 57*6a54128fSAndroid Build Coastguard Worker 58*6a54128fSAndroid Build Coastguard Worker long profile_init 59*6a54128fSAndroid Build Coastguard Worker (const char * const *files, profile_t *ret_profile); 60*6a54128fSAndroid Build Coastguard Worker 61*6a54128fSAndroid Build Coastguard Worker void profile_release 62*6a54128fSAndroid Build Coastguard Worker (profile_t profile); 63*6a54128fSAndroid Build Coastguard Worker 64*6a54128fSAndroid Build Coastguard Worker long profile_set_default 65*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *def_string); 66*6a54128fSAndroid Build Coastguard Worker 67*6a54128fSAndroid Build Coastguard Worker long profile_get_string 68*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *name, const char *subname, 69*6a54128fSAndroid Build Coastguard Worker const char *subsubname, const char *def_val, 70*6a54128fSAndroid Build Coastguard Worker char **ret_string); 71*6a54128fSAndroid Build Coastguard Worker long profile_get_integer 72*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *name, const char *subname, 73*6a54128fSAndroid Build Coastguard Worker const char *subsubname, int def_val, 74*6a54128fSAndroid Build Coastguard Worker int *ret_default); 75*6a54128fSAndroid Build Coastguard Worker 76*6a54128fSAndroid Build Coastguard Worker long profile_get_uint 77*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *name, const char *subname, 78*6a54128fSAndroid Build Coastguard Worker const char *subsubname, unsigned int def_val, 79*6a54128fSAndroid Build Coastguard Worker unsigned int *ret_int); 80*6a54128fSAndroid Build Coastguard Worker 81*6a54128fSAndroid Build Coastguard Worker long profile_get_double 82*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *name, const char *subname, 83*6a54128fSAndroid Build Coastguard Worker const char *subsubname, double def_val, 84*6a54128fSAndroid Build Coastguard Worker double *ret_float); 85*6a54128fSAndroid Build Coastguard Worker 86*6a54128fSAndroid Build Coastguard Worker long profile_get_boolean 87*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *name, const char *subname, 88*6a54128fSAndroid Build Coastguard Worker const char *subsubname, int def_val, 89*6a54128fSAndroid Build Coastguard Worker int *ret_default); 90*6a54128fSAndroid Build Coastguard Worker 91*6a54128fSAndroid Build Coastguard Worker long profile_iterator_create 92*6a54128fSAndroid Build Coastguard Worker (profile_t profile, const char *const *names, 93*6a54128fSAndroid Build Coastguard Worker int flags, void **ret_iter); 94*6a54128fSAndroid Build Coastguard Worker 95*6a54128fSAndroid Build Coastguard Worker void profile_iterator_free 96*6a54128fSAndroid Build Coastguard Worker (void **iter_p); 97*6a54128fSAndroid Build Coastguard Worker 98*6a54128fSAndroid Build Coastguard Worker long profile_iterator 99*6a54128fSAndroid Build Coastguard Worker (void **iter_p, char **ret_name, char **ret_value); 100*6a54128fSAndroid Build Coastguard Worker 101*6a54128fSAndroid Build Coastguard Worker profile_syntax_err_cb_t profile_set_syntax_err_cb(profile_syntax_err_cb_t hook); 102*6a54128fSAndroid Build Coastguard Worker 103*6a54128fSAndroid Build Coastguard Worker #ifdef __cplusplus 104*6a54128fSAndroid Build Coastguard Worker } 105*6a54128fSAndroid Build Coastguard Worker #endif /* __cplusplus */ 106*6a54128fSAndroid Build Coastguard Worker 107*6a54128fSAndroid Build Coastguard Worker #endif /* _KRB5_H */ 108