PlatformInit

Offers platform specific initialization function platform_t.init_platform.

Summary
PlatformInitOffers platform specific initialization function platform_t.init_platform.
CopyrightThis program is free software.
Files
C-kern/api/platform/init.hHeader file PlatformInit.
C-kern/platform/Linux/init.cImplementation file PlatformInit Linux.
Types
mainthread_fSignature of main thread is the same as function main.
Functions
test
unittest_platform_initTest <init_platform> functionality.
platform_tDummy type which represents the operating system platform.
lifetime
init_platformInitialize system context and calls main_thread.

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

© 2013 Jörg Seebohn

Files

C-kern/api/platform/init.h

Header file PlatformInit.

C-kern/platform/Linux/init.c

Implementation file PlatformInit Linux.

Types

mainthread_f

typedef int (*mainthread_f) (void * user)

Signature of main thread is the same as function main.

Functions

Summary
test
unittest_platform_initTest <init_platform> functionality.

test

unittest_platform_init

int unittest_platform_init(void)

Test <init_platform> functionality.

platform_t

struct platform_t

Dummy type which represents the operating system platform.

Summary
lifetime
init_platformInitialize system context and calls main_thread.

lifetime

init_platform

int init_platform(mainthread_f main_thread,
void *user)

Initialize system context and calls main_thread.  If the system context could be initialized and the main_thread was called the return value is the value returned from main_thread.  If an error occurs during initialization only an error code (value > 0) is returned, main_thread is not called.

You have to call this function before calling maincontext_t.init_maincontext.

This function is implemented in a system specific way.

int init_platform(mainthread_f main_thread,
void *user)
Initialize system context and calls main_thread.
Offers platform specific initialization function platform_t.init_platform.
Implements PlatformInit in a Linux specific way.
typedef int (*mainthread_f) (void * user)
Signature of main thread is the same as function main.
int unittest_platform_init(void)
Test init_platform functionality.
struct platform_t
Dummy type which represents the operating system platform.
int init_maincontext(const maincontext_e context_type,
int argc,
const char **argv)
Initializes global program context.
Close