FreeBASIC  0.91.0
init.c File Reference
#include "fb.h"
#include <locale.h>
Include dependency graph for init.c:

Go to the source code of this file.

Functions

void fb_hRtInit (void)
 
void fb_hRtExit (void)
 
FBCALL void fb_Init (int argc, char **argv, int lang)
 
FBCALL void fb_End (int errlevel)
 

Variables

FB_RTLIB_CTX __fb_ctx
 
static int __fb_is_inicnt = 0
 

Function Documentation

FBCALL void fb_End ( int  errlevel)

Definition at line 81 of file init.c.

Here is the caller graph for this function:

void fb_hRtExit ( void  )

Definition at line 45 of file init.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void fb_hRtInit ( void  )

With the default "C" locale (which is just plain 7-bit ASCII), our mbstowcs() calls (from fb_wstr_ConvFromA()) fail to convert zstrings specific to the user's locale to Unicode wstrings.

To fix this we must tell the CRT to use the user's locale setting, i.e. the locale given by LC_* or LANG environment variables.

We should change the LC_CTYPE setting only, to affect the behaviour of the codepage <-> Unicode conversion functions, but not for example LC_NUMERIC, which would affect things like the decimal separator used by float <-> string conversion functions.

Definition at line 10 of file init.c.

Here is the call graph for this function:

Here is the caller graph for this function:

FBCALL void fb_Init ( int  argc,
char **  argv,
int  lang 
)

Definition at line 73 of file init.c.

Variable Documentation

FB_RTLIB_CTX __fb_ctx

Definition at line 6 of file init.c.

int __fb_is_inicnt = 0
static

Definition at line 7 of file init.c.