14 #define DISABLE_DEBUGLOG 19 #include "gwenbuild/buildctx/buildctx_p.h" 21 #include <gwenhywfar/debug.h> 22 #include <gwenhywfar/text.h> 23 #include <gwenhywfar/directory.h> 24 #include <gwenhywfar/gwentime.h> 39 bctx->commandList=GWB_BuildCmd_List2_new();
40 bctx->fileList=GWB_File_List2_new();
50 GWB_BuildCmd_List2_free(bctx->waitingQueue);
51 GWB_BuildCmd_List2_free(bctx->runningQueue);
52 GWB_BuildCmd_List2_free(bctx->finishedQueue);
57 free(bctx->initialSourceDir);
75 bctx->logPath=s?strdup(s):
NULL;
82 return bctx->initialSourceDir;
89 free(bctx->initialSourceDir);
90 bctx->initialSourceDir=s?strdup(s):
NULL;
97 return bctx->commandList;
104 GWB_BuildCmd_List2_PushBack(bctx->commandList, cmd);
111 return bctx->fileList;
120 GWB_File_List2_PushBack(bctx->fileList, file);
152 GWB_FILE_LIST2_ITERATOR *it;
154 it=GWB_File_List2_First(fileList);
158 file=GWB_File_List2Iterator_Data(it);
161 file=GWB_File_List2Iterator_Next(it);
163 GWB_File_List2Iterator_free(it);
189 GWB_FILE_LIST2_ITERATOR *it;
191 it=GWB_File_List2_First(fileList);
195 file=GWB_File_List2Iterator_Data(it);
198 file=GWB_File_List2Iterator_Next(it);
200 GWB_File_List2Iterator_free(it);
210 for(i=0; i<indent; i++)
211 fprintf(stderr,
" ");
212 fprintf(stderr,
"BuildCtx:\n");
225 if (bctx->logPath==
NULL) {
GWB_BUILD_CONTEXT * GWB_BuildCtx_new()
struct GWEN_TIME GWEN_TIME
#define DBG_ERROR(dbg_logger, format,...)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
const char * GWB_BuildCtx_GetLogPath(const GWB_BUILD_CONTEXT *bctx)
static int _prepareBaseLogPath(GWB_BUILD_CONTEXT *bctx)
void GWB_BuildCtx_SetLogPath(GWB_BUILD_CONTEXT *bctx, const char *s)
int GWB_BuildCtx_CreateAndSetLogFilenameForSubCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_SUBCMD *cmd)
#define GWEN_DIR_SEPARATOR_S
struct GWB_BUILD_CONTEXT GWB_BUILD_CONTEXT
#define GWEN_FREE_OBJECT(varname)
GWB_FILE * GWB_File_dup(const GWB_FILE *oldFile)
void GWB_BuildCtx_free(GWB_BUILD_CONTEXT *bctx)
void GWB_File_SetId(GWB_FILE *f, uint32_t i)
void GWBUILD_Debug_PrintBuildCmdList2(const char *sName, const GWB_BUILD_CMD_LIST2 *buildCmdList2, int indent)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
GWB_FILE * GWB_BuildCtx_GetFileByPathAndName(const GWB_BUILD_CONTEXT *bctx, const char *folder, const char *fname)
const char * GWB_File_GetFolder(const GWB_FILE *f)
const char * GWB_BuildCtx_GetInitialSourceDir(const GWB_BUILD_CONTEXT *bctx)
const char * GWB_File_GetName(const GWB_FILE *f)
#define GWEN_NEW_OBJECT(typ, varname)
GWENHYWFAR_API int GWEN_Time_toString(const GWEN_TIME *t, const char *tmpl, GWEN_BUFFER *buf)
GWB_FILE_LIST2 * GWB_BuildCtx_GetFileList(const GWB_BUILD_CONTEXT *bctx)
void GWB_BuildCmd_AddInFile(GWB_BUILD_CMD *bcmd, GWB_FILE *file)
int GWEN_Buffer_AppendArgs(GWEN_BUFFER *bf, const char *fmt,...)
void GWB_BuildCtx_SetInitialSourceDir(GWB_BUILD_CONTEXT *bctx, const char *s)
void GWBUILD_Debug_PrintFileList2(const char *sName, const GWB_FILE_LIST2 *fileList2, int indent)
void GWB_BuildCtx_AddInFilesToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE_LIST2 *fileList)
void GWB_File_List2_FreeAll(GWB_FILE_LIST2 *fileList2)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
struct GWB_BUILD_SUBCMD GWB_BUILD_SUBCMD
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
GWENHYWFAR_API void GWEN_Time_free(GWEN_TIME *t)
void GWB_BuildCtx_AddCommand(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *cmd)
void GWB_BuildCtx_AddOutFilesToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE_LIST2 *fileList)
void GWB_BuildCmd_List2_FreeAll(GWB_BUILD_CMD_LIST2 *cmdList)
GWB_FILE * GWB_File_List2_GetFileByPathAndName(const GWB_FILE_LIST2 *fileList, const char *folder, const char *fname)
void GWB_BuildCtx_AddFile(GWB_BUILD_CONTEXT *bctx, GWB_FILE *file)
struct GWB_BUILD_CMD GWB_BUILD_CMD
GWB_BUILD_CMD_LIST2 * GWB_BuildCtx_GetCommandList(const GWB_BUILD_CONTEXT *bctx)
void GWB_BuildCmd_AddOutFile(GWB_BUILD_CMD *bcmd, GWB_FILE *file)
void GWB_BuildCtx_AddInFileToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE *file)
GWENHYWFAR_API int GWEN_Directory_GetPath(const char *path, unsigned int flags)
#define DBG_INFO(dbg_logger, format,...)
void GWB_BuildCtx_Dump(const GWB_BUILD_CONTEXT *bctx, int indent)
GWENHYWFAR_API GWEN_TIME * GWEN_CurrentTime(void)
void GWB_BuildCtx_AddOutFileToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE *file)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
void GWB_BuildSubCmd_SetLogFilename(GWB_BUILD_SUBCMD *cmd, const char *s)