xref: /freebsd/contrib/ntp/sntp/libopts/save-flags.h (revision a466cc55373fc3cf86837f09da729535b57e69a1)
1 /*   -*- buffer-read-only: t -*- vi: set ro:
2  *
3  *  DO NOT EDIT THIS FILE   (save-flags.h)
4  *
5  *  It has been AutoGen-ed
6  *  From the definitions    /tmp/.ag-ufBbQe/save-flags.def
7  *  and the template file   str2enum
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. Neither the name ``Bruce Korb'' nor the name of any other
18  *    contributor may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * str2enum IS PROVIDED BY Bruce Korb ``AS IS'' AND ANY EXPRESS
22  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL Bruce Korb OR ANY OTHER CONTRIBUTORS
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * Command/Keyword Dispatcher
34  */
35 #ifndef STR2ENUM_SAVE_FLAGS_H_GUARD
36 #define STR2ENUM_SAVE_FLAGS_H_GUARD 1
37 #include <sys/types.h>
38 #include <inttypes.h>
39 
40 /** integral type for holding save_flags masks */
41 typedef uint32_t save_flags_mask_t;
42 
43 /** bits defined for save_flags_mask_t */
44 /** include default values in commentary */
45 #define SVFL_DEFAULT            0x0001U
46 /** include usage text in commentary */
47 #define SVFL_USAGE              0x0002U
48 /** replace or append state */
49 #define SVFL_UPDATE             0x0004U
50 
51 /** bits in USAGE_DEFAULT mask:
52  *  usage   default */
53 #define SVFL_USAGE_DEFAULT_MASK 0x0003U
54 
55 /** all bits in save_flags_mask_t masks */
56 #define SVFL_MASK_ALL           0x0007U
57 
58 /** no bits in save_flags_mask_t */
59 #define SVFL_NONE               0x0000U
60 
61 /** buffer size needed to hold all bit names for save_flags_mask_t masks */
62 #define MAX_SAVE_FLAGS_NAME_SIZE 21
63 
64 extern save_flags_mask_t
65 save_flags_str2mask(char const * str, save_flags_mask_t old);
66 
67 #endif /* STR2ENUM_SAVE_FLAGS_H_GUARD */
68 /* end of save-flags.h */
69