gwenhywfar 5.10.1
Functions
genericbuilder.c File Reference
#include "gwenbuild/builders/genericbuilder_p.h"
#include "gwenbuild/types/builder_be.h"
#include "gwenbuild/parser/parser.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/memory.h>
#include <gwenhywfar/text.h>
#include <string.h>
Include dependency graph for genericbuilder.c:

Go to the source code of this file.

Functions

static int _addBuildCmd (GWB_BUILDER *builder, GWB_BUILD_CONTEXT *bctx)
 
static void _addBuildCommands (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd)
 
static void _addCommands (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd, const char *groupName, GWB_BUILD_SUBCMD_LIST *cmdList)
 
static void _addMatchingFiles (GWB_BUILDER *builder, GWB_FILE_LIST2 *filesList, const char *pattern, int addAbs, GWEN_BUFFER *argsBuffer)
 
static void _addPrepareCommands (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd)
 
static void _addSourceFile (GWB_BUILDER *builder, GWB_FILE *f)
 
static void _addStringListToBuffer (GWEN_STRINGLIST *sl, GWEN_BUFFER *argsBuffer)
 
void GWENHYWFAR_CB _freeData (GWEN_UNUSED void *bp, void *p)
 
static void GWENHYWFAR_CB _freeData (void *bp, void *p)
 
static int _isAcceptableInput (GWB_BUILDER *builder, const GWB_FILE *file)
 
int _isAcceptableInput (GWEN_UNUSED GWB_BUILDER *builder, const GWB_FILE *f)
 
static GWB_FILE_parseOutFile (GWB_BUILDER *builder, GWB_PROJECT *project, GWB_TARGET *target, GWEN_XMLNODE *nFile, const char *folder)
 
static GWEN_BUFFER_readArgs (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd, GWEN_XMLNODE *xmlNode)
 
static void _readArgsDefines (GWB_BUILDER *builder, GWEN_BUFFER *argsBuffer)
 
static void _readArgsFixed (GWB_BUILDER *builder, GWEN_XMLNODE *xmlNode, GWEN_BUFFER *argsBuffer)
 
static void _readArgsHaveConfigH (GWB_BUILDER *builder, GWEN_BUFFER *argsBuffer)
 
static void _readArgsIfHasLibraries (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd, GWEN_XMLNODE *xmlNode, GWEN_BUFFER *argsBuffer)
 
static void _readArgsIfHasUsedSubTargets (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd, GWEN_XMLNODE *xmlNode, GWEN_BUFFER *argsBuffer)
 
static void _readArgsIncludes (GWB_BUILDER *builder, GWEN_XMLNODE *xmlNode, GWEN_BUFFER *argsBuffer)
 
static void _readArgsInputFiles (GWB_BUILDER *builder, GWEN_XMLNODE *xmlNode, GWEN_BUFFER *argsBuffer)
 
static void _readArgsLibraries (GWB_BUILDER *builder, GWEN_BUFFER *argsBuffer)
 
static void _readArgsLoop (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd, GWEN_XMLNODE *nArgs, GWEN_BUFFER *argsBuffer)
 
static void _readArgsOutputFiles (GWB_BUILDER *builder, GWEN_XMLNODE *xmlNode, GWEN_BUFFER *argsBuffer)
 
static void _readArgsUsedSubTargets (GWB_BUILDER *builder, GWEN_BUFFER *argsBuffer)
 
static void _readBuildMessage (GWB_BUILDER *builder, GWB_BUILD_SUBCMD *cmd, GWEN_XMLNODE *xmlNode)
 
static void _readDepFile (GWB_BUILDER *builder, GWB_BUILD_SUBCMD *cmd, GWEN_XMLNODE *xmlNode)
 
static GWEN_BUFFER_readMainFilename (GWB_CONTEXT *context, GWEN_XMLNODE *xmlFile, GWB_FILE_LIST2 *filesList)
 
static void _readMainSettingsFromXml (GWB_BUILDER *builder)
 
static GWB_BUILD_SUBCMD_readSubCmd (GWB_BUILDER *builder, GWB_BUILD_CMD *bcmd, GWEN_XMLNODE *n)
 
static GWEN_BUFFER_readXmlDataIntoBufferAndExpand (GWEN_DB_NODE *db, GWEN_XMLNODE *xmlNode)
 
void _setToolName (GWB_BUILDER *builder, const char *s)
 
static void _setupAfterAddingFirstInputFile (GWB_BUILDER *builder)
 
