source: cpp/common/hmessage.h @ 372

Last change on this file since 372 was 372, checked in by sz, 9 years ago

Renamed some classes and functions to make their purpose more obvious:

All MessageHandlers? must now be given the explicit "Enable" argument if you want them to automatically become active. This makes side effects clearly visible.

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
4
5#ifndef _HMESSAGE_H_
6#define _HMESSAGE_H_
7
8#include <stdarg.h>
9
10extern const char* HMSG_LEVEL[];
11#define HMSG_FORMAT "%s%s.%s: %s"
12#define HMSG_MULTILINE_CONTINUATION "..."
13
14void Hprintf(const char *o,const char *m,int w,const char *bl, ...);
15void Hprintf_va(const char *o,const char *m,int w,const char *bl,va_list va); //a different name than Hprintf - otherwise the compiler could confuse the "string" parameter with va_list and could call the wrong function
16void printH(const char *bl,...); //a shorthand for printf (a different name again to avoid the risk of confusion with the two functions above. This would be unlikely but possible when the argument types would match)
17void Hmessage(const char *o,const char *m,const char *txt,int w);
18
19void _HmessageSingleLine(const char *o,const char *m,const char *txt,int w); //don't call this directly - it is used internally
20
21#define HMLV_DEBUG -1
22#define HMLV_INFO 0
23#define HMLV_WARN 1
24#define HMLV_ERROR 2
25#define HMLV_CRITICAL 3
26
27/*
28w: weight (importance) of a message
29-1:debugging information, not needed for final users
300: information
311: warning or corrected error
322: uncorrected error. can cause malfunction
333: serious error, causes side effects. user should save what can be saved and restart the application
34*/
35
36#endif
Note: See TracBrowser for help on using the repository browser.