Update of /cvsroot/replaypc/replaypc In directory usw-pr-cvs1:/tmp/cvs-serv28006 Modified Files: zipcode.h zipcode.c rtv.h rtv.c rddnsclient.c program.h program.c netclient.c ndx.h ndx.c httpclient.h httpclient.c headend.h headend.c guide.h guide.c dump-zipcode2.c dump-replayshows.c dump-replaychannels.c dump-programset.c dump-headend.c dump-filedarray.c dump-channelset.c dump-cg2.c dump-addressbook.c channelset.h channelset.c cg.h cg.c addressbook.h addressbook.c Removed Files: dump-programset.h Log Message: Mostly cleanup changes prior to merging in 4.5.0 (5000) support dump-programset.h removed -- it shouldn't have ever been comitted new functions & macros used throughout: rtv_to_buf_len memcpy, pointer bumping rtv_from_buf_len memcpy, pointer bumping rtv_to_u8 just for regularity rtv_from_u8 just for regularity rtv_to_buf calls rtv_to_buf_len, using sizeof to prevent errors rtv_from_len calls rtv_from_buf_len, using sizeof to prevent errors <STRUCT>_SIZE macros added for every on-replay structure whose size is used, so somewhat fewer mysterious constants used throughout replay_theme structure size fixed, and replay_channel has a new unknown8 member httpclient changes to avoid long timeout on HTTP/1.1 requests with responses smaller than 4096 bytes, when the server doesn't use chunking (ie, 'rddns' lookups) new httpclient function hc_read_all_len, combines simplicity of hc_read_all with the proper buffer/length handling of hc_read_pieces more netclient dumping (based on NC_DUMP envvar) adding, to help figure out what was going on with the short-unchunked responses rddnsclient simplified by use of hc_read_all_len Index: zipcode.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/zipcode.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zipcode.h 21 Mar 2002 23:28:43 -0000 1.2 --- zipcode.h 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- /* 68 */ u8 extra_data[56]; }; /* 124 */ + #define ZIPCODE2_HEADEND_SIZE 124 int parse_zipcode2_headend(unsigned char ** pp, struct zipcode2_headend * zh); Index: zipcode.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/zipcode.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zipcode.c 21 Mar 2002 23:28:43 -0000 1.2 --- zipcode.c 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 30,39 **** unsigned char * p = *pp; ! memcpy(zh->name, p, 8); p += 8; ! memcpy(zh->description, p, 56); p += 56; ! zh->type = *p++; ! zh->unk1 = *p++; zh->unk2 = rtv_to_u16(&p); ! memcpy(zh->extra_data, p, 56); p += 56; *pp = p; --- 30,39 ---- unsigned char * p = *pp; ! rtv_to_buf(&p, zh->name); ! rtv_to_buf(&p, zh->description); ! zh->type = rtv_to_u8(&p); ! zh->unk1 = rtv_to_u8(&p); zh->unk2 = rtv_to_u16(&p); ! rtv_to_buf(&p, zh->extra_data); *pp = p; Index: rtv.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/rtv.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rtv.h 16 Aug 2002 02:59:03 -0000 1.8 --- rtv.h 3 Nov 2002 12:15:40 -0000 1.9 *************** *** 16,19 **** --- 16,21 ---- #define RTV_H + #include <stdlib.h> + #ifdef __unix__ #define _LARGEFILE64_SOURCE *************** *** 51,60 **** --- 53,68 ---- extern struct replaytv_version replaytv_version; + extern u8 rtv_to_u8(unsigned char ** pp); extern u16 rtv_to_u16(unsigned char ** pp); extern u32 rtv_to_u32(unsigned char ** pp); extern u64 rtv_to_u64(unsigned char ** pp); + extern void rtv_to_buf_len(unsigned char ** pp, unsigned char * b, size_t l); + #define rtv_to_buf(pp, buf) rtv_to_buf_len(pp, buf, sizeof buf) + extern void rtv_from_u8(unsigned char ** p, u8 v); extern void rtv_from_u16(unsigned char ** pp, u16 v); extern void rtv_from_u32(unsigned char ** pp, u32 v); extern void rtv_from_u64(unsigned char ** pp, u64 v); + extern void rtv_from_buf_len(unsigned char ** pp, unsigned char * b, size_t l); + #define rtv_from_buf(pp, buf) rtv_to_buf_len(pp, buf, sizeof buf) extern int rtv_set_replaytv_version(char * version); Index: rtv.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/rtv.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rtv.c 16 Aug 2002 02:59:03 -0000 1.7 --- rtv.c 3 Nov 2002 12:15:40 -0000 1.8 *************** *** 20,48 **** struct replaytv_version replaytv_version = {4, 3, 0, 280}; ! u16 rtv_to_u16(unsigned char ** pp) { unsigned char * p; ! u16 r; ! ! p = *pp; ! r = *p++; ! r <<= 8; ! r |= *p++; *pp = p; return r; } ! u32 rtv_to_u32(unsigned char ** pp) { ! unsigned char * p; ! u32 r; ! ! p = *pp; ! r = rtv_to_u16(&p); ! r <<= 16; ! r |= rtv_to_u16(&p); ! *pp = p; return r; } --- 20,48 ---- struct replaytv_version replaytv_version = {4, 3, 0, 280}; ! u8 rtv_to_u8(unsigned char ** pp) { unsigned char * p; ! u8 r; + p = *pp; + r = *p++; *pp = p; + return r; } ! u16 rtv_to_u16(unsigned char ** pp) { ! u16 r; ! r = rtv_to_u8(pp) << 8; ! r |= rtv_to_u8(pp); ! return r; ! } ! u32 rtv_to_u32(unsigned char ** pp) ! { ! u32 r; ! r = rtv_to_u16(pp) << 16; ! r |= rtv_to_u16(pp); return r; } *************** *** 50,98 **** u64 rtv_to_u64(unsigned char ** pp) { ! unsigned char * p; ! u64 r; ! ! p = *pp; ! r = rtv_to_u32(&p); ! r <<= 32; ! r |= rtv_to_u32(&p); ! *pp = p; return r; } ! void rtv_from_u16(unsigned char ** pp, u16 v) { unsigned char * p; - p = *pp; ! ! *p++ = (v & 0xff00) >> 8; ! *p++ = v & 0x00ff; ! *pp = p; } ! void rtv_from_u32(unsigned char ** pp, u32 v) { unsigned char * p; p = *pp; ! ! rtv_from_u16(&p, (u16)((v & 0xffff0000) >> 16)); ! rtv_from_u16(&p, (u16)(v & 0x0000ffff)); ! *pp = p; } void rtv_from_u64(unsigned char ** pp, u64 v) { ! unsigned char * p; p = *pp; ! ! rtv_from_u32(&p, (u32)((v & 0xffffffff00000000) >> 32)); ! rtv_from_u32(&p, (u32)(v & 0x00000000ffffffff)); ! *pp = p; } --- 50,102 ---- u64 rtv_to_u64(unsigned char ** pp) { ! u64 r; ! r = (u64)(rtv_to_u32(pp)) << 32; ! r |= (u64)(rtv_to_u32(pp)); return r; } ! void rtv_to_buf_len(unsigned char ** pp, unsigned char * b, size_t l) { unsigned char * p; p = *pp; ! memcpy(b, p, l); ! p += l; *pp = p; } ! void rtv_from_u8(unsigned char ** pp, u8 v) { unsigned char * p; p = *pp; ! *p++ = v; *pp = p; } + + void rtv_from_u16(unsigned char ** pp, u16 v) + { + rtv_from_u8(pp, (u8)((v & 0xff00) >> 8)); + rtv_from_u8(pp, (u8)((v & 0x00ff) )); + } + + void rtv_from_u32(unsigned char ** pp, u32 v) + { + rtv_from_u16(pp, (u16)((v & 0xffff0000) >> 16)); + rtv_from_u16(pp, (u16)((v & 0x0000ffff) )); + } void rtv_from_u64(unsigned char ** pp, u64 v) { ! rtv_from_u32(pp, (u32)((v & 0xffffffff00000000) >> 32)); ! rtv_from_u32(pp, (u32)((v & 0x00000000ffffffff) )); ! } + void rtv_from_buf_len(unsigned char ** pp, unsigned char * b, size_t l) + { + unsigned char * p; p = *pp; ! memcpy(p, b, l); ! p += l; *pp = p; } Index: rddnsclient.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/rddnsclient.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rddnsclient.c 24 Oct 2002 02:08:28 -0000 1.6 --- rddnsclient.c 3 Nov 2002 12:15:40 -0000 1.7 *************** *** 19,46 **** #include <string.h> - struct decrypt_callback_data - { - char * plaintext_buffer; - u32 plaintext_buffer_len; - u32 plaintext_len; - u32 t; - }; - - /* XXX this only handles one chunk */ - static void decrypt_callback(unsigned char * cyphertext, size_t cyphertext_len, void * vp) - { - struct decrypt_callback_data * d = vp; - - rtv_decrypt(cyphertext, cyphertext_len, - d->plaintext_buffer, d->plaintext_buffer_len, - &d->t, &d->plaintext_len, 0); - free(cyphertext); - } - static int rddns_query(unsigned const char * path, unsigned const char * querystring, unsigned char * result_buffer, size_t result_buffer_len) { - struct decrypt_callback_data decrypt_data; unsigned char urlbuf[1024]; unsigned char cyphertext[64]; --- 19,26 ---- *************** *** 49,56 **** struct hc * hc; u32 cyphertext_len; ! ! decrypt_data.plaintext_buffer = result_buffer; ! decrypt_data.plaintext_buffer_len = result_buffer_len; ! if (rtv_encrypt(querystring, strlen(querystring), cyphertext, sizeof cyphertext, &cyphertext_len, 0) < 0) { --- 29,35 ---- struct hc * hc; u32 cyphertext_len; ! unsigned char * buf; ! size_t len; ! if (rtv_encrypt(querystring, strlen(querystring), cyphertext, sizeof cyphertext, &cyphertext_len, 0) < 0) { *************** *** 73,80 **** --- 52,61 ---- fprintf(stderr, "ERROR rddns_lookup: hc_start_request %s failed\n", urlbuf); + hc_free(hc); return -1; } if (hc_send_request(hc) < 0) { fprintf(stderr, "ERROR rddns_lookup: hc_send_request failed\n"); + hc_free(hc); return -1; } *************** *** 82,92 **** fprintf(stderr, "ERROR rddns_lookup http status %d\n", hc_get_status(hc)); return -1; } ! if (hc_read_pieces(hc, decrypt_callback, &decrypt_data) < 0) { fprintf(stderr, "ERROR rddns_lookup read failed\n"); return -1; } hc_free(hc); return 0; } --- 63,82 ---- fprintf(stderr, "ERROR rddns_lookup http status %d\n", hc_get_status(hc)); + hc_free(hc); return -1; } ! buf = hc_read_all_len(hc, &len); ! if (buf == NULL) { fprintf(stderr, "ERROR rddns_lookup read failed\n"); + hc_free(hc); return -1; } hc_free(hc); + + rtv_decrypt(buf, len, + result_buffer, result_buffer_len, + NULL, NULL, 0); + free(buf); + return 0; } Index: program.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/program.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** program.h 21 Mar 2002 23:28:43 -0000 1.4 --- program.h 3 Nov 2002 12:15:40 -0000 1.5 *************** *** 32,35 **** --- 32,36 ---- /* 16 */ struct fixed_program_record fixed_program_record; }; /* 272 */ + #define PROGRAM_SIZE 272 int parse_program(unsigned char **pp, struct program * prog); Index: program.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/program.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** program.c 8 Apr 2002 22:17:33 -0000 1.5 --- program.c 3 Nov 2002 12:15:40 -0000 1.6 *************** *** 255,259 **** if (prog->struct_size) { ! expect(prog->struct_size == 272); expect(prog->unknown1 == 1); expect(prog->isvalid == 1); --- 255,259 ---- if (prog->struct_size) { ! expect(prog->struct_size == PROGRAM_SIZE); expect(prog->unknown1 == 1); expect(prog->isvalid == 1); Index: netclient.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/netclient.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** netclient.c 1 Jul 2002 23:16:26 -0000 1.8 --- netclient.c 3 Nov 2002 12:15:40 -0000 1.9 *************** *** 65,69 **** if (!nc_do_dump) return; ! fprintf(stderr, "NC DUMP: %s\n", tag); rows = (sz + 15)/16; for (row = 0; row < rows; row++) { --- 65,71 ---- if (!nc_do_dump) return; ! fprintf(stderr, "NC DUMP: %s %lu\n", tag, (unsigned long)sz); ! if (buf == NULL) ! return; rows = (sz + 15)/16; for (row = 0; row < rows; row++) { *************** *** 234,238 **** size_t l; int r = 0; ! while (len) { if (nc->high == nc->low) { --- 236,241 ---- size_t l; int r = 0; ! ! nc_dump("Reading", NULL, len); while (len) { if (nc->high == nc->low) { *************** *** 240,243 **** --- 243,247 ---- } if (nc->high == 0) { + nc_dump("Read", buf, r); return r; } *************** *** 248,251 **** --- 252,256 ---- nc->low += l; } + nc_dump("Read", buf, r); return r; } *************** *** 255,258 **** --- 260,264 ---- size_t r = 0; + nc_dump("Reading line", NULL, maxlen); while (r < maxlen) { if (nc_read(nc, buf + r, 1) <= 0) { *************** *** 265,272 **** --- 271,280 ---- buf[r] = '\0'; } + nc_dump("Read line", buf, r); return r; } r++; } + nc_dump("Read line", buf, r); return r; } Index: ndx.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/ndx.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ndx.h 30 Mar 2002 00:25:39 -0000 1.4 --- ndx.h 3 Nov 2002 12:15:40 -0000 1.5 *************** *** 32,35 **** --- 32,36 ---- /* 24 */ u64 stream_position; }; /* 32 */ + #define NDX_RECORD_SIZE 32 extern int read_ndx_record(FILE * fp, struct ndx_record * pr); Index: ndx.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/ndx.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ndx.c 17 Mar 2002 22:29:32 -0000 1.3 --- ndx.c 3 Nov 2002 12:15:40 -0000 1.4 *************** *** 20,37 **** int read_ndx_record(FILE * fp, struct ndx_record * pr) { ! unsigned char buf[32], * p; int r; ! if ((r = fread(buf, 1, 32, fp)) <= 0) return r; p = buf; ! memset(pr, 0, 32); ! pr->flag_1 = *p++; ! pr->commercial_flag = *p++; pr->video_offset = rtv_to_u16(&p); ! pr->unk_fe = *p++; ! pr->macrovision = *p++; pr->macrovision_count = rtv_to_u16(&p); pr->audio_offset = rtv_to_u32(&p); --- 20,37 ---- int read_ndx_record(FILE * fp, struct ndx_record * pr) { ! unsigned char buf[NDX_RECORD_SIZE], * p; int r; ! if ((r = fread(buf, 1, NDX_RECORD_SIZE, fp)) <= 0) return r; p = buf; ! memset(pr, 0, NDX_RECORD_SIZE); ! pr->flag_1 = rtv_to_u8(&p); ! pr->commercial_flag = rtv_to_u8(&p); pr->video_offset = rtv_to_u16(&p); ! pr->unk_fe = rtv_to_u8(&p); ! pr->macrovision = rtv_to_u8(&p); pr->macrovision_count = rtv_to_u16(&p); pr->audio_offset = rtv_to_u32(&p); *************** *** 40,44 **** pr->stream_position = rtv_to_u64(&p); ! assert(p == buf + 32); return 1; } --- 40,44 ---- pr->stream_position = rtv_to_u64(&p); ! assert(p == buf + NDX_RECORD_SIZE); return 1; } *************** *** 46,57 **** int write_ndx_record(FILE * fp, struct ndx_record * pr) { ! unsigned char buf[32], * p; p = buf; ! *p++ = pr->flag_1; ! *p++ = pr->commercial_flag; rtv_from_u16(&p, pr->video_offset); ! *p++ = pr->unk_fe; ! *p++ = pr->macrovision; rtv_from_u16(&p, pr->macrovision_count); rtv_from_u32(&p, pr->audio_offset); --- 46,57 ---- int write_ndx_record(FILE * fp, struct ndx_record * pr) { ! unsigned char buf[NDX_RECORD_SIZE], * p; p = buf; ! rtv_from_u8(&p, pr->flag_1); ! rtv_from_u8(&p, pr->commercial_flag); rtv_from_u16(&p, pr->video_offset); ! rtv_from_u8(&p, pr->unk_fe); ! rtv_from_u8(&p, pr->macrovision); rtv_from_u16(&p, pr->macrovision_count); rtv_from_u32(&p, pr->audio_offset); *************** *** 60,64 **** rtv_from_u64(&p, pr->stream_position); ! assert(p == buf + 32); ! return fwrite(buf, 1, 32, fp); } --- 60,64 ---- rtv_from_u64(&p, pr->stream_position); ! assert(p == buf + NDX_RECORD_SIZE); ! return fwrite(buf, 1, NDX_RECORD_SIZE, fp); } Index: httpclient.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/httpclient.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** httpclient.h 5 Feb 2002 07:34:41 -0000 1.4 --- httpclient.h 3 Nov 2002 12:15:40 -0000 1.5 *************** *** 84,87 **** --- 84,88 ---- extern int hc_get_status(struct hc * hc); extern char * hc_lookup_rsp_header(struct hc * hc, const char * tag); + extern unsigned char * hc_read_all_len(struct hc * hc, size_t * plen); extern unsigned char * hc_read_all(struct hc * hc); extern int hc_read_pieces(struct hc * hc, Index: httpclient.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/httpclient.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** httpclient.c 18 Feb 2002 06:45:02 -0000 1.6 --- httpclient.c 3 Nov 2002 12:15:40 -0000 1.7 *************** *** 19,22 **** --- 19,24 ---- #include <string.h> + #define MAX_CHUNK 32768 + struct hc_headers { *************** *** 278,282 **** int done = 0; char * buf; ! size_t len, len_read; te = hc_lookup_rsp_header(hc, "Transfer-Encoding"); --- 280,292 ---- int done = 0; char * buf; ! size_t len, len_read, octets_to_go; ! char * cl; ! ! cl = hc_lookup_rsp_header(hc, "Content-Length"); ! if (cl) { ! octets_to_go = strtoul(cl, NULL, 10); ! } else { ! octets_to_go = 0; ! } te = hc_lookup_rsp_header(hc, "Transfer-Encoding"); *************** *** 284,288 **** chunked = 1; } - while (!done) { if (chunked) { --- 294,297 ---- *************** *** 292,296 **** len = strtoul(lenstr, NULL, 16); } else { ! len = 4096; } if (len) { --- 301,311 ---- len = strtoul(lenstr, NULL, 16); } else { ! if (cl) { ! len = octets_to_go; ! if (len > MAX_CHUNK) ! len = MAX_CHUNK; ! } else { ! len = MAX_CHUNK; ! } } if (len) { *************** *** 301,304 **** --- 316,325 ---- buf[len_read] = '\0'; callback(buf, len_read, v); + if (cl) { + octets_to_go -= len_read; + if (octets_to_go == 0 && !chunked) { + done = 1; + } + } } else { done = 1; *************** *** 353,357 **** } ! unsigned char * hc_read_all(struct hc * hc) { struct read_all_data data; --- 374,378 ---- } ! unsigned char * hc_read_all_len(struct hc * hc, size_t * plen) { struct read_all_data data; *************** *** 376,381 **** --- 397,411 ---- r[data.total] = '\0'; + if (plen) + *plen = data.total; + return r; } + + unsigned char * hc_read_all(struct hc * hc) + { + return hc_read_all_len(hc, NULL); + } + Index: headend.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/headend.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** headend.h 21 Mar 2002 23:28:43 -0000 1.2 --- headend.h 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- /* 4 */ u8 max_tier[32]; }; /* 36 */ + #define HEADEND_HEADER_SIZE 36 struct headend_channel { *************** *** 35,38 **** --- 36,40 ---- /* 24 */ u8 description[32]; }; /* 56 */ + #define HEADEND_CHANNEL_SIZE 56 int parse_headend_header(unsigned char ** p, struct headend_header * h); Index: headend.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/headend.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** headend.c 21 Mar 2002 23:28:43 -0000 1.3 --- headend.c 3 Nov 2002 12:15:40 -0000 1.4 *************** *** 123,127 **** h->device_bitmap = rtv_to_u32(&p); ! memcpy(h->max_tier, p, 32); p += 32; *pp = p; --- 123,127 ---- h->device_bitmap = rtv_to_u32(&p); ! rtv_to_buf(&p, h->max_tier); *pp = p; *************** *** 136,144 **** hc->tmsid = rtv_to_u32(&p); hc->tuning = rtv_to_u16(&p); ! hc->device = *p++; ! hc->service_tier = *p++; ! memcpy(hc->name, p, 16); p += 16; ! memcpy(hc->description, p, 32); p += 32; ! *pp = p; --- 136,143 ---- hc->tmsid = rtv_to_u32(&p); hc->tuning = rtv_to_u16(&p); ! hc->device = rtv_to_u8(&p); ! hc->service_tier = rtv_to_u8(&p); ! rtv_to_buf(&p, hc->name); ! rtv_to_buf(&p, hc->description); *pp = p; Index: guide.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/guide.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** guide.h 16 Aug 2002 02:59:03 -0000 1.12 --- guide.h 3 Nov 2002 12:15:40 -0000 1.13 *************** *** 45,60 **** in parse_guide_header */ }; /* 32 */ struct group_data { /* corresponds to RTV group_data */ /* 0 */ u32 struct_size; /* 776 */ /* 4 */ u32 num_categories; /* number of categories, max 32 */ ! /* 8 */ u32 index[32]; ! /*136 */ u32 name_offset[32]; /*264 */ u8 name_block[512]; /* convenience -- doesn't correspond */ ! struct mapping category_bitmapping[32]; };/*776 */ struct channel { /* corresponds to an RTV Channel */ --- 45,63 ---- in parse_guide_header */ }; /* 32 */ + #define GUIDE_HEADER_SIZE 32 + #define MAX_GROUPS 32 struct group_data { /* corresponds to RTV group_data */ /* 0 */ u32 struct_size; /* 776 */ /* 4 */ u32 num_categories; /* number of categories, max 32 */ ! /* 8 */ u32 index[MAX_GROUPS]; ! /*136 */ u32 name_offset[MAX_GROUPS]; /*264 */ u8 name_block[512]; /* convenience -- doesn't correspond */ ! struct mapping category_bitmapping[MAX_GROUPS]; };/*776 */ + #define GUIDE_DATA_SIZE 776 struct channel { /* corresponds to an RTV Channel */ *************** *** 68,71 **** --- 71,75 ---- /* 76 */ u32 guide_index; /* the channel # as shown in the guide */ }; /* 80 */ + #define CHANNEL_SIZE 80 struct replay_show { /* corresponds to an RTV ReplayShow */ *************** *** 97,100 **** --- 101,105 ---- /*436 */ u64 mpeg_size; }; /* 444 */ + #define REPLAY_SHOW_SIZE 444 /* if suzuki, and it matches, score = 4096 *************** *** 125,130 **** /* 4 */ u32 suzuki_id; /* 8 */ u32 minutes; ! /* 12 */ u8 keywords[52]; /* only 48 bytes copied from ReplayTheme0*/ ! }; /* 64 */ struct replay_channel { /* corresponds to an RTV ReplayChannel */ --- 130,136 ---- /* 4 */ u32 suzuki_id; /* 8 */ u32 minutes; ! /* 12 */ u8 keywords[48]; /* only 48 bytes copied from ReplayTheme0*/ ! }; /* 60 */ ! #define REPLAY_THEME_SIZE 60 struct replay_channel { /* corresponds to an RTV ReplayChannel */ *************** *** 151,155 **** --- 157,163 ---- /*116 */ struct replay_show replay_show; /*560 */ struct replay_theme replay_theme; + /*620 */ u32 unknown8; }; /* 624 */ + #define REPLAY_CHANNEL_SIZE 624 struct replay_guide_snapshot { Index: guide.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/guide.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** guide.c 8 Apr 2002 22:15:01 -0000 1.13 --- guide.c 3 Nov 2002 12:15:40 -0000 1.14 *************** *** 59,68 **** expect(h->version == 0x00030001); ! expect(h->struct_size == 32); expect(h->num_channels_1 == h->num_channels_2); ! expect(h->group_data_offset == 32); ! expect(h->channel_offset == h->group_data_offset + 776); expect(h->show_offset == ! h->group_data_offset + 776 + 624 * h->num_channels_1); return 0; --- 59,70 ---- expect(h->version == 0x00030001); ! expect(h->struct_size == GUIDE_HEADER_SIZE); expect(h->num_channels_1 == h->num_channels_2); ! expect(h->group_data_offset == GUIDE_HEADER_SIZE); ! expect(h->channel_offset == h->group_data_offset + GUIDE_DATA_SIZE); expect(h->show_offset == ! h->group_data_offset + ! GUIDE_DATA_SIZE + ! REPLAY_CHANNEL_SIZE * h->num_channels_1); return 0; *************** *** 74,90 **** unsigned int i; ! gd->struct_size = rtv_to_u32(&p); ! gd->num_categories = rtv_to_u32(&p); ! for (i = 0; i < 32; i++) ! gd->index[i] = rtv_to_u32(&p); ! for (i = 0; i < 32; i++) ! gd->name_offset[i] = rtv_to_u32(&p); ! memcpy(gd->name_block, p, sizeof gd->name_block); ! p += sizeof gd->name_block; *pp = p; ! expect(gd->struct_size == 776); ! expect(gd->num_categories <= 32); for (i = 0; i < gd->num_categories; i++) { --- 76,89 ---- unsigned int i; ! gd->struct_size = rtv_to_u32(&p); ! gd->num_categories = rtv_to_u32(&p); ! for (i = 0; i < 32; i++) gd->index[i] = rtv_to_u32(&p); ! for (i = 0; i < 32; i++) gd->name_offset[i] = rtv_to_u32(&p); ! rtv_to_buf(&p, gd->name_block); *pp = p; ! expect(gd->struct_size == GUIDE_DATA_SIZE); ! expect(gd->num_categories <= MAX_GROUPS); for (i = 0; i < gd->num_categories; i++) { *************** *** 93,98 **** --- 92,100 ---- gd->name_block + gd->name_offset[i]; } + #if 0 /* why was this here? It's not needed in any of my current + samples */ gd->category_bitmapping[gd->num_categories].value = 1 << 16; gd->category_bitmapping[gd->num_categories].name = "Received"; + #endif gd->category_bitmapping[gd->num_categories+1].value = -1; gd->category_bitmapping[gd->num_categories+1].name = NULL; *************** *** 109,117 **** c->isvalid = rtv_to_u32(&p); parse_headend_channel(&p, &c->headend_channel); ! memcpy(c->headend, p, sizeof c->headend); p += sizeof c->headend; c->guide_index = rtv_to_u32(&p); if (c->struct_size) { ! expect(c->struct_size == 80); expect(c->unknown1 == 1); expect(c->isvalid == 1); --- 111,119 ---- c->isvalid = rtv_to_u32(&p); parse_headend_channel(&p, &c->headend_channel); ! rtv_to_buf(&p, c->headend); c->guide_index = rtv_to_u32(&p); if (c->struct_size) { ! expect(c->struct_size == CHANNEL_SIZE); expect(c->unknown1 == 1); expect(c->isvalid == 1); *************** *** 152,157 **** rs->instance = rtv_to_u32(&p); rs->unused1 = rtv_to_u16(&p); ! rs->before_padding = *p++; ! rs->after_padding = *p++; rs->index_size = rtv_to_u64(&p); rs->mpeg_size = rtv_to_u64(&p); --- 154,159 ---- rs->instance = rtv_to_u32(&p); rs->unused1 = rtv_to_u16(&p); ! rs->before_padding = rtv_to_u8(&p); ! rs->after_padding = rtv_to_u8(&p); rs->index_size = rtv_to_u64(&p); rs->mpeg_size = rtv_to_u64(&p); *************** *** 172,178 **** rt->suzuki_id = rtv_to_u32(&p); rt->minutes = rtv_to_u32(&p); ! memcpy(rt->keywords, p, sizeof rt->keywords); ! p += sizeof rt->keywords; ! *pp = p; --- 174,178 ---- rt->suzuki_id = rtv_to_u32(&p); rt->minutes = rtv_to_u32(&p); ! rtv_to_buf(&p, rt->keywords); *pp = p; *************** *** 189,196 **** rc->keep = rtv_to_u32(&p); rc->stored = rtv_to_u32(&p); ! rc->days_of_week = *p++; ! rc->after_padding = *p++; ! rc->before_padding = *p++; ! rc->flags = *p++; rc->category = rtv_to_u32(&p); rc->channel_id = rtv_to_u32(&p); --- 189,196 ---- rc->keep = rtv_to_u32(&p); rc->stored = rtv_to_u32(&p); ! rc->days_of_week = rtv_to_u8(&p); ! rc->after_padding = rtv_to_u8(&p); ! rc->before_padding = rtv_to_u8(&p); ! rc->flags = rtv_to_u8(&p); rc->category = rtv_to_u32(&p); rc->channel_id = rtv_to_u32(&p); *************** *** 203,209 **** rc->unknown7 = rtv_to_u32(&p); rc->seconds_reserved = rtv_to_u32(&p); ! memcpy(rc->label, p, sizeof rc->label); p += sizeof rc->label; parse_replay_show(&p, &rc->replay_show); parse_replay_theme(&p, &rc->replay_theme); *pp = p; --- 203,210 ---- rc->unknown7 = rtv_to_u32(&p); rc->seconds_reserved = rtv_to_u32(&p); ! rtv_to_buf(&p, rc->label); parse_replay_show(&p, &rc->replay_show); parse_replay_theme(&p, &rc->replay_theme); + rc->unknown8 = rtv_to_u32(&p); *pp = p; *************** *** 264,268 **** * read the header */ ss->stage = 1; ! return 32; case 1: /* Parse the header, and read the * guide data */ --- 265,269 ---- * read the header */ ss->stage = 1; ! return GUIDE_HEADER_SIZE; case 1: /* Parse the header, and read the * guide data */ *************** *** 274,278 **** ss->num_shows = 0; ss->stage = 2; ! return 776; case 2: /* Parse the guide data, read the * channels */ --- 275,279 ---- ss->num_shows = 0; ss->stage = 2; ! return GUIDE_DATA_SIZE; case 2: /* Parse the guide data, read the * channels */ *************** *** 282,286 **** } ss->stage = 3; ! return ss->guide_header.num_channels_1 * 624; case 3: /* Parse the channels, then find the * first one with any stored programs, --- 283,287 ---- } ss->stage = 3; ! return ss->guide_header.num_channels_1 * REPLAY_CHANNEL_SIZE; case 3: /* Parse the channels, then find the * first one with any stored programs, *************** *** 300,304 **** ss->stage = 4; ss->guide_header.num_channels_2 = i; ! return ss->replay_channels[i].stored * 444; } else { fprintf(stderr, "Skipping channel %d: %ld\n", --- 301,305 ---- ss->stage = 4; ss->guide_header.num_channels_2 = i; ! return ss->replay_channels[i].stored * REPLAY_SHOW_SIZE; } else { fprintf(stderr, "Skipping channel %d: %ld\n", *************** *** 327,331 **** if (ss->replay_channels[i].stored) { ss->guide_header.num_channels_2 = i; ! return ss->replay_channels[i].stored * 444; } } --- 328,332 ---- if (ss->replay_channels[i].stored) { ss->guide_header.num_channels_2 = i; ! return ss->replay_channels[i].stored * REPLAY_SHOW_SIZE; } } *************** *** 539,542 **** --- 540,544 ---- dump_replay_show ( &rc->replay_show); dump_replay_theme ( &rc->replay_theme); + dump_u32 ("unknown8", rc->unknown8); dump_group_end (); } Index: dump-zipcode2.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-zipcode2.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dump-zipcode2.c 21 Mar 2002 23:28:43 -0000 1.3 --- dump-zipcode2.c 3 Nov 2002 12:15:40 -0000 1.4 *************** *** 20,28 **** static int dump_zipcode2_file(FILE * fp) { ! unsigned char buffer[124]; unsigned char * p; struct zipcode2_headend zh; ! while (fread(buffer, 124, 1, fp)) { p = buffer; parse_zipcode2_headend(&p, &zh); --- 20,28 ---- static int dump_zipcode2_file(FILE * fp) { ! unsigned char buffer[ZIPCODE2_HEADEND_SIZE]; unsigned char * p; struct zipcode2_headend zh; ! while (fread(buffer, ZIPCODE2_HEADEND_SIZE, 1, fp)) { p = buffer; parse_zipcode2_headend(&p, &zh); Index: dump-replayshows.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-replayshows.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump-replayshows.c 11 Jun 2002 04:53:19 -0000 1.1 --- dump-replayshows.c 3 Nov 2002 12:15:40 -0000 1.2 *************** *** 24,32 **** static int dump_replay_show_file(FILE * fp) { ! unsigned char buffer[444]; unsigned char * p; struct replay_show rs; ! while (fread(buffer, 444, 1, fp)) { p = buffer; parse_replay_show(&p, &rs); --- 24,32 ---- static int dump_replay_show_file(FILE * fp) { ! unsigned char buffer[REPLAY_SHOW_SIZE]; unsigned char * p; struct replay_show rs; ! while (fread(buffer, REPLAY_SHOW_SIZE, 1, fp)) { p = buffer; parse_replay_show(&p, &rs); Index: dump-replaychannels.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-replaychannels.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump-replaychannels.c 27 Mar 2002 23:08:30 -0000 1.1 --- dump-replaychannels.c 3 Nov 2002 12:15:40 -0000 1.2 *************** *** 24,32 **** static int dump_replay_channel_file(FILE * fp) { ! unsigned char buffer[624]; unsigned char * p; struct replay_channel rc; ! while (fread(buffer, 624, 1, fp)) { p = buffer; parse_replay_channel(&p, &rc); --- 24,32 ---- static int dump_replay_channel_file(FILE * fp) { ! unsigned char buffer[REPLAY_CHANNEL_SIZE]; unsigned char * p; struct replay_channel rc; ! while (fread(buffer, REPLAY_CHANNEL_SIZE, 1, fp)) { p = buffer; parse_replay_channel(&p, &rc); Index: dump-programset.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-programset.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dump-programset.c 17 Jun 2002 00:22:41 -0000 1.2 --- dump-programset.c 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 32,36 **** while (fread(buffer, 8, 1, fp)) { p = buffer; ! tms_id = rtv_to_u32(&p); length = rtv_to_u32(&p); --- 32,36 ---- while (fread(buffer, 8, 1, fp)) { p = buffer; ! tms_id = rtv_to_u32(&p); /* XXX should have a struct */ length = rtv_to_u32(&p); Index: dump-headend.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-headend.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dump-headend.c 21 Mar 2002 23:28:43 -0000 1.3 --- dump-headend.c 3 Nov 2002 12:15:40 -0000 1.4 *************** *** 20,35 **** static int dump_headend_file(FILE * fp) { ! unsigned char buffer[56]; struct headend_header hh; struct headend_channel hc; unsigned char * p; ! fread(buffer, 36, 1, fp); ! p = buffer; parse_headend_header(&p, &hh); dump_headend_header(&hh); ! while (fread(buffer, 56, 1, fp)) { ! p = buffer; parse_headend_channel(&p, &hc); dump_headend_channel(&hc); --- 20,36 ---- static int dump_headend_file(FILE * fp) { ! unsigned char he_buffer[HEADEND_HEADER_SIZE]; ! unsigned char hc_buffer[HEADEND_CHANNEL_SIZE]; struct headend_header hh; struct headend_channel hc; unsigned char * p; ! fread(he_buffer, HEADEND_HEADER_SIZE, 1, fp); ! p = he_buffer; parse_headend_header(&p, &hh); dump_headend_header(&hh); ! while (fread(hc_buffer, HEADEND_CHANNEL_SIZE, 1, fp)) { ! p = hc_buffer; parse_headend_channel(&p, &hc); dump_headend_channel(&hc); Index: dump-filedarray.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-filedarray.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump-filedarray.c 25 Mar 2002 00:13:23 -0000 1.1 --- dump-filedarray.c 3 Nov 2002 12:15:40 -0000 1.2 *************** *** 39,43 **** for (i = 0; i < count; i++) { switch(fah.item_size) { ! case 444: { struct replay_show rs; parse_replay_show(&p, &rs); --- 39,43 ---- for (i = 0; i < count; i++) { switch(fah.item_size) { ! case 444: { /* XXX */ struct replay_show rs; parse_replay_show(&p, &rs); Index: dump-channelset.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-channelset.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dump-channelset.c 17 Jun 2002 00:22:41 -0000 1.2 --- dump-channelset.c 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 21,30 **** { unsigned char header[256]; ! unsigned char buffer[68]; unsigned char * p; struct channelset_channel c; int i = 0; ! while (fread(buffer, 68, 1, fp)) { p = buffer; parse_channelset_channel(&p, &c); --- 21,30 ---- { unsigned char header[256]; ! unsigned char buffer[CHANNELSET_CHANNEL_SIZE]; unsigned char * p; struct channelset_channel c; int i = 0; ! while (fread(buffer, CHANNELSET_CHANNEL_SIZE, 1, fp)) { p = buffer; parse_channelset_channel(&p, &c); Index: dump-cg2.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-cg2.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dump-cg2.c 8 Apr 2002 22:14:22 -0000 1.4 --- dump-cg2.c 3 Nov 2002 12:15:40 -0000 1.5 *************** *** 21,29 **** { struct cg2_channel chan; ! unsigned char headbuf[12]; unsigned char * buf; unsigned char * p; ! if (fread(headbuf, 12, 1, in) <= 0) return -1; --- 21,29 ---- { struct cg2_channel chan; ! unsigned char headbuf[CG2_HEADER_SIZE]; unsigned char * buf; unsigned char * p; ! if (fread(headbuf, CG2_HEADER_SIZE, 1, in) <= 0) return -1; Index: dump-addressbook.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/dump-addressbook.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump-addressbook.c 27 Mar 2002 23:10:09 -0000 1.1 --- dump-addressbook.c 3 Nov 2002 12:15:40 -0000 1.2 *************** *** 20,24 **** static int dump_addressbook_file(FILE * fp) { ! unsigned char buffer[32]; unsigned char * p; unsigned int i; --- 20,25 ---- static int dump_addressbook_file(FILE * fp) { ! unsigned char abh_buffer[ADDRESSBOOK_HEADER_SIZE]; ! unsigned char abe_buffer[ADDRESSBOOK_ENTRY_SIZE]; unsigned char * p; unsigned int i; *************** *** 26,31 **** struct addressbook_entry e; ! fread(buffer, 12, 1, fp); ! p = buffer; parse_addressbook_header(&p, &h); dump_addressbook_header(&h); --- 27,32 ---- struct addressbook_entry e; ! fread(abh_buffer, ADDRESSBOOK_HEADER_SIZE, 1, fp); ! p = abh_buffer; parse_addressbook_header(&p, &h); dump_addressbook_header(&h); *************** *** 34,39 **** dump_group_start("Local Entry"); ! fread(buffer, 32, 1, fp); ! p = buffer; parse_addressbook_entry(&p, &e); dump_addressbook_entry(&e); --- 35,40 ---- dump_group_start("Local Entry"); ! fread(abe_buffer, ADDRESSBOOK_ENTRY_SIZE, 1, fp); ! p = abe_buffer; parse_addressbook_entry(&p, &e); dump_addressbook_entry(&e); *************** *** 42,47 **** dump_group_start("Remote Entries"); for (i = 0; i < h.remote_addresses; i++) { ! fread(buffer, 32, 1, fp); ! p = buffer; parse_addressbook_entry(&p, &e); dump_addressbook_entry(&e); --- 43,48 ---- dump_group_start("Remote Entries"); for (i = 0; i < h.remote_addresses; i++) { ! fread(abe_buffer, ADDRESSBOOK_ENTRY_SIZE, 1, fp); ! p = abe_buffer; parse_addressbook_entry(&p, &e); dump_addressbook_entry(&e); Index: channelset.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/channelset.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** channelset.h 17 Jun 2002 00:22:41 -0000 1.2 --- channelset.h 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 23,26 **** --- 23,27 ---- /* 64 */ u32 channelguide_index; }; /* 68 */ + #define CHANNELSET_CHANNEL_SIZE 68 int parse_channelset_channel(unsigned char ** pp, struct channelset_channel * c); Index: channelset.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/channelset.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** channelset.c 17 Jun 2002 00:22:41 -0000 1.2 --- channelset.c 3 Nov 2002 12:15:40 -0000 1.3 *************** *** 24,28 **** parse_headend_channel(&p, &c->headend_channel); ! memcpy(c->headend_name, p, 8); p += 8; c->channelguide_index = rtv_to_u32(&p); --- 24,28 ---- parse_headend_channel(&p, &c->headend_channel); ! rtv_to_buf(&p, c->headend_name); c->channelguide_index = rtv_to_u32(&p); Index: cg.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/cg.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cg.h 21 Mar 2002 23:28:43 -0000 1.4 --- cg.h 3 Nov 2002 12:15:40 -0000 1.5 *************** *** 75,78 **** --- 75,79 ---- struct fixed_program_record * programs; }; /* 12 */ + #define CG2_HEADER_SIZE 12 int parse_parts(unsigned char **p, struct parts * parts); Index: cg.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/cg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cg.c 21 Mar 2002 23:28:43 -0000 1.5 --- cg.c 3 Nov 2002 12:15:40 -0000 1.6 *************** *** 61,83 **** prog->tmsid = rtv_to_u32(&p); prog->minutes = rtv_to_u16(&p); ! prog->genre1 = *p++; ! prog->genre2 = *p++; ! prog->genre3 = *p++; ! prog->genre4 = *p++; prog->record_len = rtv_to_u16(&p); ! prog->title_len = *p++; ! prog->episode_len = *p++; ! prog->description_len = *p++; ! prog->actor_len = *p++; ! prog->guest_len = *p++; ! prog->suzuki_len = *p++; ! prog->producer_len = *p++; ! prog->director_len = *p++; if (varsize) data_len = prog->record_len - 28; else data_len = sizeof(prog->datablock); ! memcpy(prog->datablock, p, data_len); ! p += data_len; *pp = p; --- 61,82 ---- prog->tmsid = rtv_to_u32(&p); prog->minutes = rtv_to_u16(&p); ! prog->genre1 = rtv_to_u8(&p); ! prog->genre2 = rtv_to_u8(&p); ! prog->genre3 = rtv_to_u8(&p); ! prog->genre4 = rtv_to_u8(&p); prog->record_len = rtv_to_u16(&p); ! prog->title_len = rtv_to_u8(&p); ! prog->episode_len = rtv_to_u8(&p); ! prog->description_len = rtv_to_u8(&p); ! prog->actor_len = rtv_to_u8(&p); ! prog->guest_len = rtv_to_u8(&p); ! prog->suzuki_len = rtv_to_u8(&p); ! prog->producer_len = rtv_to_u8(&p); ! prog->director_len = rtv_to_u8(&p); if (varsize) data_len = prog->record_len - 28; else data_len = sizeof(prog->datablock); ! rtv_to_buf_len(&p, prog->datablock, data_len); *pp = p; Index: addressbook.h =================================================================== RCS file: /cvsroot/replaypc/replaypc/addressbook.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** addressbook.h 17 Jun 2002 00:22:41 -0000 1.3 --- addressbook.h 3 Nov 2002 12:15:40 -0000 1.4 *************** *** 23,26 **** --- 23,27 ---- /* 8 */ u32 remote_addresses; }; /* 12 */ + #define ADDRESSBOOK_HEADER_SIZE 12 struct addressbook_entry *************** *** 33,36 **** --- 34,38 ---- /* 28 */ u32 flags; /* 1 = blocked */ }; /* 32 */ + #define ADDRESSBOOK_ENTRY_SIZE 32 int parse_addressbook_header(unsigned char ** p, struct addressbook_header * h); Index: addressbook.c =================================================================== RCS file: /cvsroot/replaypc/replaypc/addressbook.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** addressbook.c 17 Jun 2002 00:22:41 -0000 1.3 --- addressbook.c 3 Nov 2002 12:15:40 -0000 1.4 *************** *** 35,42 **** unsigned char * p = *pp; ! memcpy(e->name, p, 22); p += 21; e->serial_number = (u64)rtv_to_u16(&p) << 32; e->serial_number |= rtv_to_u32(&p); ! e->unused1 = *p++; e->flags = rtv_to_u32(&p); --- 35,42 ---- unsigned char * p = *pp; ! rtv_to_buf(&p, e->name); e->serial_number = (u64)rtv_to_u16(&p) << 32; e->serial_number |= rtv_to_u32(&p); ! e->unused1 = rtv_to_u8(&p); e->flags = rtv_to_u32(&p); --- dump-programset.h DELETED --- |