Changeset 3e4cb1 in git for libpolys


Ignore:
Timestamp:
Apr 21, 2016, 3:15:46 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
ffa0d1dc21cfd5ee9b20a51105e62bd0af1503ba
Parents:
27f3593e8355ebd5b09faa21e66ea07117b79fcc
Message:
add: possibility to redirect warnings: WarnS_callback
Location:
libpolys/reporter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/reporter/reporter.cc

    r27f359 r3e4cb1  
    208208}
    209209
     210void (*WarnS_callback)(const char *s) = NULL;
     211
    210212void WarnS(const char *s)
    211213{
    212214  #define warn_str "// ** "
    213 #ifdef HAVE_TCL
    214   if (tclmode)
    215   {
    216     PrintTCLS('W',warn_str);
    217     PrintTCLS('W',s);
    218     PrintTCLS('W',"\n");
    219   }
    220   else
    221 #endif
    222215  if (feWarn) /* ignore warnings if option --no-warn was given */
    223216  {
    224     fwrite(warn_str,1,6,stdout);
    225     fwrite(s,1,strlen(s),stdout);
    226     fwrite("\n",1,1,stdout);
    227     fflush(stdout);
     217    if (WarnS_callback==NULL)
     218    {
     219      fwrite(warn_str,1,6,stdout);
     220      fwrite(s,1,strlen(s),stdout);
     221      fwrite("\n",1,1,stdout);
     222      fflush(stdout);
     223    }
     224    else
     225    {
     226      WarnS_callback(s);
     227    }
    228228    if (feProt&SI_PROT_O)
    229229    {
  • libpolys/reporter/reporter.h

    r27f359 r3e4cb1  
    2323extern BOOLEAN feOut;
    2424extern int  traceit ;
     25extern void (*WarnS_callback)(const char *s);
     26
    2527// show entering/leaving proc:
    2628#define TRACE_SHOW_PROC   1
Note: See TracChangeset for help on using the changeset viewer.