dphl.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /*
  2. * Copyright 2021
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * SPDX-License-Identifier: GPL-3.0+
  18. * License-Filename: LICENSE
  19. */
  20. /* dphl.* is about Dot Parsing Html Labels */
  21. #ifndef DPHL_H
  22. #define DPHL_H 1
  23. #undef __BEGIN_DECLS
  24. #undef __END_DECLS
  25. #ifdef __cplusplus
  26. # define __BEGIN_DECLS extern "C" {
  27. # define __END_DECLS }
  28. #else
  29. # define __BEGIN_DECLS /* empty */
  30. # define __END_DECLS /* empty */
  31. #endif
  32. /* html.l */
  33. extern int hllineno;
  34. __BEGIN_DECLS
  35. /* parse html label of one node */
  36. extern int htmlparse (struct dpnode *node);
  37. /* unknown attribute */
  38. extern void dphl_attr_huh (char *tag, char *attr, char *value);
  39. /* check data before/after <table> */
  40. extern void dphl_tabledata(char *str);
  41. /* html.l init */
  42. extern void html_lex_init (int debug, char *str, int line);
  43. /* html.l de-init */
  44. extern void html_lex_deinit (void);
  45. /* html.l lex token */
  46. extern int html_lex (void);
  47. /* reset <table> */
  48. extern void dphl_rtable (void);
  49. /* end <table> */
  50. extern void dphl_etable (void);
  51. /* reset <td> */
  52. extern void dphl_rtd (void);
  53. /* end <td> */
  54. extern void dphl_etd (int code);
  55. /* reset <br> */
  56. extern void dphl_rbr (void);
  57. /* end <br> */
  58. extern void dphl_ebr (void);
  59. /* reset <i> */
  60. extern void dphl_ri (void);
  61. /* end </i> */
  62. extern void dphl_ei (void);
  63. /* reset <b> */
  64. extern void dphl_rb (void);
  65. /* end </b> */
  66. extern void dphl_eb (void);
  67. /* reset <u> */
  68. extern void dphl_ru (void);
  69. /* end </u> */
  70. extern void dphl_eu (void);
  71. /* reset <o> */
  72. extern void dphl_ro (void);
  73. /* end </o> */
  74. extern void dphl_eo (void);
  75. /* reset <sub> */
  76. extern void dphl_rsub (void);
  77. /* end </sub> */
  78. extern void dphl_esub (void);
  79. /* reset <sup> */
  80. extern void dphl_rsup (void);
  81. /* end </sup> */
  82. extern void dphl_esup (void);
  83. /* reset <s> */
  84. extern void dphl_rs (void);
  85. /* end </s> */
  86. extern void dphl_es (void);
  87. /* reset <tr> */
  88. extern void dphl_rtr (void);
  89. /* end </tr> */
  90. extern void dphl_etr (void);
  91. /* reset <font> */
  92. extern void dphl_rfont (void);
  93. /* end <font> */
  94. extern void dphl_efont (void);
  95. /* reset <vr/> */
  96. extern void dphl_rvr (void);
  97. /* reset <hr/> */
  98. extern void dphl_rhr (void);
  99. /* reset <img> */
  100. extern void dphl_rimg (void);
  101. /* end <img> */
  102. extern void dphl_eimg (void);
  103. /* check for error message */
  104. extern int dphl_chk_err (void);
  105. /* check align value */
  106. extern int dphl_chk_align (char *str, int mode);
  107. /* check balign value */
  108. extern int dphl_chk_balign (char *str);
  109. /* check bgcolor value */
  110. extern int dphl_chk_bgcolor (char *str, int mode);
  111. /* check border value */
  112. extern int dphl_chk_border (char *str, int mode);
  113. /* check cellborder value */
  114. extern int dphl_chk_cellborder (char *str);
  115. /* check cellpadding value */
  116. extern int dphl_chk_cellpadding (char *str, int mode);
  117. /* check cellspacing value */
  118. extern int dphl_chk_cellspacing (char *str, int mode);
  119. /* check color value */
  120. extern int dphl_chk_color (char *str, int mode);
  121. /* check columns value <table> */
  122. extern int dphl_chk_columns (char *str);
  123. /* check colspan value <td> */
  124. extern int dphl_chk_colspan (char *str);
  125. /* check face value for <font> */
  126. extern int dphl_chk_face (char *str);
  127. /* check fixedsize value */
  128. extern int dphl_chk_fixedsize (char *str, int mode);
  129. /* check gradientangle value */
  130. extern int dphl_chk_gradientangle (char *str, int mode);
  131. /* check height value */
  132. extern int dphl_chk_height (char *str, int mode);
  133. /* check href value */
  134. extern int dphl_chk_href (char *str, int mode);
  135. /* check id value */
  136. extern int dphl_chk_id (char *str, int mode);
  137. /* check port value */
  138. extern int dphl_chk_port (char *str, int mode);
  139. /* check point-size value for <font> */
  140. extern int dphl_chk_pointsize (char *str);
  141. /* check rows value <table> */
  142. extern int dphl_chk_rows (char *str);
  143. /* check rowspan value <td> */
  144. extern int dphl_chk_rowspan (char *str);
  145. /* check scale value for <img> */
  146. extern int dphl_chk_scale (char *str);
  147. /* check sides value */
  148. extern int dphl_chk_sides (char *str, int mode);
  149. /* check src value for <img> */
  150. extern int dphl_chk_src (char *str);
  151. /* check style value */
  152. extern int dphl_chk_style (char *str, int mode);
  153. /* check target value */
  154. extern int dphl_chk_target (char *str, int mode);
  155. /* check title value */
  156. extern int dphl_chk_title (char *str, int mode);
  157. /* check valign value */
  158. extern int dphl_chk_valign (char *str, int mode);
  159. /* check width value */
  160. extern int dphl_chk_width (char *str, int mode);
  161. /* gets data part */
  162. extern void dphl_data (char *str);
  163. /* free mem */
  164. extern void dphl_freemem (void);
  165. __END_DECLS
  166. #endif
  167. /* end */