Back to index

tetex-bin  3.0
Functions
mpost.h File Reference
#include "pdfobj.h"
#include "pdfspecial.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int check_for_mp (FILE *image_file)
pdf_objmp_include (FILE *image_file, struct xform_info *p, char *res_name, double x_user, double y_user)
int do_raw_ps_special (char **start, char *end, int cleanup, double x_user, double y_user)
void mp_cleanup (int sloppy_is_okay)
struct xform_infotexfig_info (void)
void mp_eop_cleanup (void)

Function Documentation

int check_for_mp ( FILE image_file)

Definition at line 43 of file mpost.c.

{
  rewind (image_file);
  /* For now, this is an exact test that must be passed, character for
     character */
  mfgets (work_buffer, WORK_BUFFER_SIZE, image_file);
  if (strncmp (work_buffer, "%!PS", 4))
    return 0;
  mfgets (work_buffer, WORK_BUFFER_SIZE, image_file);
  if (strncmp (work_buffer, "%%BoundingBox", strlen("%%BoundingBox")))
    return 0;
  mfgets (work_buffer, WORK_BUFFER_SIZE, image_file);
  if (strncmp (work_buffer, "%%Creator: MetaPost", strlen("%%Creator: MetaPost")))
    return 0;
  return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int do_raw_ps_special ( char **  start,
char *  end,
int  cleanup,
double  x_user,
double  y_user 
)

Definition at line 1266 of file mpost.c.

{
  int error = 0;
  state = 0;
  do_one_ps_line (start, end, x_user, y_user);
  if (cleanup)
    mp_cleanup(1);
  return !error;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mp_cleanup ( int  sloppy_is_okay)

Definition at line 1277 of file mpost.c.

{
  release_fonts();
  if (state != 0) {
    if (!sloppy_ok)
      fprintf (stderr, "mp_cleanup(): State not zero\n");
    state = 0;
  }
  if (top_stack != 0) {
    if (!sloppy_ok)
      fprintf (stderr, "\nPS/MetaPost: PS stack not empty at end of figure!\n");
  }
  /* Cleanup paths */
  while (top_stack > 0) {
    pdf_obj *p;
    if ((p=POP_STACK()))
      pdf_release_obj (p);
  }
  if (n_path_pts > 0) {
    if (!sloppy_ok) {
      fprintf (stderr, "\nPS/MetaPost: Pending path at end of figure!\n");
      dump_path (); 
    }
    void_path ();
  }
  if (max_path_pts > 0) {
    RELEASE (path);
    path = NULL;
    max_path_pts = 0;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1309 of file mpost.c.

{
  mp_cleanup(1);
  num_saves = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

pdf_obj* mp_include ( FILE image_file,
struct xform_info p,
char *  res_name,
double  x_user,
double  y_user 
)

Definition at line 1328 of file mpost.c.

{
   pdf_obj *xobj = NULL;
   rewind (image_file);
   if (mp_parse_headers (image_file, p)) {
      /* Looks like an MP file.  Setup xobj "capture" */
     pdf_scale_image (p);
     xobj = begin_form_xobj (p->u_llx,p->u_lly, p->c_llx, p->c_lly,
                          p->c_urx, p->c_ury, res_name);
     if (!xobj)
       return NULL;
     /* Flesh out the contents */
     if (!parse_contents (image_file)) {
       fprintf (stderr, "Errors occured while interpreting MetaPost file.\n\n");
     }
     /* Finish off the form */
     end_form_xobj();
   } else {
     fprintf (stderr, "\nErrors occured while scanning MetaPost file headers.\n");
   }
   mp_cleanup(0);
   return xobj;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct xform_info* texfig_info ( void  ) [read]