code.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef __CODE__
  2. #define __CODE__
  3. #include <stdbool.h>
  4. #include <hoedown/document.h>
  5. #include <hoedown/buffer.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /*************
  10. * CONSTANTS *
  11. *************/
  12. typedef enum hoedown_code_language_flags {
  13. HOEDOWN_CODE_SHOW_COMPLEMENT = (1 << 0),
  14. HOEDOWN_CODE_SHOW_GENERIC = (1 << 1),
  15. HOEDOWN_CODE_SHOW_ALL = (1 << 2)
  16. } hoedown_code_language_flags;
  17. /*********
  18. * TYPES *
  19. *********/
  20. struct hoedown_code_renderer_state {
  21. void *opaque;
  22. hoedown_code_language_flags language_flags;
  23. char** languages;
  24. };
  25. typedef struct hoedown_code_renderer_state hoedown_code_renderer_state;
  26. /*************
  27. * FUNCTIONS *
  28. *************/
  29. /* hoedown_code_renderer_new: allocates a regular CODE renderer */
  30. hoedown_renderer *hoedown_code_renderer_new(char* langs, bool complement)
  31. __attribute__ ((malloc));
  32. /* hoedown_code_renderer_free: deallocate an CODE renderer */
  33. void hoedown_code_renderer_free(hoedown_renderer * renderer);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /** __CODE__ **/