Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

stream.h File Reference

#include "common.h"
#include "global.h"
#include "htio.h"
#include <stdarg.h>
#include <stdio.h>

Go to the source code of this file.

Classes

class  ht_file
class  ht_layer_stream
class  ht_layer_streamfile
class  ht_mem_file
class  ht_memmap_file
class  ht_null_file
class  ht_object_stream
class  ht_stdio_file
class  ht_stream
class  ht_streamfile
class  ht_sys_file
class  ht_temp_file

Defines

#define SERR_FAIL   0
#define SERR_RETRY   1
#define STERR_SYSTEM   0x80000000
#define PUT_BINARY(st, d, size)   st->putBinary(d, size, #d)
#define PUT_BOOL(st, d)   st->putBool(d, #d)
#define PUT_INT(st, d)   st->putInt(d, 4, #d)
#define PUT_INT_DEC(st, d)   st->putIntDec(d, 4, #d)
#define PUT_INT_HEX(st, d)   st->putIntHex(d, 4, #d)
#define PUT_QWORD_DEC(st, d)   st->putQWordDec(d, 8, #d)
#define PUT_QWORD_HEX(st, d)   st->putQWordHex(d, 8, #d)
#define PUT_OBJECT(st, o)   st->putObject(o, #o)
#define PUT_STRING(st, d)   st->putString(d, #d)
#define GET_BOOL(st, d)   d=st->getBool(#d)
#define GET_INT(st, d)   d=st->getInt(4, #d)
#define GET_INT_DEC(st, d)   d=st->getIntDec(4, #d)
#define GET_INT_HEX(st, d)   d=st->getIntHex(4, #d)
#define GET_QWORD_DEC(st, d)   d=st->getQWordDec(8, #d)
#define GET_QWORD_HEX(st, d)   d=st->getQwordHex(8, #d)
#define GET_OBJECT(st, o)   st->getObject(*(Object**)&o, #o)
#define GET_STRING(st, d)   d=st->getString(#d)
#define FCNTL_MODS_INVD   0x00000001
#define FCNTL_MODS_FLUSH   0x00000002
#define FCNTL_MODS_IS_DIRTY   0x00000003
#define FCNTL_MODS_CLEAR_DIRTY   0x00000004
#define FCNTL_MODS_CLEAR_DIRTY_RANGE   0x00000005
#define FCNTL_FLUSH_STAT   0x00000006
#define FCNTL_GET_RELOC   0x00000007
#define FCNTL_SET_RELOC   0x00000008
#define IS_DIRTY_SINGLEBIT   0x80000000
#define FAM_NULL   0
#define FAM_READ   1
#define FAM_WRITE   2
#define FOM_EXISTS   0
#define FOM_CREATE   1
#define FOM_APPEND   2

Typedefs

typedef int(* stream_error_func_ptr )(ht_stream *stream)

Functions

char * fgetstrz (ht_streamfile *file)
char * getstrz (ht_stream *stream)
void putstrz (ht_stream *stream, const char *str)
char * getstrp (ht_stream *stream)
void putstrp (ht_stream *stream, const char *str)
char * getstrw (ht_stream *stream)
void putstrw (ht_stream *stream, const char *str)
char * ht_strerror (int error)


Define Documentation

#define FAM_NULL   0
 

Definition at line 174 of file stream.h.

Referenced by ht_stream::init(), ht_file::set_access_mode_internal(), ht_file::truncate(), and ht_file::vcntl().

#define FAM_READ   1
 

Definition at line 175 of file stream.h.

Referenced by ht_app::create_window_file_bin(), ht_app::create_window_file_text(), ht_format_viewer::handlemsg(), ht_app::handlemsg(), RegNodeFile::init(), ht_mem_file::init(), ht_clipboard::init(), ht_compressed_stream::init(), load_fileconfig(), load_systemconfig(), ht_stdio_file::read(), ht_sys_file::read(), ht_text_editor::save(), ht_file::set_access_mode_internal(), and sys_ipc_exec().

#define FAM_WRITE   2
 

Definition at line 176 of file stream.h.

Referenced by blockop_dialog(), dialog_assemble(), RegNodeFile::done(), ht_compressed_stream::done(), ht_uformat_viewer::edit(), ht_format_group::edit(), ht_aviewer::exportFileDialog(), ht_stdio_file::extend(), ht_sys_file::extend(), ht_aviewer::generateOutputDialog(), ht_uformat_viewer::handlemsg(), ht_format_viewer::handlemsg(), ht_app::handlemsg(), RegNodeFile::init(), ht_mem_file::init(), ht_streamfile_modifier::init(), ht_clipboard::init(), ht_compressed_stream::init(), ht_uformat_viewer::ref_flags(), ht_text_editor::save(), save_fileconfig(), save_systemconfig(), ht_streamfile_modifier::set_access_mode(), ht_file::set_access_mode_internal(), sys_ipc_exec(), ht_stdio_file::write(), and ht_sys_file::write().

