Back to index

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

Go to the source code of this file.

Functions

int ps_parse_special (char *buffer, UNSIGNED_QUAD size, double x_user, double y_user)

Function Documentation

int ps_parse_special ( char *  buffer,
UNSIGNED_QUAD  size,
double  x_user,
double  y_user 
)

Definition at line 214 of file psspecial.c.

{
  char *start = buffer, *end;
  static int block_pending = 0;
  static double pending_x=0.0, pending_y=0.0;
  int result = 0;
  end = buffer + size;
  skip_white (&start, end);
  if (!strncmp (start, "PSfile", strlen("PSfile")) ||
      !strncmp (start, "psfile", strlen("PSfile"))) {
    result = 1; /* This means it is a PSfile special, not that it was
                 successful */
    parse_psfile(&start, end, x_user, y_user);
  } else if (!strncmp (start, "ps::[begin]", strlen("ps::[begin]"))) {
    start += strlen("ps::[begin]");
    block_pending = 1;
    pending_x = x_user;
    pending_y = y_user;
    result = 1; /* Likewise */
    do_raw_ps_special (&start, end, 1, x_user, y_user);
  } else if (!strncmp (start, "ps::[end]", strlen("ps::[end]"))) {
    if (block_pending) {
      start += strlen("ps::[end]");
      do_raw_ps_special (&start, end, 1, pending_x, pending_y);
      block_pending = 0;
    } else {
      fprintf (stderr, "\nps::[end] without ps::[begin] ignored.\n");
    }
    result = 1; /* Likewise */
  } else if (!strncmp (start, "ps: plotfile", strlen("ps: plotfile"))) {
    /* This is a bizarre, ugly  special case.. Not really postscript
       code */
    start += strlen ("ps: plotfile");
    result = 1;
    do_texfig (&start, end);
  } else if (!strncmp (start, "ps::", strlen("ps::")) ||
            !strncmp (start, "PS::", strlen("PS::"))) {
    /* dvipdfm doesn't distinguish between ps:: and ps: */
    start += 4;
    result = 1; /* Likewise */
    do_raw_ps_special (&start, end, 1, 
                     block_pending?pending_x:x_user, block_pending?pending_y:y_user);
  } else if (!strncmp (start, "ps:", strlen("ps:")) ||
            !strncmp (start, "PS:", strlen("PS:"))) {
    start += 3;
    result = 1; /* Likewise */
    do_raw_ps_special (&start, end, 1,
                     block_pending?pending_x:x_user, block_pending?pending_y:y_user);
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function: