X-Git-Url: https://git.saurik.com/apple/syslog.git/blobdiff_plain/8158235332f5a3f4f20cebe26bf739b481ca2df5..refs/heads/master:/libsystem_asl.tproj/include/asl_store.h diff --git a/libsystem_asl.tproj/include/asl_store.h b/libsystem_asl.tproj/include/asl_store.h index 5905877..47702ff 100644 --- a/libsystem_asl.tproj/include/asl_store.h +++ b/libsystem_asl.tproj/include/asl_store.h @@ -28,23 +28,21 @@ #include #include #include -#include "asl_file.h" +#include +#include #include +#include +#include #include -#if TARGET_IPHONE_SIMULATOR -extern const char *_path_asl_store(void); -extern const char *_path_asl_archive(void); - -#define PATH_ASL_STORE _path_asl_store() -#define PATH_ASL_ARCHIVE _path_asl_archive() -#else -#define PATH_ASL_STORE "/var/log/asl" -#define PATH_ASL_ARCHIVE "/var/log/asl.archive" -#endif +#define PATH_ASL_STORE (asl_filesystem_path(ASL_PLACE_DATABASE)) +#define PATH_ASL_ARCHIVE (asl_filesystem_path(ASL_PLACE_ARCHIVE)) #define FILE_ASL_STORE_DATA "StoreData" +#define ASL_STORE_FLAG_NO_ACLS 0x00000001 +#define ASL_STORE_FLAG_NO_TTL 0x00000002 + #define FILE_CACHE_SIZE 64 #define FILE_CACHE_TTL 300 @@ -58,8 +56,11 @@ typedef struct asl_file_t *f; } asl_cached_file_t; -typedef struct +typedef struct asl_store_s { + uint32_t asl_type; //ASL OBJECT HEADER + int32_t refcount; //ASL OBJECT HEADER + uint64_t curr; char *base_dir; FILE *storedata; uint64_t next_id; @@ -69,24 +70,34 @@ typedef struct time_t start_tomorrow; time_t last_write; size_t max_file_size; + uint32_t flags; } asl_store_t; -uint32_t asl_store_open_write(const char *basedir, asl_store_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); -uint32_t asl_store_open_read(const char *basedir, asl_store_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); -uint32_t asl_store_close(asl_store_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); -uint32_t asl_store_statistics(asl_store_t *s, aslmsg *msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +__BEGIN_DECLS + +const asl_jump_table_t *asl_store_jump_table(void); + +uint32_t asl_store_open_write(const char *basedir, asl_store_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +uint32_t asl_store_open_read(const char *basedir, asl_store_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +uint32_t asl_store_close(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +asl_store_t *asl_store_retain(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +void asl_store_release(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +uint32_t asl_store_statistics(asl_store_t *s, asl_msg_t **msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); + +uint32_t asl_store_set_flags(asl_store_t *s, uint32_t flags) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); + +uint32_t asl_store_save(asl_store_t *s, asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); -uint32_t asl_store_save(asl_store_t *s, aslmsg msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +asl_msg_list_t *asl_store_match(asl_store_t *s, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); -uint32_t asl_store_match(asl_store_t *s, aslresponse query, aslresponse *res, uint64_t *last_id, uint64_t start_id, uint32_t count, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); -uint32_t asl_store_match_timeout(asl_store_t *s, aslresponse query, aslresponse *res, uint64_t *last_id, uint64_t start_id, uint32_t count, int32_t direction, uint32_t usec) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2); +uint32_t asl_store_match_start(asl_store_t *s, uint64_t start_id, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +uint32_t asl_store_match_next(asl_store_t *s, asl_msg_list_t *query, asl_msg_list_t **res, uint32_t count) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); -uint32_t asl_store_match_start(asl_store_t *s, uint64_t start_id, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); -uint32_t asl_store_match_next(asl_store_t *s, aslresponse query, aslresponse *res, uint32_t count) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); +uint32_t asl_store_max_file_size(asl_store_t *s, size_t max) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); +uint32_t asl_store_sweep_file_cache(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(3.2,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); -uint32_t asl_store_max_file_size(asl_store_t *s, size_t max) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); -uint32_t asl_store_sweep_file_cache(asl_store_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2); +uint32_t asl_store_open_aux(asl_store_t *s, asl_msg_t *msg, int *fd, char **url) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); -uint32_t asl_store_open_aux(asl_store_t *s, aslmsg msg, int *fd, char **url) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); +__END_DECLS #endif /* __ASL_STORE_H__ */