gwenhywfar 5.14.1
file.c File Reference
#include "gwenbuild/types/file_p.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/memory.h>
#include <gwenhywfar/buffer.h>
#include <string.h>
Include dependency graph for file.c:

Go to the source code of this file.

Functions

static uint32_t _readFlagsFromChar (const char *flagsAsText)
static void _writeFileFlagsToXml (uint32_t flags, GWEN_XMLNODE *xmlNode, const char *varName)
void GWB_File_AddFileList2ToFileList2 (GWB_FILE_LIST2 *sourceList, GWB_FILE_LIST2 *destList, const char *ext)
void GWB_File_AddFlags (GWB_FILE *f, uint32_t i)
void GWB_File_AddWaitingBuildCmd (GWB_FILE *f, GWB_BUILD_CMD *bcmd)
void GWB_File_ClearWaitingBuildCmds (GWB_FILE *f)
GWB_FILEGWB_File_CopyObjectAndChangeExtension (const GWB_FILE *file, const char *newExt)
void GWB_File_DelFlags (GWB_FILE *f, uint32_t i)
GWB_FILEGWB_File_dup (const GWB_FILE *oldFile)
GWEN_STRINGLISTGWB_File_FileListToTopBuildDirStringList (const GWB_FILE_LIST2 *fileList, const char *initialSourceDir)
void GWB_File_free (GWB_FILE *f)
GWB_FILEGWB_File_fromXml (GWEN_XMLNODE *xmlNode)
GWB_BUILD_CMDGWB_File_GetBuildCmd (const GWB_FILE *f)
const char * GWB_File_GetBuilder (const GWB_FILE *f)
const char * GWB_File_GetExt (const GWB_FILE *f)
const char * GWB_File_GetFileType (const GWB_FILE *f)
uint32_t GWB_File_GetFlags (const GWB_FILE *f)
const char * GWB_File_GetFolder (const GWB_FILE *f)
uint32_t GWB_File_GetId (const GWB_FILE *f)
const char * GWB_File_GetInstallName (const GWB_FILE *f)
const char * GWB_File_GetInstallPath (const GWB_FILE *f)
const char * GWB_File_GetName (const GWB_FILE *f)
GWB_BUILD_CMD_LIST2 * GWB_File_GetWaitingBuildCmdList2 (const GWB_FILE *f)
void GWB_File_List2_FreeAll (GWB_FILE_LIST2 *fileList2)
GWB_FILEGWB_File_List2_GetAt (const GWB_FILE_LIST2 *fileList, int index)
GWB_FILEGWB_File_List2_GetFileById (const GWB_FILE_LIST2 *fileList, uint32_t id)
GWB_FILEGWB_File_List2_GetFileByPathAndName (const GWB_FILE_LIST2 *fileList, const char *folder, const char *fname)
GWB_FILEGWB_File_List2_GetOrCreateFile (GWB_FILE_LIST2 *fileList, const char *folder, const char *fname)
void GWB_File_List2_ReadXml (GWEN_XMLNODE *xmlNode, const char *groupName, GWB_FILE_LIST2 *destFileList)
void GWB_File_List2_WriteXml (const GWB_FILE_LIST2 *fileList, GWEN_XMLNODE *xmlNode, const char *groupName)
GWB_FILEGWB_File_new (const char *folder, const char *fName, uint32_t id)
void GWB_File_ReplaceExtension (GWB_FILE *file, const char *newExt)
void GWB_File_SetBuildCmd (GWB_FILE *f, GWB_BUILD_CMD *bcmd)
void GWB_File_SetBuilder (GWB_FILE *f, const char *s)
void GWB_File_SetFileType (GWB_FILE *f, const char *s)
void GWB_File_SetFlags (GWB_FILE *f, uint32_t i)
void GWB_File_SetFolder (GWB_FILE *f, const char *s)
void GWB_File_SetId (GWB_FILE *f, uint32_t i)
void GWB_File_SetInstallName (GWB_FILE *f, const char *s)
void GWB_File_SetInstallPath (GWB_FILE *f, const char *s)
void GWB_File_SetName (GWB_FILE *f, const char *s)
void GWB_File_toXml (const GWB_FILE *file, GWEN_XMLNODE *xmlNode)
void GWB_File_WriteFileNameToTopBuildDirString (const GWB_FILE *file, const char *initialSourceDir, GWEN_BUFFER *fbuf)

Function Documentation

◆ _readFlagsFromChar()

uint32_t _readFlagsFromChar ( const char * flagsAsText)
static

Definition at line 609 of file file.c.

