From c198c8314aa3641537c3e870fa0e8e0a201bfec9 Mon Sep 17 00:00:00 2001 From: "Narasimhaiah Suprathik (RBEI/ECF3)" Date: Mon, 7 Dec 2020 16:27:57 +0530 Subject: lib: Add MaxFileSize handling Signed-Off By: Saya Sugiura --- include/dlt/dlt_types.h | 1 + include/dlt/dlt_user.h.in | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/dlt/dlt_types.h b/include/dlt/dlt_types.h index 2880c89..6dd92d2 100644 --- a/include/dlt/dlt_types.h +++ b/include/dlt/dlt_types.h @@ -83,6 +83,7 @@ typedef unsigned int speed_t; */ typedef enum { + DLT_RETURN_FILESZERR = -8, DLT_RETURN_LOGGING_DISABLED = -7, DLT_RETURN_USER_BUFFER_FULL = -6, DLT_RETURN_WRONG_PARAMETER = -5, diff --git a/include/dlt/dlt_user.h.in b/include/dlt/dlt_user.h.in index b4d508d..30eb234 100644 --- a/include/dlt/dlt_user.h.in +++ b/include/dlt/dlt_user.h.in @@ -211,6 +211,7 @@ typedef struct pthread_t dlt_segmented_nwt_handle; /**< thread handle of segmented sending */ #endif int8_t dlt_is_file; /**< Target of logging: 1 to file, 0 to daemon */ + unsigned int filesize_max; /**< Maximum size of existing file in case dlt_is_file=1 */ dlt_ll_ts_type *dlt_ll_ts; /** [MAX_DLT_LL_TS_ENTRIES]; < Internal management struct for all * contexts */ @@ -820,6 +821,14 @@ DltReturnValue dlt_init(); */ DltReturnValue dlt_init_file(const char *name); +/** + * Set maximum file size if lib is configured to write only to file. + * This function has to be called after dlt_init_file(). + * @param filesize maximum file size + * @return Value from DltReturnValue enum + */ +DltReturnValue dlt_set_filesize_max(unsigned int filesize); + /** * Terminate the user lib. * This function has to be called when finishing using the DLT user lib. -- cgit v1.2.1