excel.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. +----------------------------------------------------------------------+
  3. | XlsWriter Extension |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 2017-2018 The Viest |
  6. +----------------------------------------------------------------------+
  7. | http://www.viest.me |
  8. +----------------------------------------------------------------------+
  9. | Author: viest <[email protected]> |
  10. +----------------------------------------------------------------------+
  11. */
  12. #ifndef VTIFUL_XLS_H
  13. #define VTIFUL_XLS_H
  14. #define V_XLS_HANDLE "handle"
  15. #define V_XLS_FIL "fileName"
  16. #define V_XLS_COF "config"
  17. #define V_XLS_PAT "path"
  18. #define V_XLS_CONST_READ_TYPE_INT "TYPE_INT"
  19. #define V_XLS_CONST_READ_TYPE_DOUBLE "TYPE_DOUBLE"
  20. #define V_XLS_CONST_READ_TYPE_STRING "TYPE_STRING"
  21. #define V_XLS_CONST_READ_TYPE_DATETIME "TYPE_TIMESTAMP"
  22. #define READ_TYPE_EMPTY 0x00
  23. #define READ_TYPE_STRING 0x01
  24. #define READ_TYPE_INT 0x02
  25. #define READ_TYPE_DOUBLE 0x04
  26. #define READ_TYPE_DATETIME 0x08
  27. #define GET_CONFIG_PATH(dir_path_res, class_name, object) \
  28. do { \
  29. zval rv; \
  30. zval *_config = zend_read_property(class_name, object, ZEND_STRL(V_XLS_COF), 0, &rv); \
  31. (dir_path_res) = zend_hash_str_find(Z_ARRVAL_P(_config), ZEND_STRL(V_XLS_PAT)); \
  32. } while(0)
  33. extern zend_class_entry *vtiful_xls_ce;
  34. VTIFUL_STARTUP_FUNCTION(excel);
  35. #endif