#define FCNTL_FLUSH_STAT   0x00000006
 

Definition at line 167 of file stream.h.

Referenced by ht_file_window::handlemsg(), and ht_file::vcntl().

#define FCNTL_GET_RELOC   0x00000007
 

Definition at line 168 of file stream.h.

Referenced by ht_ne_aviewer::func(), ht_le_aviewer::func(), and ht_reloc_file::vcntl().

#define FCNTL_MODS_CLEAR_DIRTY   0x00000004
 

Definition at line 165 of file stream.h.

Referenced by ht_text_editor::redo(), ht_text_editor::undo(), and ht_ltextfile::vcntl().

#define FCNTL_MODS_CLEAR_DIRTY_RANGE   0x00000005
 

Definition at line 166 of file stream.h.

Referenced by ht_uformat_viewer::handlemsg(), ht_streamfile_modifier::vcntl(), and ht_le_page_file::vcntl().

#define FCNTL_MODS_FLUSH   0x00000002
 

Definition at line 163 of file stream.h.

Referenced by ht_uformat_viewer::edit_update(), ht_uformat_viewer::func(), ht_ltextfile::vcntl(), and ht_streamfile_modifier::vcntl().

#define FCNTL_MODS_INVD   0x00000001
 

Definition at line 162 of file stream.h.

Referenced by ht_uformat_viewer::func(), ht_format_viewer::handlemsg(), ht_ltextfile::vcntl(), and ht_streamfile_modifier::vcntl().

#define FCNTL_MODS_IS_DIRTY   0x00000003
 

Definition at line 164 of file stream.h.

Referenced by ht_text_editor::func(), ht_uformat_viewer::func(), ht_text_editor::get_pindicator_str(), ht_uformat_viewer::get_tag_color_edit(), ht_file_window::handlemsg(), ht_le_page_file::isdirty(), ht_uformat_viewer::render_tagstring(), ht_ltextfile::vcntl(), ht_streamfile_modifier::vcntl(), and ht_le_page_file::vcntl().

#define FCNTL_SET_RELOC   0x00000008
 

Definition at line 169 of file stream.h.

Referenced by ht_ne_aviewer::func(), ht_le_aviewer::func(), and ht_reloc_file::vcntl().

#define FOM_APPEND   2
 

Definition at line 181 of file stream.h.

Referenced by ht_file::set_access_mode_internal().

#define FOM_CREATE   1
 

Definition at line 180 of file stream.h.

Referenced by RegNodeFile::done(), ht_aviewer::exportFileDialog(), ht_aviewer::generateOutputDialog(), ht_app::handlemsg(), RegNodeFile::init(), save_fileconfig(), save_systemconfig(), and ht_file::set_access_mode_internal().

#define FOM_EXISTS   0
 

Definition at line 179 of file stream.h.

Referenced by ht_app::create_window_file_bin(), ht_app::create_window_file_text(), ht_app::handlemsg(), ht_file::init(), load_fileconfig(), and load_systemconfig().

