Back to index

tetex-bin  3.0
Functions | Variables
papersiz.c File Reference
#include "dvips.h"
#include "protos.h"

Go to the source code of this file.

Functions

static long scale P4C (long, whole, long, num, long, den, long, sf)
static long myatol P1C (char **, s)
void handlepapersize P3C (char *, p, integer *, x, integer *, y)

Variables

static long scalevals []
static char * scalenames = "cmptpcmmspbpddccin"

Function Documentation

long myatodim P1C ( char **  ,
s   
) [static]

Definition at line 31 of file papersiz.c.

{
   register char *p ;
   register long result ;

   result = 0 ;
   p = *s ;
   while ('0' <= *p && *p <= '9') {
      if (result > 100000000)
         error("! arithmetic overflow in parameter") ;
      result = 10 * result + *p++ - '0' ;
   }
   if (p == *s) {
#ifdef KPATHSEA
      error(concat3 ("expected number in ", *s, ", returning 10")) ;
#else
      error("expected number!  returning 10") ;
#endif
      return 10 ;
   } else {
      *s = p ;
      return(result) ;
   }
}

Here is the call graph for this function:

void handlepapersize P3C ( char *  ,
p  ,
integer ,
x  ,
integer ,
y   
)

Definition at line 118 of file papersiz.c.

{ 
   while (*p == ' ')
      p++ ;
   *x = myatodim(&p) ;
   while (*p == ' ' || *p == ',')
      p++ ;
   *y = myatodim(&p) ;
}

Here is the call graph for this function:

static long scale P4C ( long  ,
whole  ,
long  ,
num  ,
long  ,
den  ,
long  ,
sf   
) [static]

Definition at line 16 of file papersiz.c.

{
   long v ;

   v = whole * sf + num * (sf / den) ;
   if (v / sf != whole || v < 0 || v > 0x40000000L)
      error("! arithmetic overflow in parameter") ;
   sf = sf % den ;
   v += (sf * num * 2 + den) / (2 * den) ;
   return(v) ;
}

Here is the call graph for this function:


Variable Documentation

char* scalenames = "cmptpcmmspbpddccin" [static]

Definition at line 61 of file papersiz.c.

long scalevals[] [static]
Initial value:
 { 1864680L, 65536L, 786432L, 186468L,
                            1L, 65782L, 70124L, 841489L, 4736286L }

Definition at line 59 of file papersiz.c.