theKernel 10.0
Loading...
Searching...
No Matches
MkLogFileC_TOR_C_API

MkLogFileC - various functions to 'create and delete' a MkLogFileSMore...

+ Collaboration diagram for MkLogFileC_TOR_C_API:

Functions

enum MkErrorE libmkkernel::MkLogFileOpen_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const file, MK_LFL *lfh_out)
 open the log-file in append mode …
 
void libmkkernel::MkLogFileClose_RT (MK_RT mkrt, MK_LFL lfh)
 Destructor - delete a MkLogFileC instance …
 

MkLogFileC - MkLogFileC_TOR_C_API - overload

#define MkLogFileOpen_NULL(...)
 
#define MkLogFileOpen(...)
 
#define MkLogFileOpen_2(file, lfh_out)
 
#define MkLogFileOpen_E(...)
 
#define MkLogFileOpen_C(...)
 
#define MkLogFileOpen_e(...)
 
#define MkLogFileClose(x)
 

Detailed Description

MkLogFileC - various functions to 'create and delete' a MkLogFileS

Macro Definition Documentation

◆ MkLogFileClose

#define MkLogFileClose ( x)
Value:
MkObjectDeleteToNull(MkLogFileClose_RT,MK,x)
#define MkObjectDeleteToNull(fct, NS, x)

Definition at line 1477 of file kernel_overload_mk.h.

◆ MkLogFileOpen

#define MkLogFileOpen ( ...)
Value:
MkLogFileOpen_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 1470 of file kernel_overload_mk.h.

◆ MkLogFileOpen_2

#define MkLogFileOpen_2 ( file,
lfh_out )
Value:
MkLogFileOpen(NULL,file,lfh_out)
#define MkLogFileOpen(...)

Definition at line 1471 of file kernel_overload_mk.h.

◆ MkLogFileOpen_C

#define MkLogFileOpen_C ( ...)
Value:
if (MkErrorCheckI(MkLogFileOpen(__VA_ARGS__)))
#define MkErrorCheckI(err)

Definition at line 1473 of file kernel_overload_mk.h.

◆ MkLogFileOpen_E

#define MkLogFileOpen_E ( ...)
Value:
#define MkErrorCheck(err)
check return-code and goto error on error …

Definition at line 1472 of file kernel_overload_mk.h.

◆ MkLogFileOpen_e

#define MkLogFileOpen_e ( ...)
Value:
MK_EMBEDDED(MK_LFL,MkLogFileOpen,__VA_ARGS__)
#define MK_EMBEDDED(type, call,...)
macro to create "embedded" (*_e) Version of C-API call's

Definition at line 1474 of file kernel_overload_mk.h.

◆ MkLogFileOpen_NULL

#define MkLogFileOpen_NULL ( ...)
Value:
MkLogFileOpen_RT(MK_RT_CALL_NULL __VA_ARGS__)
#define MK_RT_CALL_NULL

Definition at line 1469 of file kernel_overload_mk.h.

Function Documentation

◆ MkLogFileClose_RT()

void libmkkernel::MkLogFileClose_RT ( MK_RT mkrt,
MK_LFL lfh )

Destructor - delete a MkLogFileC instance …

There are two different ways to delete an instance:

ObjectDisposeto free the internal data but keep the outher shell alive - this is called a SOFT-DELETE
ObjectDelete to delete the outher shell including the internal data - this is called a HARD-DELETE
Attention
  1. The internal memory will be freed and the object-pointer will be set to NULL. If the object-pointer is already NULL nothing will be done.
  2. For a programming language without HARD-Delete support, the "Delete" method is assigned to a SOFT-Delete.
  3. For a programming language without garbage collection, a SOFT-delete without a HARD-delete causes a small memory loss (C++: ~32 bytes).
  4. After a SOFT-delete, the outher shell is still alive, but cannot be used. Any access to this shell generates an HDL-null-exception, but this exception can be caught. This is important for C++ as it prevents a core dump.
  5. On HARD-delete read more at MkSelfDeleteForce
See also
LogFileOpen

◆ MkLogFileOpen_RT()

enum MkErrorE libmkkernel::MkLogFileOpen_RT ( MK_RT mkrt,
MK_OBJN fmtobj,
MK_STRN const file,
MK_LFL * lfh_out )

open the log-file in append mode …

The new instance belongs to the caller and may have to be released if necessary. A manual release using LogFileClose is always possible, but the instance can no longer be used afterwards.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]filethe filename to open
[out]lfh_outreturns
Returns
The newly created MkLogFileC instance, the instance is owned by the caller
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
Attention
on error the lfh_out is set to MK_NULL