Rebase to SVN, and do a bit of cleanup as well as minor fixes.
[kugel-rb.git] / apps / plugins / frotz / frotzplugin.h
blobf975fc8c2282479f6c5961abdeef668b0be2baab
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2009 Torne Wuff
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef _FROTZPLUGIN_H_
22 #define _FROTZPLUGIN_H_
24 #include "plugin.h"
27 * pretend stdio.h is implemented. references to FILE * still have to be
28 * changed to int, and references to NULL into -1, but there are less of those
30 #undef ferror
31 #define fread(ptr, size, nmemb, stream) rb->read(stream, ptr, size*nmemb)
32 #define fwrite(ptr, size, nmemb, stream) rb->write(stream, ptr, size*nmemb)
33 #define fclose(stream) rb->close(stream)
34 #define fseek(stream, offset, whence) rb->lseek(stream, offset, whence)
35 #define ftell(stream) rb->lseek(stream, 0, SEEK_CUR)
36 #define ferror(stream) 0
39 * we need functions for character io
41 extern int frotz_ungetc(int c, int f);
42 #define ungetc frotz_ungetc
43 extern int frotz_fgetc(int f);
44 #define fgetc frotz_fgetc
45 extern int frotz_fputc(int c, int f);
46 #define fputc frotz_fputc
49 * this is used instead of os_read_key for more prompts and the like
50 * since the menu can't be used there.
52 extern void wait_for_key(void);
55 * wrappers
57 #define strchr(s, c) rb->strchr(s, c)
58 #define strcpy(dest, src) rb->strcpy(dest, src)
60 #endif /* _FROTZPLUGIN_H_ */