1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
22 //------------------------------------------------------------------------
24 //------------------------------------------------------------------------
30 Catalog(Object *catDict);
36 GBool isOk() { return ok; }
38 // Get number of pages.
39 int getNumPages() { return numPages; }
42 Page *getPage(int i) { return pages[i-1]; }
44 // Get the reference for a page object.
45 Ref *getPageRef(int i) { return &pageRefs[i-1]; }
47 // Return base URI, or NULL if none.
48 GString *getBaseURI() { return baseURI; }
50 // Find a page, given its object ID. Returns page number, or 0 if
52 int findPage(int num, int gen);
54 // Find a named destination. Returns the link destination, or
55 // NULL if <name> is not a destination.
56 LinkDest *findDest(GString *name);
60 Page **pages; // array of pages
61 Ref *pageRefs; // object ID for each page
62 int numPages; // number of pages
63 int pagesSize; // size of pages array
64 Object dests; // named destination dictionary
65 Object nameTree; // name tree
66 GString *baseURI; // base URI for URI-type links
67 GBool ok; // true if catalog is valid
69 int readPageTree(Dict *pages, PageAttrs *attrs, int start);
70 Object *findDestInTree(Object *tree, GString *name, Object *obj);