MainContext impl

Implementation file of global init anf free functions.

Summary
MainContext implImplementation file of global init anf free functions.
CopyrightThis program is free software.
Files
C-kern/api/maincontext.hHeader file of MainContext.
C-kern/context/maincontext.cImplementation file MainContext impl.
maincontext_t
constants
maincontext_STATICSIZEDefines size for s_maincontext_staticmem.
maincontext_STATICTESTSIZEDefines additonal size for s_maincontext_staticmem.
global variables
g_maincontextReserve space for the global main context.
static variables
s_maincontext_staticmemStatic memory block used in in global maincontext_t.
s_maincontext_errtimerSimulates an error in maincontext_t.init_maincontext.
helper
initprogname_maincontextSets *progname to (strrchr(argv0, “/”)+1).
lifetime
static-memory
test

Copyright

This program is free software.  You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Author

© 2012 Jörg Seebohn

Files

C-kern/api/maincontext.h

Header file of MainContext.

C-kern/context/maincontext.c

Implementation file MainContext impl.

maincontext_t

Summary
constants
maincontext_STATICSIZEDefines size for s_maincontext_staticmem.
maincontext_STATICTESTSIZEDefines additonal size for s_maincontext_staticmem.
global variables
g_maincontextReserve space for the global main context.
static variables
s_maincontext_staticmemStatic memory block used in in global maincontext_t.
s_maincontext_errtimerSimulates an error in maincontext_t.init_maincontext.
helper
initprogname_maincontextSets *progname to (strrchr(argv0, “/”)+1).
lifetime
static-memory
test

constants

maincontext_STATICSIZE

#define maincontext_STATICSIZE processcontext_STATICSIZE

Defines size for s_maincontext_staticmem.  This extrasize is needed during unit tests.  This value is a copy of <processcontext_STATICSIZE>.

maincontext_STATICTESTSIZE

#define maincontext_STATICTESTSIZE (maincontext_STATICSIZE)

Defines additonal size for s_maincontext_staticmem.  This extrasize is needed during unit test time.

global variables

g_maincontext

maincontext_t g_maincontext

Reserve space for the global main context.

static variables

s_maincontext_staticmem

static uint8_t s_maincontext_staticmem[maincontext_STATICSIZE + maincontext_STATICTESTSIZE]

Static memory block used in in global maincontext_t.

s_maincontext_errtimer

static test_errortimer_t s_maincontext_errtimer

Simulates an error in maincontext_t.init_maincontext.

helper

initprogname_maincontext

static void initprogname_maincontext(const char **progname,
const char *argv0)

Sets *progname to (strrchr(argv0, “/”)+1).

lifetime

static-memory

test

Defines service context used by every software component in C-kern(el).
Implementation file of global init anf free functions.
#define maincontext_STATICSIZE processcontext_STATICSIZE
Defines size for s_maincontext_staticmem.
static uint8_t s_maincontext_staticmem[maincontext_STATICSIZE + maincontext_STATICTESTSIZE]
Static memory block used in in global maincontext_t.
#define maincontext_STATICTESTSIZE (maincontext_STATICSIZE)
Defines additonal size for s_maincontext_staticmem.
maincontext_t g_maincontext
Reserve space for the global main context.
static test_errortimer_t s_maincontext_errtimer
Simulates an error in maincontext_t.init_maincontext.
int init_maincontext(const maincontext_e context_type,
int argc,
const char **argv)
Initializes global program context.
static void initprogname_maincontext(const char **progname,
const char *argv0)
Sets *progname to (strrchr(argv0, “/”)+1).
Close