diff options
author | Fritz Elfert <felfert@to.com> | 2002-02-28 20:56:59 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2002-02-28 20:56:59 +0000 |
commit | eecba3b5fcb47a01e6e13ee1940def989f6dd22d (patch) | |
tree | 970f3113de0d2b9b0544c1420117e0cf9633abcd /lib/sisreqrecord.cpp | |
parent | 12241e0ff5ea242891fc3a8c177e8f55e897f2a3 (diff) | |
download | plptools-eecba3b5fcb47a01e6e13ee1940def989f6dd22d.tar.gz plptools-eecba3b5fcb47a01e6e13ee1940def989f6dd22d.tar.bz2 plptools-eecba3b5fcb47a01e6e13ee1940def989f6dd22d.zip |
- Added SIS stuff by Daniel Brahneborg
Diffstat (limited to 'lib/sisreqrecord.cpp')
-rw-r--r-- | lib/sisreqrecord.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/sisreqrecord.cpp b/lib/sisreqrecord.cpp new file mode 100644 index 0000000..978ce48 --- /dev/null +++ b/lib/sisreqrecord.cpp @@ -0,0 +1,43 @@ + +#include "sisreqrecord.h" +#include "sisfile.h" + +#include <stdio.h> + +void +SISReqRecord::fillFrom(uchar* buf, int* base, SISFile* sisFile) +{ + int ix = *base; + + m_uid = read32(buf, &ix); + m_major = read16(buf, &ix); + m_minor = read16(buf, &ix); + m_variant = read32(buf, &ix); + int n = sisFile->m_header.m_nreqs; + m_nameLengths = new uint32[n]; + m_namePtrs = new uint32[n]; + + // First read lengths. + // + for (int i = 0; i < n; ++i) + { + m_nameLengths[i] = read32(buf, &ix); + } + + // Then read ptrs. + // + for (int i = 0; i < n; ++i) + { + m_namePtrs[i] = read32(buf, &ix); + if (logLevel >= 2) + printf("Name %d (for %s) is %.*s\n", + i, + sisFile->getLanguage(i)->m_name, + m_nameLengths[i], + buf + m_namePtrs[i]); + } + if (logLevel >= 1) + printf("%d .. %d (%d bytes): Req record\n", *base, ix, ix - *base); + *base = ix; +} + |