tcllcconfig 9.0
Loading...
Searching...
No Matches
Functions
LcConfig_Enum_TCL_API

tcllcconfig enum definitions … More...

+ Collaboration diagram for LcConfig_Enum_TCL_API:

Functions

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigFormatE_FromInt (OtClass_ARGS)
  Tcl: (static) LcConfigFormatE [LcConfig ConfigFormatE_FromInt value:int32] C-API
return the LcConfigFormatE from integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigOptionsEF_FromInt (OtClass_ARGS)
  Tcl: (static) LcConfigOptionsEF [LcConfig ConfigOptionsEF_FromInt value:int32] C-API
return the LcConfigOptionsEF from integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigTypeE_FromInt (OtClass_ARGS)
  Tcl: (static) LcConfigTypeE [LcConfig ConfigTypeE_FromInt value:int32] C-API
return the LcConfigTypeE from integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ErrorE_FromInt (OtClass_ARGS)
  Tcl: (static) LcErrorE [LcConfig ErrorE_FromInt value:int32] C-API
return the LcErrorE from integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ErrorTypeE_FromInt (OtClass_ARGS)
  Tcl: (static) LcErrorTypeE [LcConfig ErrorTypeE_FromInt value:int32] C-API
return the LcErrorTypeE from integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigFormatE_ToInt (OtClass_ARGS)
  Tcl: (static) int32 [LcConfig ConfigFormatE_ToInt value:LcConfigFormatE] C-API
return the LcConfigFormatE as integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigFormatE_ToString (OtClass_ARGS)
  Tcl: (static) string [LcConfig ConfigFormatE_ToString value:LcConfigFormatE] C-API
return the LcConfigFormatE as string …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigOptionsEF_ToInt (OtClass_ARGS)
  Tcl: (static) int32 [LcConfig ConfigOptionsEF_ToInt value:LcConfigOptionsEF] C-API
return the LcConfigOptionsEF as integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigOptionsEF_ToString (OtClass_ARGS)
  Tcl: (static) string [LcConfig ConfigOptionsEF_ToString value:LcConfigOptionsEF] C-API
BEGIN-LcConfigOptionsEF - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change.
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigTypeE_ToInt (OtClass_ARGS)
  Tcl: (static) int32 [LcConfig ConfigTypeE_ToInt value:LcConfigTypeE] C-API
return the LcConfigTypeE as integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ConfigTypeE_ToString (OtClass_ARGS)
  Tcl: (static) string [LcConfig ConfigTypeE_ToString value:LcConfigTypeE] C-API
return the LcConfigTypeE as string …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ErrorE_ToInt (OtClass_ARGS)
  Tcl: (static) int32 [LcConfig ErrorE_ToInt value:LcErrorE] C-API
return the LcErrorE as integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ErrorE_ToString (OtClass_ARGS)
  Tcl: (static) string [LcConfig ErrorE_ToString value:LcErrorE] C-API
return the LcErrorE as string …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ErrorTypeE_ToInt (OtClass_ARGS)
  Tcl: (static) int32 [LcConfig ErrorTypeE_ToInt value:LcErrorTypeE] C-API
return the LcErrorTypeE as integer …
 
static OT_ProcRet tcl_lcconfig_LcConfig_ErrorTypeE_ToString (OtClass_ARGS)
  Tcl: (static) string [LcConfig ErrorTypeE_ToString value:LcErrorTypeE] C-API
return the LcErrorTypeE as string …
 

Detailed Description

tcllcconfig enum definitions …

C-API: Internal - Enum definition - tcllcconfig enum definition …

Tcl has no build-in-enum-datatyp but MkKernel support a enum using the data-type-checking API.

A C-enum like :

};
LcConfigFormatE
set the format of a LcSettingC …
#define CONFIG_FORMAT_DEFAULT
#define CONFIG_FORMAT_HEX

will be compiled into a internal tcl-c-check-proc :

int LC(Get_LcConfigFormatE_FromObj) (MK_RT_ARGS Tcl_Interp *interp, Tcl_Obj *enumE, enum LcConfigFormatE *ret) {
const static struct LookupEnumE keys[] = {
{ "HEX" , CONFIG_FORMAT_HEX },
{ "DEFAULT" , CONFIG_FORMAT_DEFAULT },
{ "FORMAT_HEX" , CONFIG_FORMAT_HEX },
{ "FORMAT_DEFAULT" , CONFIG_FORMAT_DEFAULT },
{ "CONFIG_FORMAT_HEX" , CONFIG_FORMAT_HEX },
{ "CONFIG_FORMAT_DEFAULT" , CONFIG_FORMAT_DEFAULT },
{ NULL , 0 },
};
int index;
LngErrorCheck (Tcl_GetIndexFromObjStruct (interp, enumE, &keys,
sizeof(struct LookupClassS), "enum", TCL_EXACT, &index));
*ret = keys[index].val;
return TCL_OK;
#define MK_RT_ARGS
}

to return the integer identifier for an enum-definition-string or an error if string is not valid.

A valid string for an enum-value is any unique abbreviation of the original enum-value:

The tcl-c-check-proc is used in a tcl-c-api-wrapper like :

