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