--- ray/src/px/psign.c 2003/10/22 02:06:35 2.24 +++ ray/src/px/psign.c 2011/05/20 02:06:39 2.27 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: psign.c,v 2.24 2003/10/22 02:06:35 greg Exp $"; +static const char RCSid[] = "$Id: psign.c,v 2.27 2011/05/20 02:06:39 greg Exp $"; #endif /* * psign.c - produce picture from text. @@ -13,6 +13,7 @@ static const char RCSid[] = "$Id: psign.c,v 2.24 2003/ #include "platform.h" #include "standard.h" +#include "resolu.h" #include "color.h" #include "font.h" @@ -62,10 +63,21 @@ LINE *ourtext; /* our text */ int nlines, maxline; /* text dimensions */ int maxwidth; /* maximum line width (dvi) */ +static void makemap(void); +static void get_text(FILE *fp); +static void arg_text(int ac, char *av[]); +static void maptext(void); +static void mapglyph(GLYPH *gl, int tx0, int ty0); +static void mapcoord(int p[2], int tx, int ty); +static void mapedge(int x, int y, int run, int rise); +static void writemap(FILE *fp); -main(argc, argv) -int argc; -char *argv[]; + +int +main( + int argc, + char *argv[] +) { int an; SET_FILE_BINARY(stdout); @@ -129,7 +141,7 @@ unkopt: ourfont = getfont(fontfile); /* get text */ if (an == argc) - gettext(stdin); + get_text(stdin); else arg_text(argc-an, argv+an); @@ -149,7 +161,8 @@ unkopt: } -makemap() /* create the bit map */ +static void +makemap(void) /* create the bit map */ { double pictaspect; @@ -205,15 +218,17 @@ makemap() /* create the bit map */ if (ysiz % SSS) ysiz += SSS - ysiz%SSS; xdim = (xsiz+7)/8; - ourbitmap = (BYTE *)bmalloc(ysiz*xdim); + ourbitmap = (uby8 *)bmalloc(ysiz*xdim); if (ourbitmap == NULL) error(SYSTEM, "Out of memory in makemap"); memset((char *)ourbitmap, '\0', ysiz*xdim); } -gettext(fp) /* get text from a file */ -FILE *fp; +static void +get_text( /* get text from a file */ + FILE *fp +) { char buf[MAXLINE]; register LINE *curl; @@ -251,13 +266,15 @@ FILE *fp; } return; memerr: - error(SYSTEM, "Out of memory in gettext"); + error(SYSTEM, "Out of memory in get_text"); } -arg_text(ac, av) /* get text from arguments */ -int ac; -char *av[]; +static void +arg_text( /* get text from arguments */ + int ac, + char *av[] +) { register char *cp; @@ -293,7 +310,8 @@ memerr: } -maptext() /* map our text */ +static void +maptext(void) /* map our text */ { register LINE *curl; int l, len; @@ -309,9 +327,12 @@ maptext() /* map our text */ } -mapglyph(gl, tx0, ty0) /* convert a glyph */ -GLYPH *gl; -int tx0, ty0; +static void +mapglyph( /* convert a glyph */ + GLYPH *gl, + int tx0, + int ty0 +) { int n; register GORD *gp; @@ -332,8 +353,12 @@ int tx0, ty0; } -mapcoord(p, tx, ty) /* map text to picture coordinates */ -int p[2], tx, ty; +static void +mapcoord( /* map text to picture coordinates */ + int p[2], + int tx, + int ty +) { tx = (long)tx*cwidth >> 8; ty = (long)ty*cheight >> 8; @@ -359,9 +384,13 @@ int p[2], tx, ty; } -mapedge(x, y, run, rise) /* map an edge */ -register int x, y; -int run, rise; +static void +mapedge( /* map an edge */ + register int x, + register int y, + int run, + int rise +) { int xstep; int rise2, run2; @@ -396,8 +425,10 @@ int run, rise; } -writemap(fp) /* write out bitmap */ -FILE *fp; +static void +writemap( /* write out bitmap */ + FILE *fp +) { COLR pixval[SSS*SSS+1]; /* possible pixel values */ COLOR ctmp0, ctmp1;