Ejemplo n.º 1
0
void qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... ) {
    va_list args;

    if (!fp) {
        if(!qh){
            qh_fprintf_stderr(6241, "userprintf_r.c: fp and qh not defined for qh_fprintf '%s'", fmt);
            qh_exit(qhmem_ERRqhull);  /* can not use qh_errexit() */
        }
        /* could use qh->qhmem.ferr, but probably better to be cautious */
        qh_fprintf_stderr(6232, "Qhull internal error (userprintf_r.c): fp is 0.  Wrong qh_fprintf called.\n");
        qh_errexit(qh, 6232, NULL, NULL);
    }
    va_start(args, fmt);
    if (qh && qh->ANNOTATEoutput) {
      /* CHANGE TO SOURCE */
      /* fprintf(fp, "[QH%.4d]", msgcode); */
      REprintf("[QH%.4d]", msgcode);
    }else if (msgcode >= MSG_ERROR && msgcode < MSG_STDERR ) {
      /* CHANGE TO SOURCE */
      /* fprintf(fp, "QH%.4d ", msgcode); */
      REvprintf(fmt, args);
    }
    /* CHANGE TO SOURCE */
    /* vfprintf(fp, fmt, args); */
    if (fp && (fp != qh_FILEstderr)) {
        vfprintf(fp, fmt, args);
    }
    va_end(args);

    /* Place debugging traps here. Use with option 'Tn' */

} /* qh_fprintf */
Ejemplo n.º 2
0
Archivo: mt.c Proyecto: cran/multtest
void win_print(FILE* fp, char* format,...)
{
  va_list ap;
  va_start(ap, format);
  REvprintf(format, ap);
  va_end(ap);
}
Ejemplo n.º 3
0
/*
  REprintf is used by the error handler do not add
  anything unless you're sure it won't
  cause problems
*/
void REprintf(const char *format, ...)
{
    va_list(ap);
    va_start(ap, format);
    REvprintf(format, ap);
    va_end(ap);
}
Ejemplo n.º 4
0
void __VACALL report(lprec *lp, int level, char *format, ...)
{
    static char buff[DEF_STRBUFSIZE+1];
    static va_list ap;

    if(lp == NULL) {
        va_start(ap, format);
        REvprintf( format, ap);
        va_end(ap);
    }
    else if(level <= lp->verbose) {
        va_start(ap, format);
        if(lp->writelog != NULL) {
            vsnprintf(buff, DEF_STRBUFSIZE, format, ap);
            lp->writelog(lp, lp->loghandle, buff);
        }
        if(lp->outstream != NULL) {
            vfprintf(lp->outstream, format, ap);
            /*    if(lp->outstream != stdout) */
            fflush(lp->outstream);
        }
        va_end(ap);
    }
#ifdef xParanoia
    if(level == CRITICAL)
        raise(SIGSEGV);
#endif
}
Ejemplo n.º 5
0
Archivo: gui.c Proyecto: TaddyLab/gamlr
void shout(const char *str, ...)
{
  va_list argp;
  va_start(argp, str);

#ifdef RPRINT
  REvprintf(str, argp);
#else
  vfprintf(stderr, str, argp);
#endif

  va_end(argp);
}
Ejemplo n.º 6
0
void rniftyreg_fprintf (FILE *stream, const char *format, ...)
{
    va_list args;
    va_start(args, format);
    
    if (stream == stdout)
        Rvprintf(format, args);
    else if (stream == stderr)
        REvprintf(format, args);
    else
        vfprintf(stream, format, args);
    
    va_end(args);
}
Ejemplo n.º 7
0
STATIC void debug_print(lprec *lp, char *format, ...)
{
    va_list ap;

    if(lp->bb_trace) {
        print_indent(lp);
        va_start(ap, format);
        if (lp == NULL)
        {
            REvprintf( format, ap);
            /*   fputc('\n', stderr); */
        }
        else if(lp->debuginfo != NULL)
        {
            char buff[DEF_STRBUFSIZE+1];
            vsnprintf(buff, DEF_STRBUFSIZE, format, ap);
            lp->debuginfo(lp, lp->loghandle, buff);
        }
        va_end(ap);
    }
} /* debug_print */