Menu
CTAN
Comprehensive TeX Archive Network
Cover Upload Browse

Direc­tory tex-archive/dviware/umddvi/lib

This directory is for library routines.  They are hopefully now 99%
portable, but only time (and new machines) will tell.

File		Functions
----------------------------------------------------------------------
bcopy.s		bcopy(from, to, count)
		char *from, *to;
		int count;

		Copies `count' bytes from location `from' to
		location `to'
----------------------------------------------------------------------
bzero.s		bzero(addr, count)
		char *addr;
		int count;

		Zeroes `count' bytes starting at location `addr'
----------------------------------------------------------------------
error.c		error(quit, errno, fmt, arg1, arg2, ...)
		int quit, errno;
		char *fmt;

		Prints the message in `fmt' to stderr as would
		fprintf, along with the (optional) system error
		associated with `errno'.  If `quit' is nonzero,
		does an exit(quit).  Give 0 for errno to suppress
		the system error part.
----------------------------------------------------------------------
findpost.c	FindPostAmble(f)
		FILE *f;

		Repositions the file `f' (using fseek(3S)) to
		the beginning of the postamble, such that the next
		getc from f should return DVI_POST.

		Returns 0 if successful, -1 otherwise.
----------------------------------------------------------------------
fio.c		GetLong(f)
[See also	FILE *f;
../h/fio.h]
		Gets a `long' from file `f' in the format written
		by PutLong.  [This should actually be an `i32'
		function but I am too lazy to go fix that now.]
		------------------------------------------------------
		Get3Byte(f)
		FILE *f;

		Gets a 3 byte integer from file `f' in the format
		written by Put3Byte.  The value is sign extended.
		------------------------------------------------------
		GetWord(f)
		FILE *f;

		Gets a 2 byte integer from file `f'.  The value is
		sign extended.
		------------------------------------------------------
		GetByte(f)
		FILE *f;

		Gets a 1 byte integer from file `f'.  The value is
		sign extended.

		All of these have counterparts in ../h/fio.h which
		may be used in speed-critical routines.  However, these
		differ from the fGet* versions in that:
		   + these check for EOF (and call error if found);
		   + these sign extend their return values.
----------------------------------------------------------------------
getopt.c	extern char *optarg;
[From Henry	extern int optind;
Spencer @
U of Toronto	int
Zoology]	getopt(argc, argv, optstring)
		int argc;
		char **argv;
		char *optstring;

		`argv' and `argc' should be those given to main().
		getopt scans command line arguments according to the
		string in `optstring'.  Arguments are considered to
		start with `-'.  A quick example:

			switch (getopt(argc, argv, "bco:s:")) {
			case 'b': ...

		would allow the options `-b', `-c', `-o argument', and
		and `-s argument', and would return 'b', 'c', 'o', or
		's', if one of those were specified.  If getopt runs out
		of arguments, it returns EOF; if it encounters an invalid
		option letter (e.g., `-z' in this example) it returns '?'.

		If the option has an argument, getopt leaves `optarg'
		pointing to it.

		After getopt returns EOF, the remaining arguments (if
		any) are in argv[optind] through argv[argc - 1].
----------------------------------------------------------------------
***deprecated***
machint.s	machint(addr, count)
		int *addr;
		int count;

		Converts `count' 4 byte integers at location `addr'
		to machine order.  This is used to convert arrays of
		integers in the order generated and written by PutLong
		and GetLong to and from machine order.
----------------------------------------------------------------------
***deprecated***
machintnop.c	machint(addr, count)
		int *addr;
		int count;

		No-op version for Suns & Pyramids.
----------------------------------------------------------------------
***deprecated***
pxl.c		double DMagFactor(magfactor)
		int magfactor;

		Returns magfactor/1000.0, with some extra fiddling
		to get more precise values for the various \magstep's
		that are commonly used.
		------------------------------------------------------
		char *GenPXLFileName(nm, mag, designsize, globalmag, path)
		char *nm;
		int mag, designsize, globalmag;
		char *path;

		Returns (in static storage) the name of the PXL
		file given the name of the font `nm', the DVI
		magnification (`at size') `mag', the design
		size `designsize', an additional magnification
		of `globalmag/1000.0', and the assumed path
		`path'.  If path is zero (or *path is 0), the
		constant PXLPATH (from ../h/pxl.h) is used instead.
		`Path' should normally be the value of the
		environment variable ``TEXFONTS''.
		------------------------------------------------------
		struct pxltail *ReadPXLFile(nm, getrast)
		char *nm;
		int getrast;

		Reads the named PXL file and returns a pointer to
		a built-up struct pxltail.  `Nm' should be the
		name as returned by GenPXLFileName.  If `getrast'
		is nonzero, the character rasters will also be
		read in, and the raster pointers in the chinfo
		structures will be set to point to each character's
		raster (or to 0 if the raster is completely blank).
----------------------------------------------------------------------
***XXX***
rotate.c	PerformRotation(ch, deg)
		struct chinfo *ch;
		int deg;

		Rotates the bitmap of the character `ch', and
		exchanges the height and width fields so that the
		new bitmap is indistinguishable from the original
		as far as those values are concerned.  `deg' is
		the number of degrees of rotation desired and must
		be a multiple of 90.  Currently only -90 (and 270)
		degree rotations are supported (this is one quarter
		turn clockwise).

		The rotation is done in place.

		In general, this should only be used in the final
		output stages of a device that needs `landscape
		mode' output.
----------------------------------------------------------------------
***XXX***
scaletfm.c	ScaleTFMWidths(px, z)
		struct pxltail *px;
		i32 z;

		Scales all the TFM widths in px->px_info according to
		the scale factor `z', which should be the `at size'
		from a DVI file (i.e., a number in scaled points).

		i32 ScaleOneWidth(width, z)
		i32 width, z;

		Scales the (single) TFM width `width' by `z'.
----------------------------------------------------------------------
scanpost.c	ScanPostAmble(f, headerfunc, fontfunc)
		FILE *f;
		int (*headerfunc)(), (*fontfunc)();

		Scans the postamble of a DVI file.  The given functions
		are called with the information gleaned from reading the
		postamble.  Headerfunc is called once, and fontfunc once
		per font definition.
		
		See ../h/postamble.h for the definitions of the
		parameters passed to the two functions.
----------------------------------------------------------------------
search.c	struct search *SCreate(dsize)
		unsigned dsize;

		Creates a search table; keys are i32 integers, data
		objects are of size dsize and of unspecified type.  A
		null pointer is returned if the table cannot be created.

		SEnumerate(table, func)
		struct search *table;
		int (*func)();

		Invokes the given function on each object in the table.
		The function is handed a "char *" pointer to the objects
		as its first argument and the i32 key as its second.
		(The return value from (*func)(), if any, is ignored;
		technically it should be void (*func)(), but that is
		not implemented quite right in many Unix compilers...)

		char *SSearch(table, key, disp)
		struct search *table;
		i32 key;
		int *disp;

		Searches for a given key within the given search
		table.  A number of dispositions can be specified;
		see ../h/search.h for the flags that can be specified
		in *disp.  *disp is modified before return to set
		the reason for the search success or failure.  The
		return value is a pointer to the user data area
		for the given key if found, otherwise NULL.

		WARNING: data areas may move on future searches that
		create new data objects.
----------------------------------------------------------------------
seek.c		int Seekable(fd)
		int fd;

		Returns true iff the Unix file fd is randomly
		accessible.  (In particular, pipes are not.)

		int MakeSeekable(f)
		FILE *f;

		If the stdio file f is not seekable, MakeSeekable
		forces it to be so, by copying it to a temporary
		file.  MakeSeekable returns zero on success; -1
		indicates failure.
----------------------------------------------------------------------
strsave.c	char *strsave(s)
		char *s;

		Saves a malloc()ed copy of the C string s.  (Beware:
		exits if out of memory.)

Direc­to­ries

Name Notes
man

Files

Name Size Date Notes
bcopy.s 819 1990-10-02 01:00
bzero.s 734 1990-10-02 01:00
conv.c 1244 1990-10-02 01:00
dviclass.c 3179 1990-10-02 01:00
error.c 2041 1990-10-02 01:00
findpost.c 2210 1990-10-02 01:00
fio.c 902 1990-10-02 01:00
font.c 9344 1990-10-02 01:00
font_subr.c 4789 1990-10-02 01:00
getopt.c 1380 1990-10-02 01:00
gfclass.c 2345 1990-10-02 01:00
gffont.c 21679 1990-10-02 01:00
gripes.c 2983 1990-10-02 01:00
llib-lib 2246 1990-10-02 01:00
magfactor.c 869 1990-10-02 01:00
makefile 4362 1990-10-02 01:00
makefile.3b 4061 1990-10-02 01:00
note 526 1990-10-02 01:00
pkfont.c 17552 1990-10-02 01:00
pxlfont.c 6615 1990-10-02 01:00
readme 8480 1990-10-02 01:00
rotate.c 3408 1990-10-02 01:00
scaletfm.c 3239 1990-10-02 01:00
scanpost.c 2123 1990-10-02 01:00
search.c 4505 1990-10-02 01:00
seek.c 2981 1990-10-02 01:00
split.c 4540 1990-10-02 01:00
strsave.c 522 1990-10-02 01:00
tfm.c 2294 1990-10-02 01:00
tfmfont.c 5417 1990-10-02 01:00
Guest Book Sitemap Contact