static void _setupOutFiles (GWB_BUILDER *builder)
 
static void _setupTargetLinkSpec (GWB_BUILDER *builder)
 
static void _setupVariables (GWB_BUILDER *builder)
 
GWB_BUILDERGWB_GenericBuilder_Factory (GWENBUILD *gwenbuild, GWB_CONTEXT *context, const char *builderName)
 
GWB_BUILDERGWB_GenericBuilder_new (GWENBUILD *gwenbuild, GWB_CONTEXT *context, GWEN_XMLNODE *xmlDescr)
 
 GWEN_INHERIT (GWB_BUILDER, GWB_BUILDER_GENERIC)
 

Function Documentation

◆ _addBuildCmd()

int _addBuildCmd ( GWB_BUILDER builder,
GWB_BUILD_CONTEXT bctx 
)
static

◆ _addBuildCommands()

void _addBuildCommands ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd 
)
static

Definition at line 473 of file genericbuilder.c.

References _addCommands(), and GWB_BuildCmd_GetBuildCommandList().

Referenced by _addBuildCmd().

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

◆ _addCommands()

void _addCommands ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd,
const char *  groupName,
GWB_BUILD_SUBCMD_LIST *  cmdList 
)
static

◆ _addMatchingFiles()

void _addMatchingFiles ( GWB_BUILDER builder,
GWB_FILE_LIST2 *  filesList,
const char *  pattern,
int  addAbs,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 912 of file genericbuilder.c.

References GWB_Builder_AddAbsFileNameToBuffer(), GWB_Builder_AddFileNameToBuffer(), GWB_Builder_GetContext(), GWB_File_GetName(), GWEN_Buffer_AppendString(), GWEN_Buffer_GetUsedBytes(), GWEN_Text_ComparePattern(), and NULL.

Referenced by _readArgsInputFiles(), and _readArgsOutputFiles().

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

◆ _addPrepareCommands()

void _addPrepareCommands ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd 
)
static

Definition at line 480 of file genericbuilder.c.

References _addCommands(), and GWB_BuildCmd_GetPrepareCommandList().

Referenced by _addBuildCmd().

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

◆ _addSourceFile()

void _addSourceFile ( GWB_BUILDER builder,
GWB_FILE f 
)
static

Definition at line 239 of file genericbuilder.c.

References _setupAfterAddingFirstInputFile(), GWB_Builder_AddInputFile(), and GWB_Builder_GetOutputFileList2().

Referenced by GWB_GenericBuilder_new().

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

◆ _addStringListToBuffer()

void _addStringListToBuffer ( GWEN_STRINGLIST sl,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 950 of file genericbuilder.c.

References GWEN_Buffer_AppendString(), GWEN_Buffer_GetUsedBytes(), GWEN_StringList_FirstEntry(), GWEN_StringListEntry_Data(), and GWEN_StringListEntry_Next().

Referenced by _readArgsLibraries(), and _readArgsUsedSubTargets().

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

◆ _freeData() [1/2]

void GWENHYWFAR_CB _freeData ( GWEN_UNUSED void *  bp,
void *  p 
)

Definition at line 164 of file genericbuilder.c.

References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, and GWEN_XMLNode_free().

Here is the call graph for this function:

◆ _freeData() [2/2]

static void GWENHYWFAR_CB _freeData ( void *  bp,
void *  p 
)
static

Referenced by GWB_GenericBuilder_new().

Here is the caller graph for this function:

◆ _isAcceptableInput() [1/2]

static int _isAcceptableInput ( GWB_BUILDER builder,
const GWB_FILE file 
)
static

Referenced by GWB_GenericBuilder_new().

Here is the caller graph for this function:

◆ _isAcceptableInput() [2/2]

int _isAcceptableInput ( GWEN_UNUSED GWB_BUILDER builder,
const GWB_FILE f 
)

Definition at line 424 of file genericbuilder.c.

References GWB_File_GetExt(), GWB_File_GetFileType(), GWEN_INHERIT_GETDATA, and GWEN_StringList_HasString().

Here is the call graph for this function:

◆ _parseOutFile()

GWB_FILE * _parseOutFile ( GWB_BUILDER builder,
GWB_PROJECT project,
GWB_TARGET target,
GWEN_XMLNODE nFile,
const char *  folder 
)
static

◆ _readArgs()

GWEN_BUFFER * _readArgs ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd,
GWEN_XMLNODE xmlNode 
)
static