References DBG_ERROR, GWB_FILE_FLAGS_DIST, GWB_FILE_FLAGS_GENERATED, GWB_FILE_FLAGS_INSTALL, GWEN_StringList_FirstEntry(), GWEN_StringList_free(), GWEN_StringList_fromString(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), and NULL.

Referenced by GWB_File_fromXml().

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

◆ _writeFileFlagsToXml()

void _writeFileFlagsToXml ( uint32_t flags,
GWEN_XMLNODE * xmlNode,
const char * varName )
static

Definition at line 576 of file file.c.

References GWB_FILE_FLAGS_DIST, GWB_FILE_FLAGS_GENERATED, GWB_FILE_FLAGS_INSTALL, GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_new(), and GWEN_XMLNode_SetCharValue().

Referenced by GWB_File_toXml().

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

◆ GWB_File_AddFileList2ToFileList2()

void GWB_File_AddFileList2ToFileList2 ( GWB_FILE_LIST2 * sourceList,
GWB_FILE_LIST2 * destList,
const char * ext )

Definition at line 446 of file file.c.

References GWB_File_GetExt().

Referenced by _addSourcesOrMkBuildersAndGetTheirOutputs().

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

◆ GWB_File_AddFlags()

void GWB_File_AddFlags ( GWB_FILE * f,
uint32_t i )

◆ GWB_File_AddWaitingBuildCmd()

void GWB_File_AddWaitingBuildCmd ( GWB_FILE * f,
GWB_BUILD_CMD * bcmd )

Definition at line 253 of file file.c.

References NULL.

Referenced by _setupDepsForCmd().

Here is the caller graph for this function:

◆ GWB_File_ClearWaitingBuildCmds()

void GWB_File_ClearWaitingBuildCmds ( GWB_FILE * f)

Definition at line 262 of file file.c.

Referenced by _clearDepsInFiles().

Here is the caller graph for this function:

◆ GWB_File_CopyObjectAndChangeExtension()

GWB_FILE * GWB_File_CopyObjectAndChangeExtension ( const GWB_FILE * file,
const char * newExt )

Definition at line 332 of file file.c.

References DBG_ERROR, GWB_File_dup(), GWB_File_free(), GWB_File_GetName(), GWB_File_ReplaceExtension(), and NULL.

Here is the call graph for this function:

◆ GWB_File_DelFlags()

void GWB_File_DelFlags ( GWB_FILE * f,
uint32_t i )

Definition at line 120 of file file.c.

◆ GWB_File_dup()

◆ GWB_File_FileListToTopBuildDirStringList()

GWEN_STRINGLIST * GWB_File_FileListToTopBuildDirStringList ( const GWB_FILE_LIST2 * fileList,
const char * initialSourceDir )

Definition at line 495 of file file.c.

