gwenhywfar 5.14.1
c_setup.c File Reference
#include "c_setup.h"
#include "utils.h"
#include "gwenbuild/parser/parser.h"
#include "gwenbuild/buildctx/buildctx_xml.h"
#include "gwenbuild/filenames.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/directory.h>
#include <gwenhywfar/text.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
Include dependency graph for c_setup.c:

Go to the source code of this file.

Functions

static void _copyEnvironmentVariableToDb (GWEN_DB_NODE *db, const char *envName, const char *dbVarName)
static void _copySomeEnvironmentVariablesToDb (GWEN_DB_NODE *db)
static void _determineTarget (GWB_CONTEXT *context, GWEN_DB_NODE *dbArgs)
static int _determineTools (GWB_CONTEXT *context, GWEN_DB_NODE *dbArgs)
static int _getAllToolPaths (GWEN_DB_NODE *dbVars, const char *sCompileTarget, const GWEN_STRINGLIST *sl)
static int _getToolPath (GWEN_DB_NODE *dbVars, const char *sTarget, const GWEN_STRINGLIST *sl, const char *sCommand, const char *sEnvVar, const char *sVarName)
static int _prepareContextForSetup (GWB_CONTEXT *firstContext, GWEN_DB_NODE *dbArgs)
static GWB_KEYVALUEPAIR_LIST * _readOptionsFromDb (GWEN_DB_NODE *db)
static int _writeStaticLibHelper (const char *fileName)
int GWB_RepeatLastSetup (const char *fileName)
int GWB_Setup (GWEN_DB_NODE *dbArgs)

Function Documentation

◆ _copyEnvironmentVariableToDb()

void _copyEnvironmentVariableToDb ( GWEN_DB_NODE * db,
const char * envName,
const char * dbVarName )
static

Definition at line 377 of file c_setup.c.

References GWEN_DB_FLAGS_OVERWRITE_VARS, and GWEN_DB_SetCharValue().

Referenced by _copySomeEnvironmentVariablesToDb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _copySomeEnvironmentVariablesToDb()

void _copySomeEnvironmentVariablesToDb ( GWEN_DB_NODE * db)
static

Definition at line 364 of file c_setup.c.

References _copyEnvironmentVariableToDb().

Referenced by _prepareContextForSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _determineTarget()

◆ _determineTools()

int _determineTools ( GWB_CONTEXT * context,
GWEN_DB_NODE * dbArgs )
static

Definition at line 244 of file c_setup.c.

References _getAllToolPaths(), DBG_INFO, GWB_Context_GetVars(), GWBUILD_GetPathFromEnvironment(), GWEN_DB_GetCharValue(), GWEN_StringList_AppendString(), GWEN_StringList_free(), GWEN_StringList_new(), and NULL.

Referenced by _prepareContextForSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getAllToolPaths()

int _getAllToolPaths ( GWEN_DB_NODE * dbVars,
const char * sCompileTarget,
const GWEN_STRINGLIST * sl )
static

Definition at line 275 of file c_setup.c.

References _getToolPath(), DBG_INFO, DBG_WARN, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), and NULL.

Referenced by _determineTools().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getToolPath()

int _getToolPath ( GWEN_DB_NODE * dbVars,
const char * sTarget,
const GWEN_STRINGLIST * sl,
const char * sCommand,
const char * sEnvVar,
const char * sVarName )
static

Definition at line 326 of file c_setup.c.

References DBG_ERROR, GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), GWEN_Directory_FindFileInPaths(), and NULL.

Referenced by _getAllToolPaths().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _prepareContextForSetup()

int _prepareContextForSetup ( GWB_CONTEXT * firstContext,
GWEN_DB_NODE * dbArgs )
static

Definition at line 186 of file c_setup.c.

References _copySomeEnvironmentVariablesToDb(), _determineTarget(), _determineTools(), DBG_INFO, GWB_Context_GetVars(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), and NULL.

Referenced by GWB_Setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readOptionsFromDb()

GWB_KEYVALUEPAIR_LIST * _readOptionsFromDb ( GWEN_DB_NODE * db)
static

Definition at line 388 of file c_setup.c.

References GWB_KeyValuePair_new(), GWEN_DB_GetCharValue(), GWEN_StringList_free(), GWEN_StringList_fromString2(), GWEN_StringList_StringAt(), GWEN_TEXT_FLAGS_CHECK_BACKSLASH, GWEN_TEXT_FLAGS_DEL_QUOTES, and NULL.

Referenced by GWB_Setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _writeStaticLibHelper()

int _writeStaticLibHelper ( const char * fileName)
static

Definition at line 429 of file c_setup.c.

References DBG_ERROR, GWEN_ERROR_GENERIC, GWEN_SyncIo_Helper_WriteFile(), and NULL.

Referenced by GWB_Setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWB_RepeatLastSetup()

int GWB_RepeatLastSetup ( const char * fileName)

Definition at line 159 of file c_setup.c.

References DBG_ERROR, DBG_INFO, GWB_Setup(), GWEN_DB_FLAGS_DEFAULT, GWEN_DB_Group_free(), GWEN_DB_Group_new(), GWEN_DB_ReadFile(), and NULL.

Referenced by GWB_Build(), GWB_Prepare(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWB_Setup()