summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-SVN.txt1
-rw-r--r--src/common/showmsg.c68
-rw-r--r--src/common/showmsg.hbin5307 -> 906 bytes
3 files changed, 64 insertions, 5 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt
index de6743659..0addf0c4c 100644
--- a/Changelog-SVN.txt
+++ b/Changelog-SVN.txt
@@ -2,6 +2,7 @@
Date Added
04/04
+ * Fix showmsg for Visual Studio [MouseJstr]
* Update base code for the UPNP plugin loading [celest]
* Removed anti-freeze system for login and char -- Shinomori's update would
be enough to keep inter connections alive [celest]
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 5587e8658..da21ad1e6 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -7,7 +7,10 @@
char tmp_output[1024] = {"\0"};
-int _ShowMessage(enum msg_type flag, const char *string, ...){ // by MC Cameri
+#undef ShowMessage
+
+int _vShowMessage(enum msg_type flag, const char *string, va_list ap)
+{ // by MC Cameri
/*
_ShowMessage MUST be used instead of printf as of 10/24/2004.
Return: 0 = Successful, 1 = Failed.
@@ -15,11 +18,9 @@ int _ShowMessage(enum msg_type flag, const char *string, ...){ // by MC Cameri
// int ret = 0;
char prefix[40];
char *output;
- va_list ap;
- va_start(ap, string);
if (strlen(string) <= 0) {
- ShowError("Empty string passed to _ShowMessage().\n");
+ printf("Empty string passed to _ShowMessage().\n");
return 1;
}
switch (flag) {
@@ -48,7 +49,7 @@ int _ShowMessage(enum msg_type flag, const char *string, ...){ // by MC Cameri
strcpy(prefix,CL_RED"[Fatal Error]"CL_RESET":");
break;
default:
- ShowError("In function _ShowMessage() -> Invalid flag passed.\n");
+ printf("In function _ShowMessage() -> Invalid flag passed.\n");
return 1;
}
if (!(flag == MSG_DEBUG && !SHOW_DEBUG_MSG)) {
@@ -84,3 +85,60 @@ int _ShowMessage(enum msg_type flag, const char *string, ...){ // by MC Cameri
*/
return 0;
}
+
+int _ShowMessage(enum msg_type flag, const char *string, ...)
+{
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(flag, string, ap);
+}
+
+int ShowStatus(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_STATUS, string, ap);
+}
+int ShowSQL(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_SQL, string, ap);
+}
+int ShowInfo(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_INFORMATION, string, ap);
+}
+int ShowNotice(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_NOTICE, string, ap);
+}
+int ShowWarning(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_WARNING, string, ap);
+}
+int ShowDebug(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_DEBUG, string, ap);
+}
+int ShowError(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_ERROR, string, ap);
+}
+int ShowFatalError(const char *string, ...) {
+ va_list ap;
+
+ va_start(ap, string);
+ return _vShowMessage(MSG_FATALERROR, string, ap);
+}
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 331b5f484..5b169dc82 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
Binary files differ