aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <>2009-02-08 18:05:29 +0000
committerroot <>2009-02-08 18:05:29 +0000
commit1e8520cad5c20db41d5eb890bd365e6f60bfaf9a (patch)
tree8c7f01031f1512e981cb27a47f465a3080019fde
parenta25164b25fb68bd329c1ba9689ba894cb1c5e9b8 (diff)
downloadlibjwg-1e8520cad5c20db41d5eb890bd365e6f60bfaf9a.tar.gz
libjwg-1e8520cad5c20db41d5eb890bd365e6f60bfaf9a.tar.bz2
libjwg-1e8520cad5c20db41d5eb890bd365e6f60bfaf9a.zip
*** empty log message ***
-rw-r--r--src/Makefile.am13
-rw-r--r--src/f-ftext.f29
-rw-r--r--src/ftext.c0
-rw-r--r--src/libjwg.c8
-rw-r--r--src/xfig.c41
5 files changed, 35 insertions, 56 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 7ba2f98..bdcdee9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,6 +8,9 @@
# $Id$
#
# $Log$
+# Revision 1.6 2009/02/08 18:05:29 root
+# *** empty log message ***
+#
# Revision 1.5 2009/02/08 17:07:09 root
# *** empty log message ***
#
@@ -29,7 +32,7 @@
INCLUDES = ${LIBGOBJ_INC}
-SRCS= libjwg.c version.c cgm.c contour.c ctext.c ftext.c version.c xfig.c
+SRCS= libjwg.c version.c cgm.c contour.c version.c xfig.c
CPROTO=cproto
JWGSRCS=${SRCS}
@@ -37,15 +40,13 @@ JWGSRCS=${SRCS}
noinst_HEADERS= project.h prototypes.h jwg-tail.h ext_prototypes.h
-libjwg_a_SOURCES = ${JWGSRCS} f-ftext.f
-libjwg_la_SOURCES = ${JWGSRCS} fa-ftext.f
+libjwg_a_SOURCES = ${JWGSRCS}
+libjwg_la_SOURCES = ${JWGSRCS}
libjwg_a_CFLAGS = ${AM_CFLAGS}
-BUILT_SOURCES = version.h jwg.h fa-ftext.f
+BUILT_SOURCES = version.h jwg.h
-fa-ftext.f:f-ftext.f
- cp $< $@
lib_LIBRARIES=libjwg.a
lib_LTLIBRARIES=libjwg.la
diff --git a/src/f-ftext.f b/src/f-ftext.f
deleted file mode 100644
index f1de29d..0000000
--- a/src/f-ftext.f
+++ /dev/null
@@ -1,29 +0,0 @@
- function jwg_open_textunit
-
- integer jwg_priv_init_textlist*4
-
- parameter (default_textunit=32767)
-
- character textpipe*1024
- integer textunit*4,setup*4
-
-
- setup=jwg_priv_init_textlist
-
-C Is all this gubbins working or do we need to fiddle?
-
- if (setup.ne.0) then
-C
-C this will check that the string is correctly passed
-C
- textpipe='sanity check'
-
- call jwg_priv_setup_textpipe(textpipe)
-
- textunit=default_textunit
- open (file=textpipe,unit=textunit,action='write',status=old)
-
- endif
-
- jwg_open_textunit=textunit
-
diff --git a/src/ftext.c b/src/ftext.c
deleted file mode 100644
index e69de29..0000000
--- a/src/ftext.c
+++ /dev/null
diff --git a/src/libjwg.c b/src/libjwg.c
index 7678091..63541e8 100644
--- a/src/libjwg.c
+++ b/src/libjwg.c
@@ -287,7 +287,7 @@ name=jwg_fiddle_text(fname,len);
if (!list_created) {
printf("JWG: Initializing\n");
- handle_list=CREATE_LIST(Handle);
+ handle_list=NEW_LIST(Handle);
serial=1;
}
@@ -296,7 +296,7 @@ if (!name) {
return(0);
}
-ret=CREATE_OBJ(Handle);
+ret=NEW(Handle);
printf("JWG: Creating handle %d\n",serial);
@@ -343,7 +343,7 @@ default:
-Obj_Insert(handle_list,ret,ObjInsertTail);
+GObj_InsertTail(handle_list,ret);
return(ret->serial);
}
@@ -362,7 +362,7 @@ if (ha->data) {
return;
}
-data=CREATE_OBJ(Data);
+data=NEW(Data);
ha->data=data;
data->w=(*w)+2;
diff --git a/src/xfig.c b/src/xfig.c
index 10da5e4..913ba26 100644
--- a/src/xfig.c
+++ b/src/xfig.c
@@ -1,24 +1,33 @@
#include "project.h"
-BEGIN_OBJECT(Xfc)
- int r,g,b,n;
-END_OBJECT(Xfc)
-
-CREATOR(Xfc)=Obj_DefaultCreator;
-DESTRUCTOR(Xfc)=Obj_DefaultDestructor;
+OBJECT(Xfc,
+ int r;
+ int g;
+ int b;
+ int n;
+);
+
+CONSTRUCTOR(Xfc)=GObj_DefaultConstructor;
+DESTRUCTOR(Xfc)=GObj_DefaultDestructor;
-BEGIN_OBJECT(Private)
+OBJECT(Private,
Xfc_list xfcs;
int maxcol;
FILE *tmpfile;
FILE *file;
-END_OBJECT(Private)
+);
+
+static void private_constructor(Private);
+static void private_destructor(Private);
+
+CONSTRUCTOR(Private)=private_constructor;
+DESTRUCTOR(Private)=private_destructor;
static void private_constructor(Private p)
{
char name[1024];
-p->xfcs=CREATE_LIST(Xfc);
+p->xfcs=NEW_LIST(Xfc);
p->tmpfile=fopen(tmpnam(name),"w+");
@@ -28,12 +37,12 @@ unlink(name);
}
-#define BUFSIZ 1024
+#define XFIG_BUFSIZ 1024
static void private_destructor(Private p)
{
Xfc c;
-char buf[BUFSIZ];
+char buf[XFIG_BUFSIZ];
int i;
fflush(p->tmpfile);
@@ -54,7 +63,7 @@ Obj_Delete(p->xfcs);
printf("JWG: Writing xfig file\n");
-while ((i=fread(buf,1,BUFSIZ,p->tmpfile))>0) {
+while ((i=fread(buf,1,XFIG_BUFSIZ,p->tmpfile))>0) {
fwrite(buf,1,i,p->file);
}
@@ -69,8 +78,6 @@ free(p);
}
-CREATOR(Private)=private_constructor;
-DESTRUCTOR(Private)=private_destructor;
@@ -79,7 +86,7 @@ void xfig_init_private(Handle h)
{
Private p;
-p=CREATE_OBJ(Private);
+p=NEW(Private);
p->maxcol=32;
p->file=h->file;
@@ -109,13 +116,13 @@ if (p->maxcol==512) {
return(32);
}
-c=CREATE_OBJ(Xfc);
+c=NEW(Xfc);
c->r=r;
c->g=g;
c->b=b;
c->n=(p->maxcol++);
-Obj_Insert(p->xfcs,c,ObjInsertHead);
+GObj_InsertTail(p->xfcs,c);
return(c->n);