APLogIO.h 765 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // aplog_io.h
  3. // APLog
  4. //
  5. // Created by myy on 17/1/17.
  6. // Copyright © 2017年 Alipay. All rights reserved.
  7. //
  8. #ifndef aplog_io_h
  9. #define aplog_io_h
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. typedef struct _APLogIO
  16. {
  17. int isMmap;
  18. int (*fileOpen )(void* thiz, const char* szLogName, const char* szMmapName, int isFg, int mode);
  19. int (*fileWrite)(void* thiz, const void* buf, size_t len);
  20. int (*fileFlush)(void* thiz);
  21. void (*fileClose)(void* thiz);
  22. void (*fileHandleFgBgState)(void* thiz, int isFg);
  23. }APLogIO;
  24. APLogIO* APLogIOCreate(int isMmap);
  25. void APLogIOFree(APLogIO* thiz);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif