| verzia 1.21, 2003/02/11 20:10:30 |
verzia 1.22, 2003/02/18 19:29:03 |
| Riadok 190 void *get_object(int num, int *type) |
|
| Riadok 190 void *get_object(int num, int *type) |
|
| void *ret = NULL; |
void *ret = NULL; |
| char *dict; |
char *dict; |
| struct object *obj; |
struct object *obj; |
| if(!num || num > obj_count) |
if (!num || num > obj_count) |
| abort(); |
abort(); |
| obj = (struct object *) *(objects + num - 1); |
obj = (struct object *) *(objects + num - 1); |
| if (obj->parsed) { |
if (obj->parsed) { |
| Riadok 261 long get_startxref(void) |
|
| Riadok 261 long get_startxref(void) |
|
| int i; |
int i; |
| fstat(fp->_fileno, &fpstat); |
fstat(fp->_fileno, &fpstat); |
| fseek(fp, fpstat.st_size - XREFLINE, SEEK_SET); |
fseek(fp, fpstat.st_size - XREFLINE, SEEK_SET); |
| fread(&startxref[0],XREFLINE,sizeof(char),fp); |
fread(&startxref[0], XREFLINE, sizeof(char), fp); |
| for(i = 0;!isdigit(startxref[i]);i++); |
for (i = 0; !isdigit(startxref[i]); i++); |
| return strtoul(&startxref[i], NULL, 10); |
return strtoul(&startxref[i], NULL, 10); |
| } |
} |
| |
|
| Riadok 284 void probe_ptree(int num) |
|
| Riadok 284 void probe_ptree(int num) |
|
| pages->kids++; |
pages->kids++; |
| continue; |
continue; |
| } else { |
} else { |
| for(num = pages->count;num;num--) { |
for (num = pages->count; num; num--) { |
| page_tree[current_page] = atoi(*pages->kids); |
page_tree[current_page] = |
| current_page++; |
atoi(*pages->kids); |
| free(pages->kids[0]); |
current_page++; |
| free(pages->kids[1]); |
free(pages->kids[0]); |
| free(pages->kids[2]); |
free(pages->kids[1]); |
| pages->kids += 3; |
free(pages->kids[2]); |
| |
pages->kids += 3; |
| } |
} |
| free(pages->old_kids); |
free(pages->old_kids); |
| if (!pages->parent) |
if (!pages->parent) |
| Riadok 299 void probe_ptree(int num) |
|
| Riadok 300 void probe_ptree(int num) |
|
| (struct pages *) get_object(pages-> |
(struct pages *) get_object(pages-> |
| parent, |
parent, |
| NULL); |
NULL); |
| } |
} |
| } |
} |
| free(pages->kids[0]); |
free(pages->kids[0]); |
| free(pages->kids[1]); |
free(pages->kids[1]); |
| Riadok 434 struct pages *fill_pages(char *dictionar |
|
| Riadok 435 struct pages *fill_pages(char *dictionar |
|
| struct page *fill_page(char *dictionary) |
struct page *fill_page(char *dictionary) |
| { |
{ |
| struct page *page; |
struct page *page; |
| char *p, **mediabox; |
char *p; |
| int ref; |
int ref; |
| page = (struct page *) xcalloc(sizeof(struct page), 1); |
page = (struct page *) xcalloc(sizeof(struct page), 1); |
| p = strstr(dictionary, "Contents"); |
p = strstr(dictionary, "Contents"); |
| Riadok 465 struct page *fill_page(char *dictionary) |
|
| Riadok 466 struct page *fill_page(char *dictionary) |
|
| /* error */ |
/* error */ |
| return NULL; |
return NULL; |
| } |
} |
| mediabox = array(&p[9]); |
/* mediabox = array(&p[9]); |
| page->mediabox[0] = (short) strtoul(mediabox[1], NULL, 10); |
page->mediabox[0] = (short) strtoul(mediabox[1], NULL, 10); |
| free(mediabox[1]); |
free(mediabox[1]); |
| page->mediabox[1] = (short) strtoul(mediabox[2], NULL, 10); |
page->mediabox[1] = (short) strtoul(mediabox[2], NULL, 10); |
| Riadok 474 struct page *fill_page(char *dictionary) |
|
| Riadok 475 struct page *fill_page(char *dictionary) |
|
| free(mediabox[3]); |
free(mediabox[3]); |
| page->mediabox[3] = (short) strtoul(mediabox[4], NULL, 10); |
page->mediabox[3] = (short) strtoul(mediabox[4], NULL, 10); |
| free(mediabox[4]); |
free(mediabox[4]); |
| free(mediabox); |
free(mediabox);*/ |
| |
sscanf(p, "MediaBox [%hd %hd %hd %hd]", &page->mediabox[0], |
| |
&page->mediabox[1], &page->mediabox[2], &page->mediabox[3]); |
| p = strstr(dictionary, "Parent"); |
p = strstr(dictionary, "Parent"); |
| if (!p) { |
if (!p) { |
| /* error */ |
/* error */ |