From 5fd7c5b7856f6d0ddce676a02b5f35dd074ece62 Mon Sep 17 00:00:00 2001 From: root <> Date: Sun, 8 Feb 2009 18:28:31 +0000 Subject: *** empty log message *** --- src/libjwg.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'src/libjwg.c') diff --git a/src/libjwg.c b/src/libjwg.c index 63541e8..b86fbda 100644 --- a/src/libjwg.c +++ b/src/libjwg.c @@ -4,14 +4,23 @@ /* Kludgy stuff to handle fortran */ -Handle_list handle_list; -int list_created=0; -int serial; +static Handle_list handle_list; +static int list_created=0; +static int serial; +static void Data_Destructor(Data data); +static void Handle_Destructor(Handle handle); + +CONSTRUCTOR(Data)=GObj_DefaultConstructor; +DESTRUCTOR(Data)=Data_Destructor; + +CONSTRUCTOR(Handle)=GObj_DefaultConstructor; +DESTRUCTOR(Handle)=Handle_Destructor; + /* Destructors */ -void Data_Destructor(Data data) +static void Data_Destructor(Data data) { if (data->data) free(data->data); @@ -19,7 +28,7 @@ printf("JWG: Freeing data at %08x\n",(unsigned int) data->data); } -void Handle_Destructor(Handle handle) +static void Handle_Destructor(Handle handle) { printf("JWG: Destroying handle %d\n",handle->serial); @@ -35,10 +44,7 @@ free(handle); } - - - -Handle handle_from_serial(int serial) +static Handle handle_from_serial(int serial) { Handle ret; @@ -59,7 +65,7 @@ return(ret); /* C visible stuff */ -char * jwg_fiddle_text(char *str,int len) +static char * jwg_fiddle_text(char *str,int len) { char *s,*ptr; @@ -83,7 +89,7 @@ return(s); } -void jwg_xform(Handle h,Jwgpos *pos) +static void jwg_xform(Handle h,Jwgpos *pos) { float x,y; @@ -96,7 +102,7 @@ pos->y=h->transform.yc+(h->transform.c*x)+(h->transform.d*y); } -void jwg_recalc_det(Handle h) +static void jwg_recalc_det(Handle h) { Transform t=h->transform; @@ -114,7 +120,7 @@ if (h->transform.det==0.0) { /* N describes the handedness of the devices */ /* coord system 1=left handed (assumes y is inverted) */ -float jwg_decompose_matrix(Transform t,int n) +static float jwg_decompose_matrix(Transform t,int n) { float m1,m2,r; float th; @@ -156,7 +162,7 @@ th=atan2(t.c,t.a); return(th); } -Transform jwg_unitize(Transform t) +static Transform jwg_unitize(Transform t) { Transform ret; @@ -174,7 +180,7 @@ return(ret); -void init_pen(Pen *pen) +static void init_pen(Pen *pen) { pen->width=0.0; pen->color.r=0.0; @@ -182,7 +188,7 @@ pen->color.g=0.0; pen->color.b=0.0; } -void init_brush(Brush *brush) +static void init_brush(Brush *brush) { brush->density=1.0; brush->color.r=0.0; @@ -191,7 +197,7 @@ brush->color.b=0.0; } -void init_ink(Ink *ink) +static void init_ink(Ink *ink) { ink->font=0; ink->color.r=0.0; @@ -200,7 +206,7 @@ ink->color.b=0.0; ink->height=10.0; } -void init_transform(Handle h) +static void init_transform(Handle h) { @@ -232,7 +238,7 @@ h->ink.height*=h->transform.det; } -void jwg_write_line(Handle h,Jwgline *line) +static void jwg_write_line(Handle h,Jwgline *line) { @@ -249,7 +255,7 @@ case 1: } -void jwg_write_polygon(Handle h,Jwgline *line) +static void jwg_write_polygon(Handle h,Jwgline *line) { switch (h->format) { @@ -267,7 +273,7 @@ case 1: } -jwg_print_transform(Transform t) +static void jwg_print_transform(Transform t) { printf("/%03.3f %03.3f %03.3f\\\n",t.a,t.b,t.xc); printf("|%03.3f %03.3f %03.3f|\n",t.c,t.d,t.yc); -- cgit v1.2.3