/*
+-------------------------------------------------------------------------+
|                           loghorn vers. 0.1.01                          |
|    Copyright (c) Andrey V. Stolyarov  <croco at croco dot net>  2026    |
| ----------------------------------------------------------------------- |
| This is free software.  Permission is granted to everyone to use, copy  |
|    or modify this software under the terms and conditions of either     |
|             CROCO'S INDIVIDUALISTIC FREE SOFTWARE LICENSE               |
|                          or, at your option,                            |
|               GNU LESSER GENERAL PUBLIC LICENSE, v. 2.1                 |
|                                                                         |
| Please visit http://www.croco.net/software/loghorn  to get a fresh copy |
| ----------------------------------------------------------------------- |
|   This code is provided strictly and exclusively on the "AS IS" basis.  |
|        THERE IS NO WARRANTY OF ANY KIND, DON'T EVEN THINK ABOUT IT      |
+-------------------------------------------------------------------------+
*/




#ifndef MESSAGE_H_SENTRY
#define MESSAGE_H_SENTRY

#ifdef __cplusplus
extern "C" {
#endif


/* -1 for quiet, 0 for normal, 1, ..., n for verbose */
void message_set_verbosity(int verbosity);

void message(int level, const char *fmt, ...);

/* s1 may be NULL, s2 must be a valid string (it is passed to perror) */
void message_perror(int level, const char *s1, const char *s2);

enum message_levels {
    mlv_alert  = -1,    /* show even in the "quiet" mode   */
    mlv_normal =  0,    /* normal messages */
    mlv_info   =  1,    /* show in the "verbose" mode only */
    mlv_debug  =  2,    /* show only for -vv and higher    */
    mlv_debug2  = 3     /* show only for -vvv and higher    */
};


#ifdef __cplusplus
};
#endif

#endif
