wolffd@0: wolffd@0: /* vim:set shiftwidth=4 ts=8: */ wolffd@0: wolffd@0: /********************************************************** wolffd@0: * This software is part of the graphviz package * wolffd@0: * http://www.graphviz.org/ * wolffd@0: * * wolffd@0: * Copyright (c) 1994-2004 AT&T Corp. * wolffd@0: * and is licensed under the * wolffd@0: * Common Public License, Version 1.0 * wolffd@0: * by AT&T Corp. * wolffd@0: * * wolffd@0: * Information and Software Systems Research * wolffd@0: * AT&T Research, Florham Park NJ * wolffd@0: **********************************************************/ wolffd@0: wolffd@0: /* Common header used by both clients and plugins */ wolffd@0: wolffd@0: #ifndef GVCEXT_H wolffd@0: #define GVCEXT_H wolffd@0: wolffd@0: #ifdef __cplusplus wolffd@0: extern "C" { wolffd@0: #endif wolffd@0: wolffd@0: /* wolffd@0: * Define an apis array of name strings using an enumerated api_t as index. wolffd@0: * The enumerated type is defined here. The apis array is wolffd@0: * inititialized in gvplugin.c by redefining ELEM and reinvoking APIS. wolffd@0: */ wolffd@0: #define APIS ELEM(render) ELEM(layout) ELEM(textlayout) ELEM(device) ELEM(loadimage) wolffd@0: wolffd@0: /* wolffd@0: * Define api_t using names based on the plugin names with API_ prefixed. wolffd@0: */ wolffd@0: #define ELEM(x) API_##x, wolffd@0: typedef enum { APIS _DUMMY_ELEM_=0 } api_t; /* API_render, API_layout, ... */ wolffd@0: /* Stupid but true: The sole purpose of "_DUMMY_ELEM_=0" wolffd@0: * is to avoid a "," after the last element of the enum wolffd@0: * because some compilers when using "-pedantic" wolffd@0: * generate an error for about the dangling "," wolffd@0: * but only if this header is used from a .cpp file! wolffd@0: * Setting it to 0 makes sure that the enumeration wolffd@0: * does not define an extra value. (It does however wolffd@0: * define _DUMMY_ELEM_ as an enumeration symbol, wolffd@0: * but its value duplicates that of the first wolffd@0: * symbol in the enumeration - in this case "render".) wolffd@0: */ wolffd@0: wolffd@0: /* One could wonder why trailing "," in: wolffd@0: * int nums[]={1,2,3,}; wolffd@0: * is OK, but in: wolffd@0: * typedef enum {a,b,c,} abc_t; wolffd@0: * is not!!! wolffd@0: */ wolffd@0: #undef ELEM wolffd@0: wolffd@0: typedef struct GVJ_s GVJ_t; wolffd@0: typedef struct GVC_s GVC_t; wolffd@0: wolffd@0: typedef struct { wolffd@0: const char *name; wolffd@0: void* address; wolffd@0: } lt_symlist_t; wolffd@0: wolffd@0: typedef struct gvplugin_available_s gvplugin_available_t; wolffd@0: wolffd@0: /*visual studio*/ wolffd@0: #ifdef WIN32_DLL wolffd@0: #ifndef GVC_EXPORTS wolffd@0: __declspec(dllimport) lt_symlist_t lt_preloaded_symbols[]; wolffd@0: #else wolffd@0: __declspec(dllexport) lt_symlist_t lt_preloaded_symbols[]; wolffd@0: #endif wolffd@0: #endif wolffd@0: /*end visual studio*/ wolffd@0: wolffd@0: wolffd@0: #ifndef WIN32_DLL wolffd@0: #if defined(GVDLL) wolffd@0: __declspec(dllexport) lt_symlist_t lt_preloaded_symbols[]; wolffd@0: #else wolffd@0: extern lt_symlist_t lt_preloaded_symbols[]; wolffd@0: #endif wolffd@0: #endif wolffd@0: wolffd@0: wolffd@0: #ifdef __cplusplus wolffd@0: } wolffd@0: #endif wolffd@0: wolffd@0: wolffd@0: wolffd@0: #endif