Crinit -- Configurable Rootfs Init
rtimopmap.h File Reference

(2023-08-02, commit: 9434b31)

Header defining the runtime commands available through the notification/service interface. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  crinitRtimOpMap_t
 

Macros

#define CRINIT_RTIMCMD_ARGDELIM   '\n'
 Delimiting character between arguments of a response or command message. More...
 
#define crinitGenOpMap(f)
 
#define crinitGenOpEnum(x)   CRINIT_RTIMCMD_C_##x, CRINIT_RTIMCMD_R_##x,
 
#define crinitGenOpStruct(x)   {CRINIT_RTIMCMD_C_##x, "C_" #x}, {CRINIT_RTIMCMD_R_##x, "R_" #x},
 

Typedefs

typedef enum crinitRtimOp_t crinitRtimOp_t
 
typedef struct crinitRtimOpMap_t crinitRtimOpMap_t
 

Enumerations

enum  crinitRtimOp_t { crinitGenOpMap =(crinitGenOpEnum) }
 

Functions

int crinitRtimOpGetByOpStr (crinitRtimOp_t *out, const char *opStr)
 
int crinitOpStrGetByRtimOp (const char **out, crinitRtimOp_t opCode)
 
void crinitRtimOpMapDebugPrintAll (void)
 

Variables

const crinitRtimOpMap_t crinitRtimOps []
 

Detailed Description

Header defining the runtime commands available through the notification/service interface.

Macro Definition Documentation

◆ CRINIT_RTIMCMD_ARGDELIM

#define CRINIT_RTIMCMD_ARGDELIM   '\n'

Delimiting character between arguments of a response or command message.

◆ crinitGenOpEnum

#define crinitGenOpEnum (   x)    CRINIT_RTIMCMD_C_##x, CRINIT_RTIMCMD_R_##x,

Macro to generate the opcode enum for crinitGenOpMap().

Each command gets a command (C_) and a result/response (R_) opcode.

◆ crinitGenOpMap

#define crinitGenOpMap (   f)
Value:
f(ADDTASK) f(ADDSERIES) f(ENABLE) f(DISABLE) f(STOP) f(KILL) f(RESTART) f(NOTIFY) f(STATUS) f(TASKLIST) \
f(SHUTDOWN) f(GETVER)

Macro to generate a mapping array for the specified commands.

◆ crinitGenOpStruct

#define crinitGenOpStruct (   x)    {CRINIT_RTIMCMD_C_##x, "C_" #x}, {CRINIT_RTIMCMD_R_##x, "R_" #x},

Macro to generate the opcode-to-string mapping for crinitGenOpMap().

Typedef Documentation

◆ crinitRtimOp_t

Enum of the available opcodes, including commands and results/responses.

◆ crinitRtimOpMap_t

Structure holding a single mapping between opcode and string representation.

Enumeration Type Documentation

◆ crinitRtimOp_t

Enum of the available opcodes, including commands and results/responses.

Enumerator
crinitGenOpMap 

Function Documentation

◆ crinitOpStrGetByRtimOp()

int crinitOpStrGetByRtimOp ( const char **  out,
crinitRtimOp_t  opCode 
)

Given an crinitRtimOp_t opcode, obtain its string representation.

The returned point points to static memory that shall not be changed.

Parameters
outReturn pointer for the string representation.
opCodeThe opcode.
Returns
0 on success, -1 otherwise

◆ crinitRtimOpGetByOpStr()

int crinitRtimOpGetByOpStr ( crinitRtimOp_t out,
const char *  opStr 
)

Given its string representation, find the correct opcode.

Parameters
outReturn pointer for the opcode.
opStrThe string representaiton.
Returns
0 on success, -1 otherwise

◆ crinitRtimOpMapDebugPrintAll()

void crinitRtimOpMapDebugPrintAll ( void  )

List available opcodes.

Will print the full list of available opcodes in their string representation and the corresponding numerical opcode. Output will only be generated if global option DEBUG is true as it uses crinitDbgInfoPrint().

Variable Documentation

◆ crinitRtimOps

const crinitRtimOpMap_t crinitRtimOps[]
extern

The string/opcode map for all opcodes, initialized in rtimopmap.c.