hpatch_lite_input_cache.h 808 B

12345678910111213141516171819202122232425262728293031
  1. //hpatch_lite_input_cache.h
  2. //
  3. /*
  4. The MIT License (MIT)
  5. Copyright (c) 2020-2022 HouSisong All Rights Reserved.
  6. */
  7. #ifndef _hpatch_lite_input_cache_h
  8. #define _hpatch_lite_input_cache_h
  9. #include "hpatch_lite_types.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. typedef struct _hpi_TInputCache{
  14. hpi_size_t cache_begin;
  15. hpi_size_t cache_end;
  16. hpi_byte* cache_buf;
  17. hpi_TInputStreamHandle inputStream;
  18. hpi_TInputStream_read read_code;
  19. } _hpi_TInputCache;
  20. static hpi_force_inline
  21. hpi_BOOL _hpi_cache_success_finish(const _hpi_TInputCache* self){ return (self->cache_end!=0); }
  22. hpi_fast_uint8 _hpi_cache_read_1byte(struct _hpi_TInputCache* self);
  23. hpi_BOOL _hpi_cache_update(struct _hpi_TInputCache* self);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif //_hpatch_lite_input_cache_h