#define GET_BOOL st,
 )     d=st->getBool(#d)
 

Definition at line 148 of file stream.h.

Referenced by Analyser::load().

#define GET_INT st,
 )     d=st->getInt(4, #d)
 

Definition at line 149 of file stream.h.

#define GET_INT_DEC st,
 )     d=st->getIntDec(4, #d)
 

Definition at line 150 of file stream.h.

Referenced by Area::load(), and Analyser::load().

#define GET_INT_HEX st,
 )     d=st->getIntHex(4, #d)
 

Definition at line 151 of file stream.h.

Referenced by x86dis::load(), AnalyX86Disassembler::load(), and Analyser::load().

#define GET_OBJECT st,
 )     st->getObject(*(Object**)&o, #o)
 

Definition at line 154 of file stream.h.

Referenced by XBEAnalyser::load(), PEFAnalyser::load(), PEAnalyser::load(), NEAnalyser::load(), MachoAnalyser::load(), LEAnalyser::load(), FLTAnalyser::load(), ElfAnalyser::load(), CoffAnalyser::load(), Analyser::load(), and AddressQueueItem::load().

#define GET_QWORD_DEC st,
 )     d=st->getQWordDec(8, #d)
 

Definition at line 152 of file stream.h.

#define GET_QWORD_HEX st,
 )     d=st->getQwordHex(8, #d)
 

Definition at line 153 of file stream.h.

#define GET_STRING st,
 )     d=st->getString(#d)
 

Definition at line 155 of file stream.h.

#define IS_DIRTY_SINGLEBIT   0x80000000
 

Definition at line 171 of file stream.h.

Referenced by ht_streamfile_modifier::isdirty(), and ht_uformat_viewer::render_tagstring().

#define PUT_BINARY st,
d,
size   )     st->putBinary(d, size, #d)
 

Definition at line 138 of file stream.h.

#define PUT_BOOL st,
 )     st->putBool(d, #d)
 

Definition at line 139 of file stream.h.

Referenced by Analyser::store().

#define PUT_INT st,
 )     st->putInt(d, 4, #d)
 

Definition at line 140 of file stream.h.

#define PUT_INT_DEC st,
 )     st->putIntDec(d, 4, #d)
 

Definition at line 141 of file stream.h.

Referenced by Area::store(), and Analyser::store().

#define PUT_INT_HEX st,
 )     st->putIntHex(d, 4, #d)
 

Definition at line 142 of file stream.h.

Referenced by x86dis::store(), AnalyX86Disassembler::store(), and Analyser::store().

#define PUT_OBJECT st,
 )     st->putObject(o, #o)
 

Definition at line 145 of file stream.h.

Referenced by XBEAnalyser::store(), PEFAnalyser::store(), PEAnalyser::store(), NEAnalyser::store(), MachoAnalyser::store(), LEAnalyser::store(), FLTAnalyser::store(), ElfAnalyser::store(), CoffAnalyser::store(), Analyser::store(), and AddressQueueItem::store().

#define PUT_QWORD_DEC st,
 )     st->putQWordDec(d, 8, #d)
 

Definition at line 143 of file stream.h.

#define PUT_QWORD_HEX st,
 )     st->putQWordHex(d, 8, #d)
 

Definition at line 144 of file stream.h.

#define PUT_STRING st,
 )     st->putString(d, #d)
 

Definition at line 146 of file stream.h.

#define SERR_FAIL   0
 

Definition at line 41 of file stream.h.

Referenced by app_stream_error_func(), and ht_stream::call_error_func().

#define SERR_RETRY   1
 

Definition at line 42 of file stream.h.

Referenced by app_stream_error_func(), and ht_file::set_access_mode_internal().

#define STERR_SYSTEM   0x80000000
 

Definition at line 45 of file stream.h.

Referenced by app_stream_error_func(), ht_app::create_window_file_bin(), ht_app::create_window_file_text(), ht_object_stream_bin::getBinary(), ht_object_stream_bin::getBool(), ht_object_stream_memmap::getIntHex(), ht_object_stream_bin::getIntHex(), ht_object_stream_memmap::getQWordHex(), ht_object_stream_bin::getQWordHex(), ht_app::handlemsg(), ht_strerror(), load_fileconfig(), load_systemconfig(), ht_object_stream_bin::putBinary(), ht_object_stream_bin::putBool(), ht_object_stream_memmap::putIntHex(), ht_object_stream_bin::putIntHex(), ht_object_stream_memmap::putQWordHex(), ht_object_stream_bin::putQWordHex(), ht_object_stream_bin::putString(), ht_file::set_access_mode_internal(), and ht_object_stream_txt::setSyntaxError().


Typedef Documentation

typedef int(* stream_error_func_ptr)(ht_stream *stream)
 

Definition at line 49 of file stream.h.

Referenced by ht_layer_streamfile::set_error_func(), ht_layer_stream::set_error_func(), and ht_stream::set_error_func().


Function Documentation

char* fgetstrz ht_streamfile file  ) 
 

Definition at line 1009 of file stream.cc.

References buf, file, FILEOFS, malloc(), and NULL.

Referenced by MachoAnalyser::beginAnalysis(), htpefimports_init(), ElfAnalyser::initInsertFakeSymbols(), and ElfAnalyser::initInsertSymbols().

char* getstrp ht_stream stream  ) 
 

Definition at line 1062 of file stream.cc.

References malloc(), and ht_stream::read().

Referenced by NEAnalyser::beginAnalysis(), and ht_ne::init().

char* getstrw ht_stream stream  ) 
 

Definition at line 1079 of file stream.cc.

References byte, malloc(), and ht_stream::read().

char* getstrz ht_stream stream  ) 
 

Definition at line 1036 of file stream.cc.

References buf, malloc(), NULL, ht_stream::read(), and REASONABLE_STRING_LIMIT.

Referenced by ht_object_stream_bin::getString().

char* ht_strerror int  error  ) 
 

Definition at line 1099 of file stream.cc.

References STERR_SYSTEM.

void putstrp ht_stream stream,
const char *  str
 

Definition at line 1072 of file stream.cc.

References ht_stream::write().

void putstrw ht_stream stream,
const char *  str
 

Definition at line 1094 of file stream.cc.

void putstrz ht_stream stream,
const char *  str
 

Definition at line 1057 of file stream.cc.

References ht_stream::write().


Generated on Fri May 7 21:15:52 2004 by doxygen 1.3.5