/[public]/psiconv/trunk/lib/psiconv/parse_image.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/parse_image.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 64 Revision 71
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/ 18*/
19 19
20#include "config.h" 20#include "config.h"
21#include "compat.h"
22
21#include <stdlib.h> 23#include <stdlib.h>
22 24
23#include "data.h"
24#include "parse_routines.h" 25#include "parse_routines.h"
26#include "error.h"
25 27
26int psiconv_parse_jumptable_section(const psiconv_buffer buf,int lev, 28int psiconv_parse_jumptable_section(const psiconv_buffer buf,int lev,
27 psiconv_u32 off, int *length, 29 psiconv_u32 off, int *length,
28 psiconv_jumptable_section *result) 30 psiconv_jumptable_section *result)
29{ 31{
36 if (!((*result) = psiconv_list_new(sizeof(psiconv_u32)))) 38 if (!((*result) = psiconv_list_new(sizeof(psiconv_u32))))
37 goto ERROR1; 39 goto ERROR1;
38 40
39 psiconv_progress(lev+2,off+len,"Going to read the list length"); 41 psiconv_progress(lev+2,off+len,"Going to read the list length");
40 listlen = psiconv_read_u32(buf,lev+2,off+len,&res); 42 listlen = psiconv_read_u32(buf,lev+2,off+len,&res);
41 if (!res) 43 if (res)
42 goto ERROR2; 44 goto ERROR2;
43 psiconv_debug(lev+2,off+len,"List length: %08x",listlen); 45 psiconv_debug(lev+2,off+len,"List length: %08x",listlen);
44 len += 4; 46 len += 4;
45 47
46 psiconv_progress(lev+2,off+len,"Going to read the list"); 48 psiconv_progress(lev+2,off+len,"Going to read the list");
47 for (i = 0; i < listlen; i++) { 49 for (i = 0; i < listlen; i++) {
48 temp = psiconv_read_u32(buf,lev+2,off+len,&res); 50 temp = psiconv_read_u32(buf,lev+2,off+len,&res);
49 if (!res) 51 if (res)
50 goto ERROR2; 52 goto ERROR2;
51 if ((res = psiconv_list_add(*result,&temp))) 53 if ((res = psiconv_list_add(*result,&temp)))
52 goto ERROR2; 54 goto ERROR2;
53 psiconv_debug(lev+3,off+len,"Offset: %08x",temp); 55 psiconv_debug(lev+3,off+len,"Offset: %08x",temp);
54 len += 4; 56 len += 4;

Legend:
Removed from v.64  
changed lines
  Added in v.71

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26