2015-05-26 13:08:39 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Iván Matellanes
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdlib.h"
|
|
|
|
#include "windef.h"
|
|
|
|
#include "cxx.h"
|
|
|
|
|
2015-06-03 21:10:23 +02:00
|
|
|
typedef LONG streamoff;
|
|
|
|
typedef LONG streampos;
|
2015-08-03 16:48:37 +02:00
|
|
|
typedef int filedesc;
|
2015-09-17 11:06:46 +02:00
|
|
|
typedef void* (__cdecl *allocFunction)(LONG);
|
|
|
|
typedef void (__cdecl *freeFunction)(void*);
|
2015-06-03 21:10:23 +02:00
|
|
|
|
2015-07-04 16:24:37 +02:00
|
|
|
typedef enum {
|
|
|
|
IOSTATE_goodbit = 0x0,
|
|
|
|
IOSTATE_eofbit = 0x1,
|
|
|
|
IOSTATE_failbit = 0x2,
|
|
|
|
IOSTATE_badbit = 0x4
|
|
|
|
} ios_io_state;
|
|
|
|
|
2015-08-03 16:48:37 +02:00
|
|
|
typedef enum {
|
|
|
|
OPENMODE_in = 0x1,
|
|
|
|
OPENMODE_out = 0x2,
|
|
|
|
OPENMODE_ate = 0x4,
|
|
|
|
OPENMODE_app = 0x8,
|
|
|
|
OPENMODE_trunc = 0x10,
|
|
|
|
OPENMODE_nocreate = 0x20,
|
|
|
|
OPENMODE_noreplace = 0x40,
|
|
|
|
OPENMODE_binary = 0x80
|
|
|
|
} ios_open_mode;
|
|
|
|
|
2015-06-09 19:40:40 +02:00
|
|
|
typedef enum {
|
|
|
|
SEEKDIR_beg = 0,
|
|
|
|
SEEKDIR_cur = 1,
|
|
|
|
SEEKDIR_end = 2
|
|
|
|
} ios_seek_dir;
|
|
|
|
|
2015-07-04 16:24:37 +02:00
|
|
|
typedef enum {
|
|
|
|
FLAGS_skipws = 0x1,
|
|
|
|
FLAGS_left = 0x2,
|
|
|
|
FLAGS_right = 0x4,
|
|
|
|
FLAGS_internal = 0x8,
|
|
|
|
FLAGS_dec = 0x10,
|
|
|
|
FLAGS_oct = 0x20,
|
|
|
|
FLAGS_hex = 0x40,
|
|
|
|
FLAGS_showbase = 0x80,
|
|
|
|
FLAGS_showpoint = 0x100,
|
|
|
|
FLAGS_uppercase = 0x200,
|
|
|
|
FLAGS_showpos = 0x400,
|
|
|
|
FLAGS_scientific = 0x800,
|
|
|
|
FLAGS_fixed = 0x1000,
|
|
|
|
FLAGS_unitbuf = 0x2000,
|
|
|
|
FLAGS_stdio = 0x4000
|
|
|
|
} ios_flags;
|
|
|
|
|
2015-06-08 21:26:21 +02:00
|
|
|
extern void* (__cdecl *MSVCRT_operator_new)(SIZE_T);
|
2015-05-26 13:08:39 +02:00
|
|
|
extern void (__cdecl *MSVCRT_operator_delete)(void*);
|
|
|
|
|
|
|
|
void init_exception(void*);
|