static OT_ProcRet NS(LcConfigC_SetDefaultFormat) (LcConfigC_ARGS) {
OT_SETUP_ONEARG(SetDefaultFormat_doc)
LcConfigFormatE format = 0;
OT_CHECK_REQUIRED(OT_CHECK_ENUM (LcConfigFormatE,format)) // << tcl-c-check-proc
OT_CHECK_NOARGS
if (hdl->nat == NULL) OT_ERROR_HDL_NAT_NULL(hdl);
config_set_default_format (hdl->nat, format);
OT_retObj_SET_None
goto end;
error:
OT_retObj_SET_Error
end:
OT_retObj_RETURN
}
#define OT_SETUP_hdl
#define SetDefaultFormat_doc
#define config_set_default_format(C, F)

The usage of an enum-value in the tcl-code is quite simple, just use the string.

package require tclmsgque::LcConfig
namespace import tclmsgque::LcConfig::*
# create the configuration object
LcConfigC create cfg
# use CONFIG_FORMAT_HEX :
# If a non-default format has not been set for a setting with SettingSetFormat, this configuration-wide
# default format will be used instead when that setting is written to a file or stream.
cfg SetDefaultFormat FORMAT_HEX

A enum in the Programming-Language-Micro-Kernel is a enum-data-type and 3 enum-access-attributes

  1. ENUM_ToString → return the string-value from the enum-value
  2. ENUM_ToInt → return the integer-value from the enum-value
  3. ENUM_FromInt → create an enum-value from an integer-value.

The enum-data-type and the 3 enum-access-attributes are defined in all target-languages (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO).

Function Documentation

◆ tcl_lcconfig_LcConfig_ConfigFormatE_FromInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigFormatE_FromInt ( OtClass_ARGS  )
static

◆ tcl_lcconfig_LcConfig_ConfigFormatE_ToInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigFormatE_ToInt ( OtClass_ARGS  )
static

◆ tcl_lcconfig_LcConfig_ConfigFormatE_ToString()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigFormatE_ToString ( OtClass_ARGS  )
static

◆ tcl_lcconfig_LcConfig_ConfigOptionsEF_FromInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigOptionsEF_FromInt ( OtClass_ARGS  )
static

◆ tcl_lcconfig_LcConfig_ConfigOptionsEF_ToInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigOptionsEF_ToInt ( OtClass_ARGS  )
static

◆ tcl_lcconfig_LcConfig_ConfigOptionsEF_ToString()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigOptionsEF_ToString ( OtClass_ARGS  )
static

Tcl: (static) string [LcConfig ConfigOptionsEF_ToString value:LcConfigOptionsEF] C-API
BEGIN-LcConfigOptionsEF - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change.

Definition at line 638 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ConfigTypeE_FromInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigTypeE_FromInt ( OtClass_ARGS  )
static

Tcl: (static) LcConfigTypeE [LcConfig ConfigTypeE_FromInt value:int32] C-API
return the LcConfigTypeE from integer …

Definition at line 539 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ConfigTypeE_ToInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigTypeE_ToInt ( OtClass_ARGS  )
static

Tcl: (static) int32 [LcConfig ConfigTypeE_ToInt value:LcConfigTypeE] C-API
return the LcConfigTypeE as integer …

Definition at line 653 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ConfigTypeE_ToString()

static OT_ProcRet tcl_lcconfig_LcConfig_ConfigTypeE_ToString ( OtClass_ARGS  )
static

◆ tcl_lcconfig_LcConfig_ErrorE_FromInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ErrorE_FromInt ( OtClass_ARGS  )
static

Tcl: (static) LcErrorE [LcConfig ErrorE_FromInt value:int32] C-API
return the LcErrorE from integer …

Definition at line 556 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ErrorE_ToInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ErrorE_ToInt ( OtClass_ARGS  )
static

Tcl: (static) int32 [LcConfig ErrorE_ToInt value:LcErrorE] C-API
return the LcErrorE as integer …

Definition at line 683 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ErrorE_ToString()

static OT_ProcRet tcl_lcconfig_LcConfig_ErrorE_ToString ( OtClass_ARGS  )
static

Tcl: (static) string [LcConfig ErrorE_ToString value:LcErrorE] C-API
return the LcErrorE as string …

Definition at line 698 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ErrorTypeE_FromInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ErrorTypeE_FromInt ( OtClass_ARGS  )
static

Tcl: (static) LcErrorTypeE [LcConfig ErrorTypeE_FromInt value:int32] C-API
return the LcErrorTypeE from integer …

Definition at line 573 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ErrorTypeE_ToInt()

static OT_ProcRet tcl_lcconfig_LcConfig_ErrorTypeE_ToInt ( OtClass_ARGS  )
static

Tcl: (static) int32 [LcConfig ErrorTypeE_ToInt value:LcErrorTypeE] C-API
return the LcErrorTypeE as integer …

Definition at line 713 of file LibLcConfig_tcl.c.

◆ tcl_lcconfig_LcConfig_ErrorTypeE_ToString()

static OT_ProcRet tcl_lcconfig_LcConfig_ErrorTypeE_ToString ( OtClass_ARGS  )
static

Tcl: (static) string [LcConfig ErrorTypeE_ToString value:LcErrorTypeE] C-API
return the LcErrorTypeE as string …

Definition at line 728 of file LibLcConfig_tcl.c.