gvplugin_render.h \
gvplugin_layout.h \
gvplugin_textlayout.h \
- gvplugin_device.h
+ gvplugin_device.h \
+ dot_builtins.c \
+ demand_loading.c no_demand_loading.c
noinst_HEADERS = gvcproc.h
noinst_LTLIBRARIES = libgvc_C.la
pkglib_LTLIBRARIES = libgvc.la libgvc_builtins.la
-pkgconfig_DATA = libgvc.pc
+pkgconfig_DATA = libgvc.pc libgvc_builtins.pc
-libgvc_C_la_SOURCES = gvrender.c gvlayout.c gvdevice.c \
- gvcontext.c gvjobs.c gvevent.c gvplugin.c gvconfig.c \
- gvtextlayout.c gvusershape.c gvc.c
-libgvc_C_la_LIBADD = \
- $(top_builddir)/lib/common/libcommon_C.la
+libgvc_C_la_SOURCES = gvrender.c gvlayout.c gvdevice.c gvcontext.c gvjobs.c \
+ gvevent.c gvplugin.c gvconfig.c gvtextlayout.c gvusershape.c gvc.c
+libgvc_C_la_LIBADD = $(top_builddir)/lib/common/libcommon_C.la
-#libgvc is intended for use with plugins
+#For use with plugins.
# so it is linked with an empty table of builtins.
libgvc_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
-libgvc_la_SOURCES = $(libgvc_C_la_SOURCES) no_builtins.c
+libgvc_la_SOURCES = $(libgvc_C_la_SOURCES) no_builtins.c demand_loading.c
libgvc_la_LIBADD = $(libgvc_C_la_LIBADD) \
$(top_builddir)/lib/cdt/libcdt.la \
$(top_builddir)/lib/graph/libgraph.la \
$(top_builddir)/lib/pathplan/libpathplan.la \
@GD_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ @LIBGEN_LIBS@
-#libgvc_builtins is intended for use with builtins (still allowing plugins).
-# The application needs to provide a table of builtins, dot_builtins.c
-# provides and example.
+#For use without plugins.
+# so it needs to be linked with a preset table of builtins, e.g. dot_builtins.c,
+# with either demand_loading.c or no_demand_loading.c,
+# and with the plugins themselves, e.g.
+# -lgvplugin_dot_layout -lgvplugin_neato_layout -lgvplugin_gd -lgvplugin_pangocairo
libgvc_builtins_la_LDFLAGS = -version-info @VERSION_INFO@
libgvc_builtins_la_SOURCES = $(libgvc_C_la_SOURCES)
libgvc_builtins_la_LIBADD = $(libgvc_la_LIBADD)
-EXTRA_DIST = Makefile.old dot_builtins.c
+EXTRA_DIST = Makefile.old
--- /dev/null
+/* $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 *
+**********************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "arith.h"
+
+const bool Demand_Loading = true;
#include "gvcint.h"
#include "gvcproc.h"
+extern const bool Demand_Loading;
+
#ifdef WITH_CODEGENS
#ifdef QUARTZ_RENDER
#include <QuickTime/QuickTime.h>
gvc->config_found = FALSE;
#ifdef ENABLE_LTDL
- /* see if there are any new plugins */
- libdir = gvconfig_libdir();
- rc = stat(libdir, &libdir_st);
- if (rc == -1) {
- /* if we fail to stat it then it probably doesn't exist so just fail silently */
- return;
- }
-
- if (! gvc->config_path) {
- gvc->config_path = gmalloc(strlen(libdir) + 1 + strlen(config_file_name) + 1);
- strcpy(gvc->config_path, libdir);
- strcat(gvc->config_path, "/");
- strcat(gvc->config_path, config_file_name);
- }
-
- if (rescan) {
- config_rescan(gvc, gvc->config_path);
- gvc->config_found = TRUE;
- return;
- }
-
- /* load in the cached plugin library data */
-
- rc = stat(gvc->config_path, &config_st);
- if (rc == -1) {
- /* silently return without setting gvc->config_found = TRUE */
- return;
- }
- else if (config_st.st_size > MAX_SZ_CONFIG) {
- agerr(AGERR,"%s is bigger than I can handle.\n", gvc->config_path);
- }
- else {
- f = fopen(gvc->config_path,"r");
- if (!f) {
- agerr (AGERR,"failed to open %s for read.\n", gvc->config_path);
- }
- else {
- config_text = gmalloc(config_st.st_size + 1);
- sz = fread(config_text, 1, config_st.st_size, f);
- if (sz == 0) {
- agerr(AGERR,"%s is zero sized, or other read error.\n", gvc->config_path);
- free(config_text);
- }
- else {
- gvc->config_found = TRUE;
- config_text[sz] = '\0'; /* make input into a null terminated string */
- rc = gvconfig_plugin_install_from_config(gvc, config_text);
- /* NB. config_text not freed because we retain char* into it */
- }
- }
- if (f)
- fclose(f);
+ if (Demand_Loading) {
+ /* see if there are any new plugins */
+ libdir = gvconfig_libdir();
+ rc = stat(libdir, &libdir_st);
+ if (rc == -1) {
+ /* if we fail to stat it then it probably doesn't exist so just fail silently */
+ return;
+ }
+
+ if (! gvc->config_path) {
+ gvc->config_path = gmalloc(strlen(libdir) + 1 + strlen(config_file_name) + 1);
+ strcpy(gvc->config_path, libdir);
+ strcat(gvc->config_path, "/");
+ strcat(gvc->config_path, config_file_name);
+ }
+
+ if (rescan) {
+ config_rescan(gvc, gvc->config_path);
+ gvc->config_found = TRUE;
+ return;
+ }
+
+ /* load in the cached plugin library data */
+
+ rc = stat(gvc->config_path, &config_st);
+ if (rc == -1) {
+ /* silently return without setting gvc->config_found = TRUE */
+ return;
+ }
+ else if (config_st.st_size > MAX_SZ_CONFIG) {
+ agerr(AGERR,"%s is bigger than I can handle.\n", gvc->config_path);
+ }
+ else {
+ f = fopen(gvc->config_path,"r");
+ if (!f) {
+ agerr (AGERR,"failed to open %s for read.\n", gvc->config_path);
+ }
+ else {
+ config_text = gmalloc(config_st.st_size + 1);
+ sz = fread(config_text, 1, config_st.st_size, f);
+ if (sz == 0) {
+ agerr(AGERR,"%s is zero sized, or other read error.\n", gvc->config_path);
+ free(config_text);
+ }
+ else {
+ gvc->config_found = TRUE;
+ config_text[sz] = '\0'; /* make input into a null terminated string */
+ rc = gvconfig_plugin_install_from_config(gvc, config_text);
+ /* NB. config_text not freed because we retain char* into it */
+ }
+ }
+ if (f)
+ fclose(f);
+ }
}
#endif
gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
#include "gvcint.h"
#include "gvcproc.h"
+extern const bool Demand_Loading;
+
/*
* Define an apis array of name strings using an enumerated api_t as index.
* The enumerated type is defined gvplugin.h. The apis array is
char *libdir;
char *suffix = "_LTX_library";
+ if (!Demand_Loading)
+ return NULL;
+
libdir = gvconfig_libdir();
len = strlen(libdir) + 1 + strlen(path) + 1;
if (len > lenp) {
int api;
#ifdef ENABLE_LTDL
- fprintf(stderr,"The plugin configuration file:\n\t%s\n", gvc->config_path);
- if (gvc->config_found)
- fprintf(stderr,"\t\twas successfully loaded.\n");
- else
- fprintf(stderr,"\t\twas not found or not usable. No on-demand plugins.\n");
+ if (Demand_Loading) {
+ fprintf(stderr,"The plugin configuration file:\n\t%s\n", gvc->config_path);
+ if (gvc->config_found)
+ fprintf(stderr,"\t\twas successfully loaded.\n");
+ else
+ fprintf(stderr,"\t\twas not found or not usable. No on-demand plugins.\n");
+ }
+ else {
+ fprintf(stderr,"Demand loading of plugins is disabled.\n");
+ }
#endif
for (api = 0; api < ARRAY_SIZE(api_names); api++) {
extern "C" {
#endif
+#include "arith.h"
#include "gvcext.h"
-#ifndef NULL
-#define NULL (void *)0
-#endif
-
/*
* Terminology:
*
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@/@PACKAGE@
+includedir=@includedir@/@PACKAGE@
+
+Name: libgvc_builtins
+Description: The GraphVizContext library
+Version: @VERSION@
+Libs: -L${libdir} -lgvc_builtins
+Cflags: -I${includedir}
#include "gvplugin.h"
const lt_symlist_t lt_preloaded_symbols[] = { { 0, 0 } };
-
--- /dev/null
+/* $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 *
+**********************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "arith.h"
+
+const bool Demand_Loading = false;
$(top_builddir)/tclpkg/tclstubs/libtclstubs_C.la \
$(top_builddir)/lib/gvc/libgvc.la @LIBGEN_LIBS@ @LIBLTDL@
-libtcldot_builtin_la_SOURCES = tcldot.c $(top_srcdir)/lib/gvc/dot_builtins.c $(CODEGENS) $(GDTCLFT)
+libtcldot_builtin_la_SOURCES = \
+ tcldot.c $(CODEGENS) $(GDTCLFT) \
+ $(top_srcdir)/lib/gvc/dot_builtins.c \
+ $(top_srcdir)/lib/gvc/no_demand_loading.c
libtcldot_builtin_la_LDFLAGS = -no-undefined
libtcldot_builtin_la_LIBADD = \
$(top_builddir)/tclpkg/tclhandle/libtclhandle_C.la \