Definition at line 649 of file genericbuilder.c.

References _readArgsLoop(), GWEN_Buffer_free(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_new(), GWEN_XMLNode_FindFirstTag(), and NULL.

Referenced by _readSubCmd().

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

◆ _readArgsDefines()

void _readArgsDefines ( GWB_BUILDER builder,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 882 of file genericbuilder.c.

References GWB_Builder_GetContext(), GWB_Context_GetDefineList(), and GWB_KeyValuePair_List_WriteAllPairsToBuffer().

Referenced by _readArgsLoop().

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

◆ _readArgsFixed()

void _readArgsFixed ( GWB_BUILDER builder,
GWEN_XMLNODE xmlNode,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 713 of file genericbuilder.c.

References _readXmlDataIntoBufferAndExpand(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), and GWEN_INHERIT_GETDATA.

Referenced by _readArgsLoop().

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

◆ _readArgsHaveConfigH()

void _readArgsHaveConfigH ( GWB_BUILDER builder,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 895 of file genericbuilder.c.

References GWB_Builder_GetContext(), GWB_Context_GetCurrentTarget(), GWB_PROJECT_FLAGS_CONFIG_H, GWB_Project_GetFlags(), GWB_Target_GetProject(), and GWEN_Buffer_AppendString().

Referenced by _readArgsLoop().

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

◆ _readArgsIfHasLibraries()

void _readArgsIfHasLibraries ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd,
GWEN_XMLNODE xmlNode,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 849 of file genericbuilder.c.

References _readArgsLoop(), GWB_Builder_GetContext(), GWB_Context_GetCurrentTarget(), GWB_Target_GetUsedLibraryNameList(), and GWEN_StringList_Count().

Referenced by _readArgsLoop().

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

◆ _readArgsIfHasUsedSubTargets()

void _readArgsIfHasUsedSubTargets ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd,
GWEN_XMLNODE xmlNode,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 834 of file genericbuilder.c.

References _readArgsLoop(), GWB_Builder_GetContext(), GWB_Context_GetCurrentTarget(), GWB_Target_GetUsedTargetLinkSpecList(), and GWEN_StringList_Count().

Referenced by _readArgsLoop().

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

◆ _readArgsIncludes()

void _readArgsIncludes ( GWB_BUILDER builder,
GWEN_XMLNODE xmlNode,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 864 of file genericbuilder.c.

References GWB_Builder_GetContext(), GWB_Context_GetIncludeList(), GWB_KeyValuePair_List_SampleValuesByKey(), GWEN_Buffer_AppendString(), GWEN_XMLNode_GetProperty(), and NULL.

Referenced by _readArgsLoop().

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

◆ _readArgsInputFiles()

void _readArgsInputFiles ( GWB_BUILDER builder,
GWEN_XMLNODE xmlNode,
GWEN_BUFFER argsBuffer 
)
static

◆ _readArgsLibraries()

void _readArgsLibraries ( GWB_BUILDER builder,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 810 of file genericbuilder.c.

References _addStringListToBuffer(), GWB_Builder_GetContext(), GWB_Context_GetCurrentTarget(), and GWB_Target_GetUsedLibraryNameList().

Referenced by _readArgsLoop().

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

◆ _readArgsLoop()

void _readArgsLoop ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd,
GWEN_XMLNODE nArgs,
GWEN_BUFFER argsBuffer 
)
static

◆ _readArgsOutputFiles()

void _readArgsOutputFiles ( GWB_BUILDER builder,
GWEN_XMLNODE xmlNode,
GWEN_BUFFER argsBuffer 
)
static

◆ _readArgsUsedSubTargets()

void _readArgsUsedSubTargets ( GWB_BUILDER builder,
GWEN_BUFFER argsBuffer 
)
static

Definition at line 822 of file genericbuilder.c.

References _addStringListToBuffer(), GWB_Builder_GetContext(), GWB_Context_GetCurrentTarget(), and GWB_Target_GetUsedTargetLinkSpecList().

Referenced by _readArgsLoop().

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

◆ _readBuildMessage()

void _readBuildMessage ( GWB_BUILDER builder,
GWB_BUILD_SUBCMD cmd,
GWEN_XMLNODE xmlNode 
)
static

Definition at line 567 of file genericbuilder.c.

References _readXmlDataIntoBufferAndExpand(), GWB_BuildSubCmd_SetBuildMessage(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_INHERIT_GETDATA, GWEN_XMLNode_FindFirstTag(), and NULL.

Referenced by _readSubCmd().

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

◆ _readDepFile()

void _readDepFile ( GWB_BUILDER builder,
GWB_BUILD_SUBCMD cmd,
GWEN_XMLNODE xmlNode 
)
static

Definition at line 588 of file genericbuilder.c.

References _readMainFilename(), GWB_Builder_GetContext(), GWB_Builder_GetOutputFileList2(), GWB_BuildSubCmd_SetDepFilePath(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_XMLNode_FindFirstTag(), and NULL.

Referenced by _readSubCmd().

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

◆ _readMainFilename()

GWEN_BUFFER * _readMainFilename ( GWB_CONTEXT context,
GWEN_XMLNODE xmlFile,
GWB_FILE_LIST2 *  filesList 
)
static

◆ _readMainSettingsFromXml()

void _readMainSettingsFromXml ( GWB_BUILDER builder)
static

Definition at line 179 of file genericbuilder.c.

References GWB_Builder_GetContext(), GWB_Context_GetVars(), GWB_Parser_ReadXmlDataIntoStringList(), GWEN_INHERIT_GETDATA, GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_GetIntProperty(), and NULL.

Referenced by GWB_GenericBuilder_new().

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

◆ _readSubCmd()

GWB_BUILD_SUBCMD * _readSubCmd ( GWB_BUILDER builder,
GWB_BUILD_CMD bcmd,
GWEN_XMLNODE n 
)
static

◆ _readXmlDataIntoBufferAndExpand()

GWEN_BUFFER * _readXmlDataIntoBufferAndExpand ( GWEN_DB_NODE db,
GWEN_XMLNODE xmlNode 
)
static

Definition at line 394 of file genericbuilder.c.

References DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_new(), GWEN_DB_ReplaceVars(), GWEN_XMLNode_GetData(), GWEN_XMLNode_GetFirstData(), and NULL.

Referenced by _parseOutFile(), _readArgsFixed(), _readBuildMessage(), and _setupTargetLinkSpec().

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

◆ _setToolName()

void _setToolName ( GWB_BUILDER builder,
const char *  s 
)

Definition at line 228 of file genericbuilder.c.

References GWEN_INHERIT_GETDATA, and NULL.

◆ _setupAfterAddingFirstInputFile()

void _setupAfterAddingFirstInputFile ( GWB_BUILDER builder)
static

Definition at line 253 of file genericbuilder.c.

References _setupOutFiles(), _setupTargetLinkSpec(), GWB_Builder_GetInputFileList2(), GWB_File_GetName(), GWEN_DB_FLAGS_DEFAULT, GWEN_DB_SetCharValue(), GWEN_INHERIT_GETDATA, and GWEN_Text_strndup().

Referenced by _addSourceFile().

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

◆ _setupOutFiles()

void _setupOutFiles ( GWB_BUILDER builder)
static

◆ _setupTargetLinkSpec()

void _setupTargetLinkSpec ( GWB_BUILDER builder)
static

Definition at line 373 of file genericbuilder.c.

References _readXmlDataIntoBufferAndExpand(), GWB_Builder_SetTargetLinkSpec(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_INHERIT_GETDATA, GWEN_XMLNode_FindFirstTag(), and NULL.

Referenced by _setupAfterAddingFirstInputFile().

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

◆ _setupVariables()

void _setupVariables ( GWB_BUILDER builder)
static

Definition at line 207 of file genericbuilder.c.

References GWB_Builder_GetContext(), GWB_Context_GetCurrentRelativeDir(), GWB_Context_GetVars(), GWEN_DB_AddGroupChildren(), GWEN_DB_FLAGS_DEFAULT, GWEN_DB_SetCharValue(), and GWEN_INHERIT_GETDATA.

Referenced by GWB_GenericBuilder_new().

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

◆ GWB_GenericBuilder_Factory()

GWB_BUILDER * GWB_GenericBuilder_Factory ( GWENBUILD gwenbuild,
GWB_CONTEXT context,
const char *  builderName 
)

◆ GWB_GenericBuilder_new()

GWB_BUILDER * GWB_GenericBuilder_new ( GWENBUILD gwenbuild,
GWB_CONTEXT context,
GWEN_XMLNODE xmlDescr 
)

◆ GWEN_INHERIT()

GWEN_INHERIT ( GWB_BUILDER  ,
GWB_BUILDER_GENERIC   
)