Commit a3eb1351 authored by claes's avatar claes

m58: recompile if new structfile. Some errormessages was not displayed in Msg window.

parent 8c58fb7b
...@@ -8,16 +8,7 @@ ...@@ -8,16 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#if defined OS_VMS #include <sys/stat.h>
#include <descrip.h>
#include <lib$routines.h>
#include <libdef.h>
#include <libdtdef.h>
#include <lnmdef.h>
#include <clidef.h>
#include <ssdef.h>
#include <starlet.h>
#endif
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
...@@ -973,7 +964,7 @@ static int gcg_cc( ...@@ -973,7 +964,7 @@ static int gcg_cc(
sprintf( cmd, "%s %d %ld %s %d %s %s %s", sprintf( cmd, "%s %d %ld %s %d %s %s %s",
fname, gcg_debug, filetype, p1, os, p2, p3, systemname); fname, gcg_debug, filetype, p1, os, p2, p3, systemname);
sts = system( cmd); sts = system( cmd);
if ( sts != 0) return GSX__SWINDERR; if ( sts != 0) return GSX__CCERROR;
} }
else else
{ {
...@@ -3228,6 +3219,7 @@ static int gcg_get_outputstring_spec( ...@@ -3228,6 +3219,7 @@ static int gcg_get_outputstring_spec(
free((char *) parameter); free((char *) parameter);
return GSX__SPECFOUND; return GSX__SPECFOUND;
} }
#if 0
if ( output_node->ln.classid == pwr_cClass_GetIp) if ( output_node->ln.classid == pwr_cClass_GetIp)
{ {
/* Get the objdid stored in the parameter */ /* Get the objdid stored in the parameter */
...@@ -3268,6 +3260,7 @@ static int gcg_get_outputstring_spec( ...@@ -3268,6 +3260,7 @@ static int gcg_get_outputstring_spec(
free((char *) parameter); free((char *) parameter);
return GSX__SPECFOUND; return GSX__SPECFOUND;
} }
#endif
/********************************************************** /**********************************************************
* GETPI * GETPI
***********************************************************/ ***********************************************************/
...@@ -3719,11 +3712,13 @@ static int gcg_error_msg( ...@@ -3719,11 +3712,13 @@ static int gcg_error_msg(
printf(" in object %s\n", hier_name); printf(" in object %s\n", hier_name);
msgw_message_plcobject( sts, " in object", hier_name, node->ln.object_did); msgw_message_plcobject( sts, " in object", hier_name, node->ln.object_did);
} }
if ( gcgctx) {
if ( (sts & 2) && !(sts & 1)) if ( (sts & 2) && !(sts & 1))
gcgctx->errorcount++; gcgctx->errorcount++;
else if ( !(sts & 2) && !(sts & 1)) else if ( !(sts & 2) && !(sts & 1))
gcgctx->warningcount++; gcgctx->warningcount++;
} }
}
return GSX__SUCCESS; return GSX__SUCCESS;
} }
...@@ -5391,7 +5386,10 @@ unsigned long spawn; ...@@ -5391,7 +5386,10 @@ unsigned long spawn;
sts = gcg_cc( GCG_PLC, module_name, plclibrary, sts = gcg_cc( GCG_PLC, module_name, plclibrary,
plc_name, opsys, spawn); plc_name, opsys, spawn);
if ( EVEN(sts)) (*errorcount)++; if ( EVEN(sts)) {
gcg_error_msg( 0, sts, 0);
(*errorcount)++;
}
} }
} }
} }
...@@ -5697,7 +5695,10 @@ unsigned long spawn; ...@@ -5697,7 +5695,10 @@ unsigned long spawn;
IF_PR { IF_PR {
sts = gcg_cc( GCG_WIND, module_name, plclibrary, wind_name, sts = gcg_cc( GCG_WIND, module_name, plclibrary, wind_name,
opsys, spawn); opsys, spawn);
if ( EVEN(sts)) (*errorcount)++; if ( EVEN(sts)) {
gcg_error_msg( 0, sts, 0);
(*errorcount)++;
}
} }
} }
} }
...@@ -14143,6 +14144,36 @@ vldh_t_node node; ...@@ -14143,6 +14144,36 @@ vldh_t_node node;
gcgctx->print, 0, gcg_debug); gcgctx->print, 0, gcg_debug);
node->hn.subwindowobject[0] = 0; node->hn.subwindowobject[0] = 0;
} }
else {
// Check if new structfile
char *s;
char fname[200];
struct stat info;
pwr_tTime *compile_time;
/* Get compilation time in parameter Compiled */
sts = ldh_GetObjectPar( ldhses, window_objid,
"DevBody", "Compiled",
(char **)&compile_time, &size);
if (EVEN(sts)) return sts;
if ( (s = strchr( oname, ':')))
*s = 0;
sprintf( fname, "$pwrp_inc/pwr_%sclasses.h", oname);
cdh_ToLower( fname, fname);
dcli_translate_filename( fname, fname);
sts = stat( fname, &info);
if ( sts != -1 && info.st_ctime > compile_time->tv_sec) {
/* Compile the subwindow... */
ldhwb = ldh_SessionToWB( ldhses);
sts = gcg_wind_comp_all( ldhwb, ldhses, window_objid,
gcgctx->print, 0, gcg_debug);
}
free( (char *)compile_time);
}
if ( found)
free( (char *)instance_time); free( (char *)instance_time);
free( (char *)template_time); free( (char *)template_time);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment