From 865a3d86d458695eff512addb8ef2bbef19e866a Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 23 Jan 2008 20:52:43 +0000 Subject: [PATCH] Add smyrna to main graphviz tree --- lib/utilities/Makefile.am | 23 +++++++++++++ lib/utilities/abstring.c | 71 +++++++++++++++++++++++++++++++++++++++ lib/utilities/abstring.h | 34 +++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 lib/utilities/Makefile.am create mode 100755 lib/utilities/abstring.c create mode 100755 lib/utilities/abstring.h diff --git a/lib/utilities/Makefile.am b/lib/utilities/Makefile.am new file mode 100644 index 000000000..02c79669f --- /dev/null +++ b/lib/utilities/Makefile.am @@ -0,0 +1,23 @@ +# $Id$ $Revision$ +# ## Process this file with automake to produce Makefile.in +# +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/cmd/smyrna \ + -I$(top_srcdir)/lib/utilities \ + -I$(top_srcdir)/lib/xdot \ + -I$(top_srcdir)/lib/cgraph \ + -I$(top_srcdir)/lib/cdt \ + $(GTK_CFLAGS) $(GTKGL_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) + +if WITH_SMYRNA +noinst_HEADERS = \ + abstring.h glTexFontDefs.h glTexFont.h glTexFontInclude.h \ + glTexFontTGA.h opengl_pango.h selection.h + +noinst_LTLIBRARIES = libutilities_C.la +endif + +libutilities_C_la_SOURCES = \ + abstring.c glTexFont.c glTexFontColor.c glTexFontTGA.c \ + opengl_pango.c selection.c diff --git a/lib/utilities/abstring.c b/lib/utilities/abstring.c new file mode 100755 index 000000000..657568a8c --- /dev/null +++ b/lib/utilities/abstring.c @@ -0,0 +1,71 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +//string utilities +//supports memory allocation +//this library works with \0 terminated strings +#include "stdio.h" +#include "abstring.h" +#define MAXSTRINGLENGTH 1000 +int ABLength(char* s) +{ + //length does not include the \0 + int id=0; + while ((s[id]) && (id < MAXSTRINGLENGTH)) + id++; + if (id==MAXSTRINGLENGTH) + return -1; + else + return id; +} +char* ABSet(char* s) +{ + char* a; + a=(char*)realloc(a, ABLength(s)+1); + strcpy(a,s); +} +char* ABJoin(char* s1,char* s2) +{ + char* a; + int i=0; + a=(char*)realloc(a, ABLength(s1)+ABLength(s2)+1); + + a=strncat(a, s1,ABLength(s1)); + a=strncat(a, s2,ABLength(s2)+1); + +} + +int ABRemove(char** s1,char s2) +{ + + int cursor,cursor2; + char BUFFER[255]; + char* test=*s1; + cursor=0; + cursor2=0; + for (cursor=0;(*s1)[cursor] != '\0' ; cursor ++) + { + if ((*s1)[cursor] != s2) + { + BUFFER[cursor2]=(*s1)[cursor]; + cursor2++; + } + } + BUFFER[cursor2]='\0'; + *s1=realloc(*s1,strlen(BUFFER)+1); + strcpy(*s1,BUFFER); + +} diff --git a/lib/utilities/abstring.h b/lib/utilities/abstring.h new file mode 100755 index 000000000..02e72a6ec --- /dev/null +++ b/lib/utilities/abstring.h @@ -0,0 +1,34 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +//string utilities +//supports memory allocation +//this library works with \0 terminated strings + +#include "viewport.h" +int ABLength(char* s); +char* ABSet(char* s); +char* ABJoin(char* s1,char* s2); +int ABRemove(char** s1,char s2); +//char* ABTrim(char* s); +//char* ABRemove(char* s,char* param) + + + +//char* ABSubString(char* s,int a,int b); +//char* ABUpperCase(char* s); +//char* ABLowerCase(char* s); + -- 2.40.0