1 #ifndef R_CACHE_H 2 #define R_CACHE_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 typedef struct r_cache_t { 9 ut64 base; 10 ut8 *buf; 11 ut64 len; 12 } RCache; 13 14 typedef struct r_prof_t { 15 struct timeval begin; 16 double result; 17 } RProfile; 18 19 R_API RCache* r_cache_new(void); 20 R_API void r_cache_free(RCache *c); 21 R_API const ut8* r_cache_get(RCache *c, ut64 addr, int *len); 22 R_API int r_cache_set(RCache *c, ut64 addr, const ut8 *buf, int len); 23 R_API void r_cache_flush(RCache *c); 24 R_API void r_prof_start(RProfile *p); 25 R_API double r_prof_end(RProfile *p); 26 27 #ifdef __cplusplus 28 } 29 #endif 30 #endif // R_CACHE_H 31