xref: /freebsd/contrib/ntp/sntp/libopts/autoopts/project.h (revision a466cc55373fc3cf86837f09da729535b57e69a1)
12b15cb3dSCy Schubert 
22b15cb3dSCy Schubert /**
32b15cb3dSCy Schubert  * \file project.h
42b15cb3dSCy Schubert  *
52b15cb3dSCy Schubert  *  This file is part of AutoOpts, a companion to AutoGen.
62b15cb3dSCy Schubert  *  AutoOpts is free software.
7*a466cc55SCy Schubert  *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
82b15cb3dSCy Schubert  *
92b15cb3dSCy Schubert  *  AutoOpts is available under any one of two licenses.  The license
102b15cb3dSCy Schubert  *  in use must be one of these two and the choice is under the control
112b15cb3dSCy Schubert  *  of the user of the license.
122b15cb3dSCy Schubert  *
132b15cb3dSCy Schubert  *   The GNU Lesser General Public License, version 3 or later
142b15cb3dSCy Schubert  *      See the files "COPYING.lgplv3" and "COPYING.gplv3"
152b15cb3dSCy Schubert  *
162b15cb3dSCy Schubert  *   The Modified Berkeley Software Distribution License
172b15cb3dSCy Schubert  *      See the file "COPYING.mbsd"
182b15cb3dSCy Schubert  *
192b15cb3dSCy Schubert  *  These files have the following sha256 sums:
202b15cb3dSCy Schubert  *
212b15cb3dSCy Schubert  *  8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95  COPYING.gplv3
222b15cb3dSCy Schubert  *  4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b  COPYING.lgplv3
232b15cb3dSCy Schubert  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
242b15cb3dSCy Schubert  */
252b15cb3dSCy Schubert 
262b15cb3dSCy Schubert #ifndef AUTOGEN_PROJECT_H
272b15cb3dSCy Schubert #define AUTOGEN_PROJECT_H
282b15cb3dSCy Schubert 
292b15cb3dSCy Schubert #include "config.h"
302b15cb3dSCy Schubert #include "compat/compat.h"
312b15cb3dSCy Schubert #include "ag-char-map.h"
322b15cb3dSCy Schubert 
332b15cb3dSCy Schubert /*
342b15cb3dSCy Schubert  *  Procedure success codes
352b15cb3dSCy Schubert  *
362b15cb3dSCy Schubert  *  USAGE:  define procedures to return "tSuccess".  Test their results
372b15cb3dSCy Schubert  *          with the SUCCEEDED, FAILED and HADGLITCH macros.
382b15cb3dSCy Schubert  *
392b15cb3dSCy Schubert  *  Microsoft sticks its nose into user space here, so for Windows' sake,
402b15cb3dSCy Schubert  *  make sure all of these are undefined.
412b15cb3dSCy Schubert  */
422b15cb3dSCy Schubert #undef  SUCCESS
432b15cb3dSCy Schubert #undef  FAILURE
442b15cb3dSCy Schubert #undef  PROBLEM
452b15cb3dSCy Schubert #undef  SUCCEEDED
462b15cb3dSCy Schubert #undef  SUCCESSFUL
472b15cb3dSCy Schubert #undef  FAILED
482b15cb3dSCy Schubert #undef  HADGLITCH
492b15cb3dSCy Schubert 
502b15cb3dSCy Schubert #define SUCCESS  ((tSuccess) 0)
512b15cb3dSCy Schubert #define FAILURE  ((tSuccess)-1)
522b15cb3dSCy Schubert #define PROBLEM  ((tSuccess) 1)
532b15cb3dSCy Schubert 
542b15cb3dSCy Schubert typedef int tSuccess;
552b15cb3dSCy Schubert 
562b15cb3dSCy Schubert #define SUCCEEDED(p)    ((p) == SUCCESS)
572b15cb3dSCy Schubert #define SUCCESSFUL(p)   SUCCEEDED(p)
582b15cb3dSCy Schubert #define FAILED(p)       ((p) <  SUCCESS)
592b15cb3dSCy Schubert #define HADGLITCH(p)    ((p) >  SUCCESS)
602b15cb3dSCy Schubert 
612b15cb3dSCy Schubert #ifndef STR
622b15cb3dSCy Schubert #  define __STR(s)      #s
632b15cb3dSCy Schubert #  define STR(s)        __STR(s)
642b15cb3dSCy Schubert #endif
652b15cb3dSCy Schubert 
662b15cb3dSCy Schubert #ifdef DEFINING
672b15cb3dSCy Schubert #  define VALUE(s)      = s
682b15cb3dSCy Schubert #  define MODE
692b15cb3dSCy Schubert #else
702b15cb3dSCy Schubert #  define VALUE(s)
712b15cb3dSCy Schubert #  define MODE extern
722b15cb3dSCy Schubert #endif
732b15cb3dSCy Schubert 
74*a466cc55SCy Schubert #undef NUL
75*a466cc55SCy Schubert #define NUL '\0'
76*a466cc55SCy Schubert 
77*a466cc55SCy Schubert #define MOD_LOCAL static
782b15cb3dSCy Schubert #define parse_duration option_parse_duration
792b15cb3dSCy Schubert 
80*a466cc55SCy Schubert #ifdef _MSC_VER
81*a466cc55SCy Schubert #define lo_noreturn __declspec(noreturn)
82*a466cc55SCy Schubert #else
83*a466cc55SCy Schubert #define lo_noreturn noreturn
84*a466cc55SCy Schubert #endif
85*a466cc55SCy Schubert 
862b15cb3dSCy Schubert #endif /* AUTOGEN_PROJECT_H */
872b15cb3dSCy Schubert /* end of project.h */
88