char* CMessage::Readstr(char* des, unsigned short len) { int strlen = Readshort(); int min = MIN(strlen, len-1); ReadBuff(des, min); printf("min=%d\n", min); des[min] = '\0'; return des; }
InputFile* Program::AddModule (const char* name, FILE* f) { Exec e; Module *mod; Debug("reading module %s", name); ReadBuff(f, &e, sizeof(e), "Couldn't read header in .o file", E_HEADER); mod = new Module(name, &e, f, 0); mod->Read3Parts(e); mod->CloseFile(); units->Insert(name, mod); return mod; }
short CMessage::Readshort() { short s; ReadBuff((char*)&s, sizeof(s)); return s; }
char CMessage::Readchar() { char c; ReadBuff((char*)&c, sizeof(c)); return c; }
void CMessage::ReadBulk(void * des,unsigned short len) { ReadBuff((char*)des,len); }
long long CMessage::Readlonglong() { long long ll; ReadBuff((char*)&ll, sizeof(ll)); return ll; }
int CMessage::Readint() { int n; ReadBuff((char*)&n, sizeof(n)); return n; }