wiki_render.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _WIKI_RENDERED_H
  2. #define _WIKI_RENDERED_H
  3. #include <mysql/mysql.h>
  4. #define MAX_TITLE_LEN 512
  5. #define MAX_SQL_STR 2048
  6. #define MAX_TEXT_BUF 5*1024*1024
  7. #define MAX_RENDERED 10*1024*1024
  8. #define MAX_TITLE_SEARCH 64
  9. #define MAX_DAT_FILES 20
  10. #define MAX_ARTICLES_PER_DAT 250000
  11. #define RESULT_SET_LIMIT 200
  12. #define TABLE_CELL_WIDTH (LCD_BUF_WIDTH_PIXELS / 4)
  13. typedef struct _ARTICLE_PTR {
  14. long offset_dat; /* offset to pedia?.dat for the article content */
  15. long offset_fnd; /* offset to pedia.fnd for the title (for search) */
  16. long file_id_compressed_len; /* byte 0: bit0~1 - compress method (00 - lzo, 01 - bzlib, 10 - 7z), bit 2~7 pedia file id */
  17. /* byte 1~3: compressed article length */
  18. } ARTICLE_PTR;
  19. typedef struct _TITLE_SEARCH { /* used to mask the porinter to the remainder of the title for search */
  20. long idxArticle;
  21. char cZero; /* null character for backward search */
  22. char sTitleSearch[MAX_TITLE_SEARCH]; /* null terminated title for search (with bigram encoded) */
  23. } TITLE_SEARCH;
  24. void render_article_node(int idxNode);
  25. void process_pass_1(MYSQL *conn, char *sFileName, int msgLevel, long titlesToProcess,
  26. off64_t file_offset_for_pass_1, long max_article_idx);
  27. void process_pass_2(MYSQL *conn, MYSQL *conn2, char *sFileName, int msgLevel, long titlesToProcess, int batch,
  28. long idxStart, long idxEnd);
  29. void process_pass_3(MYSQL *conn, MYSQL *conn2, int bSplitted);
  30. void memrcpy(void *dest, void *src, int len); // memory copy starting from the last byte
  31. void replace_ampersand_char(char *);
  32. void pad_backslash(char *s, int size);
  33. void generate_pedia_hsh(void);
  34. extern void showMsg(int currentLevel, char *format, ...);
  35. extern int msgLevel(void);
  36. #endif /* _WIKI_RENDERED_H */