dont pollute namespace with our own local restrict keyword
This commit is contained in:
parent
b6fcfd1157
commit
409e73bc29
58
src/einfo.h
58
src/einfo.h
@ -41,11 +41,13 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
/* Although OpenRC requires C99, linking to us should not. */
|
/* Although OpenRC requires C99, linking to us should not. */
|
||||||
#ifndef restrict
|
#ifdef restrict
|
||||||
# ifdef __restrict
|
# define __EINFO_RESTRICT restrict
|
||||||
# define restrict __restrict
|
|
||||||
#else
|
#else
|
||||||
# define restrict
|
# ifdef __restrict
|
||||||
|
# define __EINFO_RESTRICT __restrict
|
||||||
|
# else
|
||||||
|
# define __EINFO_RESTRICT
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -64,7 +66,7 @@ typedef enum
|
|||||||
const char *ecolor (einfo_color_t);
|
const char *ecolor (einfo_color_t);
|
||||||
|
|
||||||
/*! @brief Writes to syslog. */
|
/*! @brief Writes to syslog. */
|
||||||
void elog (int __level, const char * restrict __fmt, ...) __EEND_PRINTF;
|
void elog (int __level, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Display informational messages.
|
* @brief Display informational messages.
|
||||||
@ -82,22 +84,22 @@ void elog (int __level, const char * restrict __fmt, ...) __EEND_PRINTF;
|
|||||||
* The v suffix means only print if EINFO_VERBOSE is yes.
|
* The v suffix means only print if EINFO_VERBOSE is yes.
|
||||||
*/
|
*/
|
||||||
/*@{*/
|
/*@{*/
|
||||||
int einfon (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int einfon (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int ewarnn (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ewarnn (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int eerrorn (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int eerrorn (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int einfo (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int einfo (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int ewarn (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ewarn (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
void ewarnx (const char * restrict __fmt, ...) __EINFO_XPRINTF;
|
void ewarnx (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_XPRINTF;
|
||||||
int eerror (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int eerror (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
void eerrorx (const char * restrict __fmt, ...) __EINFO_XPRINTF;
|
void eerrorx (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_XPRINTF;
|
||||||
|
|
||||||
int einfovn (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int einfovn (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int ewarnvn (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ewarnvn (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int ebeginvn (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ebeginvn (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int eendvn (int __retval, const char * restrict __fmt, ...) __EEND_PRINTF;
|
int eendvn (int __retval, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
int ewendvn (int __retval, const char * restrict __fmt, ...) __EEND_PRINTF;
|
int ewendvn (int __retval, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
int einfov (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int einfov (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int ewarnv (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ewarnv (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/*! @ingroup ebegin
|
/*! @ingroup ebegin
|
||||||
@ -105,8 +107,8 @@ int ewarnv (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
|||||||
*
|
*
|
||||||
* Similar to einfo, but we add ... to the end of the message */
|
* Similar to einfo, but we add ... to the end of the message */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
int ebeginv (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ebeginv (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
int ebegin (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
int ebegin (const char * __EINFO_RESTRICT __fmt, ...) __EINFO_PRINTF;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/*! @ingroup eend
|
/*! @ingroup eend
|
||||||
@ -118,12 +120,12 @@ int ebegin (const char * restrict __fmt, ...) __EINFO_PRINTF;
|
|||||||
*
|
*
|
||||||
* ebracket allows you to specifiy the position, color and message */
|
* ebracket allows you to specifiy the position, color and message */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
int eend (int __retval, const char * restrict __fmt, ...) __EEND_PRINTF;
|
int eend (int __retval, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
int ewend (int __retval, const char * restrict __fmt, ...) __EEND_PRINTF;
|
int ewend (int __retval, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
void ebracket (int __col, einfo_color_t __color, const char * restrict __msg);
|
void ebracket (int __col, einfo_color_t __color, const char * __EINFO_RESTRICT __msg);
|
||||||
|
|
||||||
int eendv (int __retval, const char * restrict __fmt, ...) __EEND_PRINTF;
|
int eendv (int __retval, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
int ewendv (int __retval, const char * restrict __fmt, ...) __EEND_PRINTF;
|
int ewendv (int __retval, const char * __EINFO_RESTRICT __fmt, ...) __EEND_PRINTF;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/*! @ingroup eindent
|
/*! @ingroup eindent
|
||||||
@ -137,6 +139,6 @@ void eindentv (void);
|
|||||||
void eoutdentv (void);
|
void eoutdentv (void);
|
||||||
|
|
||||||
/*! @brief Prefix each einfo line with something */
|
/*! @brief Prefix each einfo line with something */
|
||||||
void eprefix (const char * restrict __prefix);
|
void eprefix (const char * __EINFO_RESTRICT __prefix);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user