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

stream.cc File Reference

#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include "htdebug.h"
#include "htexcept.h"
#include "htsys.h"
#include "stream.h"
#include "tools.h"

Go to the source code of this file.

Defines

#define STREAM_COPYBUF_SIZE   (64*1024)
#define EXTEND_BUFSIZE   1024
#define EXTEND_BUFSIZE   1024
#define HTMEMFILE_INITIAL_SIZE   1024
#define HTMEMFILE_GROW_FACTOR_NUM   4
#define HTMEMFILE_GROW_FACTOR_DENOM   3
#define REASONABLE_STRING_LIMIT   1024

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 EXTEND_BUFSIZE   1024
 

Definition at line 510 of file stream.cc.

#define EXTEND_BUFSIZE   1024
 

Definition at line 510 of file stream.cc.

Referenced by ht_stdio_file::extend(), and ht_sys_file::extend().

#define HTMEMFILE_GROW_FACTOR_DENOM   3
 

Definition at line 858 of file stream.cc.

Referenced by ht_mem_file::extendbufsize(), and ht_mem_file::shrinkbufsize().

#define HTMEMFILE_GROW_FACTOR_NUM   4
 

Definition at line 857 of file stream.cc.

Referenced by ht_mem_file::extendbufsize(), and ht_mem_file::shrinkbufsize().

#define HTMEMFILE_INITIAL_SIZE   1024
 

Definition at line 856 of file stream.cc.

Referenced by ht_mem_file::init().

#define REASONABLE_STRING_LIMIT   1024
 

Definition at line 1034 of file stream.cc.

Referenced by getstrz().

#define STREAM_COPYBUF_SIZE   (64*1024)
 

Definition at line 40 of file stream.cc.

Referenced by ht_ltextfile::copy_to(), and ht_stream::copy_to().


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