Back to index

texmacs  1.0.7.15
Defines | Functions | Variables
error.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include "error.h"

Go to the source code of this file.

Defines

#define DPX_MESG   0
#define DPX_MESG_WARN   1
#define DPX_MESG_ERROR   2
#define WANT_NEWLINE()   (_mesg_type != DPX_MESG_WARN && _mesg_type != DPX_MESG_ERROR)

Functions

void shut_up (void)
void MESG (const char *fmt,...)
void WARN (const char *fmt,...)
void error_cleanup (void)
void ERROR (const char *fmt,...)

Variables

static int _mesg_type = DPX_MESG
static int really_quiet = 0

Define Documentation

#define DPX_MESG   0

Definition at line 31 of file error.c.

#define DPX_MESG_ERROR   2

Definition at line 33 of file error.c.

#define DPX_MESG_WARN   1

Definition at line 32 of file error.c.

Definition at line 36 of file error.c.


Function Documentation

void ERROR ( const char *  fmt,
  ... 
)

Definition at line 81 of file error.c.

{
  va_list argp;

  if (!really_quiet) {
    if (WANT_NEWLINE())
      fprintf(stderr, "\n");
    fprintf(stderr, "** ERROR ** ");
    va_start(argp, fmt);
    vfprintf(stderr, fmt, argp);
    va_end(argp);
    fprintf(stderr, "\n");
  }
  error_cleanup();
  exit( 1 );
}

Here is the call graph for this function:

void error_cleanup ( void  )

Definition at line 43 of file pdf_renderer.cpp.

  {
    pdf_close_images();  /* delete temporary files */
    pdf_error_cleanup();
#if 0
    if (pdf_filename) {
      remove(pdf_filename);
      fprintf(stderr, "\nOutput file removed.\n");
    }
#endif
  }

Here is the caller graph for this function:

void MESG ( const char *  fmt,
  ... 
)

Definition at line 47 of file error.c.

{
  va_list argp;

  if (!really_quiet) {
    va_start(argp, fmt);
    vfprintf(stderr, fmt, argp);
    va_end(argp);
    _mesg_type = DPX_MESG;
  }
}
void shut_up ( void  )

Definition at line 41 of file error.c.

{
  really_quiet = 1;
}
void WARN ( const char *  fmt,
  ... 
)

Definition at line 60 of file error.c.

{
  va_list argp;

  if (!really_quiet) {
    if (WANT_NEWLINE())
      fprintf(stderr, "\n");
    fprintf(stderr, "** WARNING ** ");
    va_start(argp, fmt);
    vfprintf(stderr, fmt, argp);
    va_end(argp);
    fprintf(stderr, "\n");

    _mesg_type = DPX_MESG_WARN;
  }
}

Variable Documentation

int _mesg_type = DPX_MESG [static]

Definition at line 35 of file error.c.

int really_quiet = 0 [static]

Definition at line 38 of file error.c.