References GWB_File_WriteFileNameToTopBuildDirString(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Buffer_Reset(), GWEN_StringList_AppendString(), GWEN_StringList_Count(), GWEN_StringList_free(), GWEN_StringList_new(), and NULL.

Referenced by _checkWaitingQueue().

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

◆ GWB_File_free()

void GWB_File_free ( GWB_FILE * f)

Definition at line 70 of file file.c.

References GWEN_FREE_OBJECT.

Referenced by GWB_File_CopyObjectAndChangeExtension(), and GWB_File_List2_FreeAll().

Here is the caller graph for this function:

◆ GWB_File_fromXml()

GWB_FILE * GWB_File_fromXml ( GWEN_XMLNODE * xmlNode)

Definition at line 549 of file file.c.

References _readFlagsFromChar(), GWB_File_new(), GWB_File_SetBuilder(), GWB_File_SetFileType(), GWB_File_SetInstallName(), GWB_File_SetInstallPath(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetIntProperty(), and NULL.

Referenced by GWB_File_List2_ReadXml().

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

◆ GWB_File_GetBuildCmd()

GWB_BUILD_CMD * GWB_File_GetBuildCmd ( const GWB_FILE * f)

Definition at line 270 of file file.c.

Referenced by _setupDepsForCmd(), GWB_BuildCtx_AddBuildCmdsForFileToList(), and GWBUILD_Debug_PrintFile().

Here is the caller graph for this function:

◆ GWB_File_GetBuilder()

const char * GWB_File_GetBuilder ( const GWB_FILE * f)

Definition at line 193 of file file.c.

Referenced by _genBuilderForSourceFile().

Here is the caller graph for this function:

◆ GWB_File_GetExt()

const char * GWB_File_GetExt ( const GWB_FILE * f)

Definition at line 184 of file file.c.

References NULL.

Referenced by _genBuilderForSourceFile(), _isAcceptableInput(), and GWB_File_AddFileList2ToFileList2().

Here is the caller graph for this function:

◆ GWB_File_GetFileType()

const char * GWB_File_GetFileType ( const GWB_FILE * f)

Definition at line 227 of file file.c.

Referenced by _isAcceptableInput(), _writeFileList2ToXml(), and GWBUILD_Debug_PrintFile().

Here is the caller graph for this function:

◆ GWB_File_GetFlags()

◆ GWB_File_GetFolder()

◆ GWB_File_GetId()

uint32_t GWB_File_GetId ( const GWB_FILE * f)

Definition at line 85 of file file.c.

Referenced by _addFilesToBuildCtx(), _writeFileList2ToXml(), _writeIdsFromFile2ListToXml(), GWB_File_List2_GetFileById(), and GWBUILD_Debug_PrintFile().

Here is the caller graph for this function:

◆ GWB_File_GetInstallName()

const char * GWB_File_GetInstallName ( const GWB_FILE * f)

Definition at line 165 of file file.c.

Referenced by _generateInstallList().

Here is the caller graph for this function:

◆ GWB_File_GetInstallPath()

const char * GWB_File_GetInstallPath ( const GWB_FILE * f)

Definition at line 208 of file file.c.

Referenced by _generateInstallList(), _readArgsOutputFiles(), and GWBUILD_Debug_PrintFile().

Here is the caller graph for this function:

◆ GWB_File_GetName()

◆ GWB_File_GetWaitingBuildCmdList2()

GWB_BUILD_CMD_LIST2 * GWB_File_GetWaitingBuildCmdList2 ( const GWB_FILE * f)

Definition at line 246 of file file.c.

Referenced by _signalJobFinished().

Here is the caller graph for this function:

◆ GWB_File_List2_FreeAll()

void GWB_File_List2_FreeAll ( GWB_FILE_LIST2 * fileList2)

Definition at line 284 of file file.c.

References GWB_File_free().

Referenced by GWB_BuildCtx_free().

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

◆ GWB_File_List2_GetAt()

GWB_FILE * GWB_File_List2_GetAt ( const GWB_FILE_LIST2 * fileList,
int index )

Definition at line 644 of file file.c.

References NULL.

Referenced by _readArgsInputFiles(), _readArgsOutputFiles(), _readFileListFromTagNode(), and _readMainFilename().

Here is the caller graph for this function:

◆ GWB_File_List2_GetFileById()

GWB_FILE * GWB_File_List2_GetFileById ( const GWB_FILE_LIST2 * fileList,
uint32_t id )

Definition at line 422 of file file.c.

References GWB_File_GetId(), and NULL.

Referenced by _readFileIdsFromXml().

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

◆ GWB_File_List2_GetFileByPathAndName()

GWB_FILE * GWB_File_List2_GetFileByPathAndName ( const GWB_FILE_LIST2 * fileList,
const char * folder,
const char * fname )

Definition at line 353 of file file.c.

References GWB_File_GetFolder(), GWB_File_GetName(), and NULL.

Referenced by GWB_BuildCtx_GetFileByPathAndName(), GWB_File_List2_GetOrCreateFile(), and GWB_Project_GetFileByPathAndName().

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

◆ GWB_File_List2_GetOrCreateFile()

GWB_FILE * GWB_File_List2_GetOrCreateFile ( GWB_FILE_LIST2 * fileList,
const char * folder,
const char * fname )

◆ GWB_File_List2_ReadXml()

void GWB_File_List2_ReadXml ( GWEN_XMLNODE * xmlNode,
const char * groupName,
GWB_FILE_LIST2 * destFileList )

Definition at line 694 of file file.c.

References GWB_File_fromXml(), GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), and NULL.

Referenced by GWB_Utils_ReadFileList2().

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

◆ GWB_File_List2_WriteXml()

void GWB_File_List2_WriteXml ( const GWB_FILE_LIST2 * fileList,
GWEN_XMLNODE * xmlNode,
const char * groupName )

Definition at line 671 of file file.c.

References GWB_File_toXml(), GWEN_XMLNode_AddChild(), GWEN_XMLNode_new(), and GWEN_XMLNodeTypeTag.

Referenced by GWB_Project_toXml(), GWB_Target_toXml(), and GWB_Utils_WriteProjectFileList().

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

◆ GWB_File_new()

GWB_FILE * GWB_File_new ( const char * folder,
const char * fName,
uint32_t id )

Definition at line 34 of file file.c.

References GWB_File_SetFolder(), GWB_File_SetName(), and GWEN_NEW_OBJECT.

Referenced by _readFilesFromXml(), GWB_File_dup(), GWB_File_fromXml(), and GWB_File_List2_GetOrCreateFile().

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

◆ GWB_File_ReplaceExtension()

void GWB_File_ReplaceExtension ( GWB_FILE * file,
const char * newExt )

Definition at line 305 of file file.c.

References GWB_File_SetName(), GWEN_Buffer_AppendBytes(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), and GWEN_Buffer_new().

Referenced by GWB_File_CopyObjectAndChangeExtension().

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

◆ GWB_File_SetBuildCmd()

void GWB_File_SetBuildCmd ( GWB_FILE * f,
GWB_BUILD_CMD * bcmd )

Definition at line 277 of file file.c.

Referenced by _fileListSetBuildCmd().

Here is the caller graph for this function:

◆ GWB_File_SetBuilder()

void GWB_File_SetBuilder ( GWB_FILE * f,
const char * s )

Definition at line 200 of file file.c.

References NULL.

Referenced by _genBuilderForSourceFile(), GWB_File_dup(), GWB_File_fromXml(), GWB_Parser_AddTargetForSourceFile(), and GWB_Parser_ParseSourcesOrHeaders().

Here is the caller graph for this function:

◆ GWB_File_SetFileType()

void GWB_File_SetFileType ( GWB_FILE * f,
const char * s )

Definition at line 234 of file file.c.

References NULL.

Referenced by _parseOutFile(), _readFilesFromXml(), GWB_File_dup(), GWB_File_fromXml(), GWB_Parser_AddTargetForSourceFile(), and GWB_Parser_ParseSourcesOrHeaders().

Here is the caller graph for this function:

◆ GWB_File_SetFlags()

void GWB_File_SetFlags ( GWB_FILE * f,
uint32_t i )

Definition at line 106 of file file.c.

Referenced by _readFilesFromXml(), and GWB_File_dup().

Here is the caller graph for this function:

◆ GWB_File_SetFolder()

void GWB_File_SetFolder ( GWB_FILE * f,
const char * s )

Definition at line 134 of file file.c.

References NULL.

Referenced by GWB_File_new().

Here is the caller graph for this function:

◆ GWB_File_SetId()

void GWB_File_SetId ( GWB_FILE * f,
uint32_t i )

Definition at line 92 of file file.c.

Referenced by _addFilesToBuildCtx(), and GWB_BuildCtx_AddFile().

Here is the caller graph for this function:

◆ GWB_File_SetInstallName()

void GWB_File_SetInstallName ( GWB_FILE * f,
const char * s )

Definition at line 172 of file file.c.

References NULL.

Referenced by _setupOutFiles(), GWB_File_dup(), and GWB_File_fromXml().

Here is the caller graph for this function:

◆ GWB_File_SetInstallPath()

void GWB_File_SetInstallPath ( GWB_FILE * f,
const char * s )

Definition at line 215 of file file.c.

References NULL.

Referenced by _parseOutFile(), _parseWriteFile(), GWB_File_dup(), GWB_File_fromXml(), and GWB_Parser_ParseSourcesOrHeaders().

Here is the caller graph for this function:

◆ GWB_File_SetName()

void GWB_File_SetName ( GWB_FILE * f,
const char * s )

Definition at line 153 of file file.c.

References NULL.

Referenced by GWB_File_new(), and GWB_File_ReplaceExtension().

Here is the caller graph for this function:

◆ GWB_File_toXml()

void GWB_File_toXml ( const GWB_FILE * file,
GWEN_XMLNODE * xmlNode )

Definition at line 529 of file file.c.

References _writeFileFlagsToXml(), GWB_File_GetFlags(), GWEN_XMLNode_SetCharValue(), and GWEN_XMLNode_SetIntProperty().

Referenced by GWB_File_List2_WriteXml().

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

◆ GWB_File_WriteFileNameToTopBuildDirString()

void GWB_File_WriteFileNameToTopBuildDirString ( const GWB_FILE * file,
const char * initialSourceDir,
GWEN_BUFFER * fbuf )

Definition at line 474 of file file.c.

References GWB_FILE_FLAGS_GENERATED, GWB_File_GetFlags(), GWB_File_GetFolder(), GWB_File_GetName(), GWEN_Buffer_AppendString(), and GWEN_DIR_SEPARATOR_S.

Referenced by _fileListToTopBuildDirStringList(), _generateInstallList(), and GWB_File_FileListToTopBuildDirStringList().

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