diff options
| author | 2024-10-08 02:41:52 +0200 | |
|---|---|---|
| committer | 2024-10-08 02:41:52 +0200 | |
| commit | 881102944edf36abc98539b10d13e2375fda88cf (patch) | |
| tree | aaf421f57561c795de3d3f60960ebbe007d2c1f5 /3rd_party/libsrp6a-sha512/cstr.h | |
| parent | ed9703db1ee6d54e3801b618cee9524563d709e1 (diff) | |
| download | libimobiledevice-881102944edf36abc98539b10d13e2375fda88cf.tar.gz libimobiledevice-881102944edf36abc98539b10d13e2375fda88cf.tar.bz2 | |
3rd_party/libsrp6a: Remove unnecessary allocator code and just use malloc/free
Diffstat (limited to '3rd_party/libsrp6a-sha512/cstr.h')
| -rw-r--r-- | 3rd_party/libsrp6a-sha512/cstr.h | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/3rd_party/libsrp6a-sha512/cstr.h b/3rd_party/libsrp6a-sha512/cstr.h index 7cc019a..ae7d71a 100644 --- a/3rd_party/libsrp6a-sha512/cstr.h +++ b/3rd_party/libsrp6a-sha512/cstr.h | |||
| @@ -51,27 +51,15 @@ | |||
| 51 | extern "C" { | 51 | extern "C" { |
| 52 | #endif /* __cplusplus */ | 52 | #endif /* __cplusplus */ |
| 53 | 53 | ||
| 54 | /* Arguments to allocator methods ordered this way for compatibility */ | ||
| 55 | typedef struct cstr_alloc_st { | ||
| 56 | void * (_CDECL * alloc)(size_t n, void * heap); | ||
| 57 | void (_CDECL * free)(void * p, void * heap); | ||
| 58 | void * heap; | ||
| 59 | } cstr_allocator; | ||
| 60 | |||
| 61 | typedef struct cstr_st { | 54 | typedef struct cstr_st { |
| 62 | char * data; /* Okay to access data and length fields directly */ | 55 | char * data; /* Okay to access data and length fields directly */ |
| 63 | int length; | 56 | int length; |
| 64 | int cap; | 57 | int cap; |
| 65 | int ref; /* Simple reference counter */ | 58 | int ref; /* Simple reference counter */ |
| 66 | cstr_allocator * allocator; | ||
| 67 | } cstr; | 59 | } cstr; |
| 68 | 60 | ||
| 69 | _TYPE( void ) cstr_set_allocator P((cstr_allocator * alloc)); | ||
| 70 | |||
| 71 | _TYPE( cstr * ) cstr_new P((void)); | 61 | _TYPE( cstr * ) cstr_new P((void)); |
| 72 | _TYPE( cstr * ) cstr_new_alloc P((cstr_allocator * alloc)); | ||
| 73 | _TYPE( cstr * ) cstr_dup P((const cstr * str)); | 62 | _TYPE( cstr * ) cstr_dup P((const cstr * str)); |
| 74 | _TYPE( cstr * ) cstr_dup_alloc P((const cstr * str, cstr_allocator * alloc)); | ||
| 75 | _TYPE( cstr * ) cstr_create P((const char * s)); | 63 | _TYPE( cstr * ) cstr_create P((const char * s)); |
| 76 | _TYPE( cstr * ) cstr_createn P((const char * s, int len)); | 64 | _TYPE( cstr * ) cstr_createn P((const char * s, int len)); |
| 77 | 65 | ||
