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) {
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
int GWEN_Buffer_AppendArgs(GWEN_BUFFER *bf, const char *fmt,...)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
void GWB_BuildCmd_AddInFile(GWB_BUILD_CMD *bcmd, GWB_FILE *file)
void GWB_BuildCmd_List2_FreeAll(GWB_BUILD_CMD_LIST2 *cmdList)
void GWB_BuildCmd_AddOutFile(GWB_BUILD_CMD *bcmd, GWB_FILE *file)
struct GWB_BUILD_CMD GWB_BUILD_CMD
void GWB_BuildCtx_AddInFileToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE *file)
void GWB_BuildCtx_AddInFilesToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE_LIST2 *fileList)
static int _prepareBaseLogPath(GWB_BUILD_CONTEXT *bctx)
GWB_FILE * GWB_BuildCtx_GetFileByPathAndName(const GWB_BUILD_CONTEXT *bctx, const char *folder, const char *fname)
void GWB_BuildCtx_free(GWB_BUILD_CONTEXT *bctx)
GWB_BUILD_CMD_LIST2 * GWB_BuildCtx_GetCommandList(const GWB_BUILD_CONTEXT *bctx)
int GWB_BuildCtx_CreateAndSetLogFilenameForSubCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_SUBCMD *cmd)
const char * GWB_BuildCtx_GetInitialSourceDir(const GWB_BUILD_CONTEXT *bctx)
void GWB_BuildCtx_SetInitialSourceDir(GWB_BUILD_CONTEXT *bctx, const char *s)
const char * GWB_BuildCtx_GetLogPath(const GWB_BUILD_CONTEXT *bctx)
void GWB_BuildCtx_AddCommand(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *cmd)
void GWB_BuildCtx_AddOutFileToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE *file)
GWB_FILE_LIST2 * GWB_BuildCtx_GetFileList(const GWB_BUILD_CONTEXT *bctx)
void GWB_BuildCtx_AddFile(GWB_BUILD_CONTEXT *bctx, GWB_FILE *file)
GWB_BUILD_CONTEXT * GWB_BuildCtx_new()
void GWB_BuildCtx_SetLogPath(GWB_BUILD_CONTEXT *bctx, const char *s)
void GWB_BuildCtx_AddOutFilesToCtxAndCmd(GWB_BUILD_CONTEXT *bctx, GWB_BUILD_CMD *bcmd, GWB_FILE_LIST2 *fileList)
void GWB_BuildCtx_Dump(const GWB_BUILD_CONTEXT *bctx, int indent)
struct GWB_BUILD_CONTEXT GWB_BUILD_CONTEXT
void GWB_BuildSubCmd_SetLogFilename(GWB_BUILD_SUBCMD *cmd, const char *s)
struct GWB_BUILD_SUBCMD GWB_BUILD_SUBCMD
#define DBG_INFO(dbg_logger, format,...)
#define DBG_ERROR(dbg_logger, format,...)
GWENHYWFAR_API int GWEN_Directory_GetPath(const char *path, unsigned int flags)
void GWB_File_SetId(GWB_FILE *f, uint32_t i)
void GWB_File_List2_FreeAll(GWB_FILE_LIST2 *fileList2)
const char * GWB_File_GetFolder(const GWB_FILE *f)
const char * GWB_File_GetName(const GWB_FILE *f)
GWB_FILE * GWB_File_dup(const GWB_FILE *oldFile)
GWB_FILE * GWB_File_List2_GetFileByPathAndName(const GWB_FILE_LIST2 *fileList, const char *folder, const char *fname)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
void GWBUILD_Debug_PrintBuildCmdList2(const char *sName, const GWB_BUILD_CMD_LIST2 *buildCmdList2, int indent)
void GWBUILD_Debug_PrintFileList2(const char *sName, const GWB_FILE_LIST2 *fileList2, int indent)
#define GWEN_DIR_SEPARATOR_S
struct GWEN_TIME GWEN_TIME
GWENHYWFAR_API GWEN_TIME * GWEN_CurrentTime(void)
GWENHYWFAR_API int GWEN_Time_toString(const GWEN_TIME *t, const char *tmpl, GWEN_BUFFER *buf)
GWENHYWFAR_API void GWEN_Time_free(GWEN_TIME *t)
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)