README 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Directory tree:
  2. Makefile Builds and runs tests.
  3. include/ Public API.
  4. src/ Scripts, C implementation and internal headers.
  5. build/ Generated object files, executables etc.
  6. test/ Test files.
  7. generated/ Files generated by tests.
  8. Suggested setup for testing:
  9. Checkout ghostpdl and mupdf into the same directory.
  10. Inside ghostpdl:
  11. ln -s ../mupdf/thirdparty/extract extract
  12. Then either:
  13. Inside ghostpdl:
  14. ./autogen.sh --with-extract-dir=extract
  15. make -j 8 debug DEBUGDIRPREFIX=debug-extract-
  16. Inside mupdf:
  17. make -j 8 debug
  18. or:
  19. make test-rebuild-dependent-binaries (for the first time)
  20. make test-build-dependent-binaries (for incremental builds)
  21. Then build and run tests from inside mupdf/thirdparty/extract
  22. as below.
  23. Build and run tests with:
  24. make
  25. Conventions:
  26. Errors:
  27. Functions return zero on success or -1 with errno set.
  28. Identifier/symbol names:
  29. All identifiers that can be seen by client code (generally things
  30. defined in include/) start with 'extract_'.
  31. Similarly global symbols in generated .o files all start with
  32. 'extract_'; this is tested by target 'test-obj'.
  33. Other identifiers and symbols do not have an 'extract_' prefix - not
  34. necessary because client code cannot see these names.
  35. Header names in include/ start with 'extract_'.
  36. Allocation:
  37. Functions that free a data structure generally take a double pointer
  38. so that they can set the pointer to NULL before returning, which helps
  39. avoid stray invalid non-NULL pointers. E.g.:
  40. extract_span_free(extract_alloc_t* alloc, span_t** pspan);
  41. /* Frees a span_t, returning with *pspan set to NULL. */
  42. This double-pointer approach is also used for raw allocation - see
  43. include/extract_alloc.h.
  44. Lists:
  45. Lists of data items are generally implemented using an array of
  46. pointers and an int 'foo_num' entry, e.g.:
  47. line_t** lines;
  48. int lines_num;