summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2023-01-09 15:11:53 +0000
committerIan C <ianc@noddybox.co.uk>2023-01-09 15:11:53 +0000
commit2df835d00591d085de589ddf4d40ea3edc8f3fac (patch)
tree01bce387296a3590a26eb0856a51f12f9f207242 /include
parent5b9ffe70b622cee65ed5678163bee0e22fc0433d (diff)
Added support for debug logging over a socket.
Diffstat (limited to 'include')
-rw-r--r--include/debug.h53
-rw-r--r--include/gui.h1
2 files changed, 54 insertions, 0 deletions
diff --git a/include/debug.h b/include/debug.h
new file mode 100644
index 0000000..2f01b84
--- /dev/null
+++ b/include/debug.h
@@ -0,0 +1,53 @@
+/*
+
+ 3dsspec - Nintendo 3DS Spectrum emulator
+
+ Copyright (C) 2021 Ian Cowburn (ianc@noddybox.co.uk)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>
+
+ -------------------------------------------------------------------------
+
+ Provides an interface for debug
+
+*/
+
+#ifndef DSSPEC_DEBUG_H
+#define DSSPEC_DEBUG_H
+
+/* This variable is TRUE if debug is enabled. Also use this for setting the
+ mode.
+*/
+extern int debug_enabled;
+
+/* Use this macro to use debug. It saves a function call if debug is disabled.
+*/
+#define SPEC_DEBUG(...) \
+do \
+{ \
+ if (debug_enabled) DEBUG_Output(__VA_ARGS__); \
+} while(0)
+
+/* The host and port to use for the debug
+*/
+void DEBUG_SetAddress(const char *host, const char *port);
+
+/* The debug interface. Takes a printf style format and parameters.
+*/
+void DEBUG_Output(const char *format, ...);
+
+#endif
+
+
+/* END OF FILE */
diff --git a/include/gui.h b/include/gui.h
index 392571b..7a1608c 100644
--- a/include/gui.h
+++ b/include/gui.h
@@ -31,6 +31,7 @@ int GUI_FileSelect(char pwd[], char selected_file[],
const char *filter);
int GUI_InputName(const char *prompt, const char *ext,
char name[], int maxlen);
+int GUI_Input(const char *prompt, char text[], int maxlen);
extern char last_dir[FILENAME_MAX];