Skip to content

Commit

Permalink
print compilation result to log
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyz32 committed Jul 31, 2024
1 parent ac91800 commit 6e6119a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ src/mzversion.h:
/qsys.lib/${BUILDLIB}.lib/handler.pgm: /qsys.lib/${BUILDLIB}.lib/handler.module /qsys.lib/${BUILDLIB}.lib/pub_json.module /qsys.lib/${BUILDLIB}.lib/pub_db2.module /qsys.lib/${BUILDLIB}.lib/debug.module /qsys.lib/${BUILDLIB}.lib/pub_db2.module /qsys.lib/${BUILDLIB}.lib/userconf.module

/qsys.lib/${BUILDLIB}.lib/%.pgm:
system "CRTPGM PGM(${BUILDLIB}/$*) MODULE($(patsubst %.module,$(BUILDLIB)/%,$(notdir $^))) ACTGRP(*CALLER)"
system "CRTPGM PGM(${BUILDLIB}/$*) MODULE($(patsubst %.module,$(BUILDLIB)/%,$(notdir $^))) ACTGRP(*CALLER) OUTPUT(*PRINT)" > $*.log 2>&1

/qsys.lib/${BUILDLIB}.lib/%.module: src/%.cpp src/mzversion.h
system "CRTCPPMOD MODULE(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$<') OPTION(*EVENTF) SYSIFCOPT(*IFS64IO) DBGVIEW(*SOURCE) TERASPACE(*YES *TSIFC) STGMDL(*SNGLVL) DTAMDL(*p128) DEFINE(DEBUG_ENABLED)"
system "CRTCPPMOD MODULE(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$<') OPTION(*EVENTF) SYSIFCOPT(*IFS64IO) DBGVIEW(*SOURCE) TERASPACE(*YES *TSIFC) STGMDL(*SNGLVL) DTAMDL(*p128) DEFINE(DEBUG_ENABLED) OUTPUT(*PRINT)" > $*.log 2>&1

/qsys.lib/${BUILDLIB}.lib/%.module: src/%.sqlc
system "CRTSQLCI OBJ(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$^') COMMIT(*NONE) DATFMT(*ISO) TIMFMT(*ISO) DBGVIEW(*SOURCE) CVTCCSID(*JOB) COMPILEOPT('INCDIR(''src'')') SQLPATH(${BUILDLIB}) DFTRDBCOL(${BUILDLIB}) OPTION(*SQL)"
system "CRTSQLCI OBJ(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$^') COMMIT(*NONE) DATFMT(*ISO) TIMFMT(*ISO) DBGVIEW(*SOURCE) CVTCCSID(*JOB) COMPILEOPT('INCDIR(''src'')') SQLPATH(${BUILDLIB}) DFTRDBCOL(${BUILDLIB}) OPTION(*SQL) OUTPUT(*PRINT)" > $*.log 2>&1

/qsys.lib/${BUILDLIB.lib}:
-system "RUNSQL SQL('create schema ${BUILDLIB}') NAMING(*SYS)"
Expand Down
6 changes: 3 additions & 3 deletions ile/src/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ int main(int _argc, char **argv)
return 0;
}

std::string watch_option = createTrimmedString(argv[1], sizeof(argv[1]));
std::string session_id = createTrimmedString(argv[2], sizeof(argv[2]));
BUFSTRN(watch_option, argv[1], sizeof(argv[1]));
BUFSTRN(session_id, argv[2], sizeof(argv[2]));

DEBUG("watch program called. Watch option setting is '%s'\n", watch_option.c_str());
publisher_info_set *publishers = conf_get_publisher_info(session_id.c_str());
Expand All @@ -116,7 +116,7 @@ int main(int _argc, char **argv)
DEBUG("Timestamp is '%s'\n", message_timestamp.c_str());
int message_severity = msg_event->message_severity;
BUFSTR(sending_usrprf, msg_event->sending_user_profile);
std::string sending_procedure_name = createTrimmedString((char *)msg_event + msg_event->offset_send_procedure_name, msg_event->length_send_procedure_name)
BUFSTRN(sending_procedure_name, (char *)msg_event + msg_event->offset_send_procedure_name, msg_event->length_send_procedure_name);
BUFSTR(sending_module_name, msg_event->sending_module_name);
BUFSTR(sending_program_name, msg_event->sending_program_name);
sending_program_name.erase(1 + sending_program_name.find_last_not_of(" "));
Expand Down
17 changes: 8 additions & 9 deletions ile/src/manzan.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
if (lastChar != std::string::npos) \
dest.erase(1 + lastChar); \
}

inline std::string createTrimmedString(std::string src, size_t len) {
std::string dest = src.substr(0, len);
size_t lastChar = dest.find_last_not_of(" ");
if (lastChar != len - 1) {
dest.erase(1 + lastChar);
}
return dest;
}

#define BUFSTRN(dest, src, len) \
std::string dest(src, len); \
{ \
size_t lastChar = dest.find_last_not_of(" "); \
if (lastChar != std::string::npos) \
dest.erase(1 + lastChar); \
}

#define ITOA(dest, src) \
char dest[32]; \
Expand Down

0 comments on commit 6e6119a

Please sign in to comment.