summaryrefslogtreecommitdiff
path: root/src/minGlue.h
diff options
context:
space:
mode:
authorToad King2012-06-14 03:21:06 -0400
committerToad King2012-06-14 03:21:06 -0400
commit6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119 (patch)
tree885cf7f507139b795ba7b2a6fb829dc044da39dd /src/minGlue.h
downloadsnes9x2002-6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119.tar.gz
snes9x2002-6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119.tar.bz2
snes9x2002-6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119.zip
initial pocketsnes commit
Diffstat (limited to 'src/minGlue.h')
-rw-r--r--src/minGlue.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/minGlue.h b/src/minGlue.h
new file mode 100644
index 0000000..5a4c66a
--- /dev/null
+++ b/src/minGlue.h
@@ -0,0 +1,32 @@
+/* Glue functions for the minIni library, based on the C/C++ stdio library
+ *
+ * Or better said: this file contains macros that maps the function interface
+ * used by minIni to the standard C/C++ file I/O functions.
+ *
+ * Copyright (c) CompuPhase, 2008-2011
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * Version: $Id: minGlue.h 31 2011-01-28 10:46:16Z thiadmer.riemersma $
+ */
+
+/* map required file I/O to the standard C library */
+#include <stdio.h>
+#define ini_openread(filename,file) ((*(file) = fopen((filename),"rt")) != NULL)
+#define ini_openwrite(filename,file) ((*(file) = fopen((filename),"wt")) != NULL)
+#define ini_close(file) fclose(*(file))
+#define ini_read(buffer,size,file) fgets((buffer),(size),*(file))
+#define ini_write(buffer,file) fputs((buffer),*(file))
+#define ini_rename(source,dest) rename((source),(dest))
+#define ini_remove(filename) remove(filename)
+#define ini_rewind(file) rewind(*(file))