Mercurial > hg > camir-aes2014
comparison toolboxes/graph_visualisation/include/graphviz/gvcext.h @ 0:e9a9cd732c1e tip
first hg version after svn
| author | wolffd | 
|---|---|
| date | Tue, 10 Feb 2015 15:05:51 +0000 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| -1:000000000000 | 0:e9a9cd732c1e | 
|---|---|
| 1 | |
| 2 /* vim:set shiftwidth=4 ts=8: */ | |
| 3 | |
| 4 /********************************************************** | |
| 5 * This software is part of the graphviz package * | |
| 6 * http://www.graphviz.org/ * | |
| 7 * * | |
| 8 * Copyright (c) 1994-2004 AT&T Corp. * | |
| 9 * and is licensed under the * | |
| 10 * Common Public License, Version 1.0 * | |
| 11 * by AT&T Corp. * | |
| 12 * * | |
| 13 * Information and Software Systems Research * | |
| 14 * AT&T Research, Florham Park NJ * | |
| 15 **********************************************************/ | |
| 16 | |
| 17 /* Common header used by both clients and plugins */ | |
| 18 | |
| 19 #ifndef GVCEXT_H | |
| 20 #define GVCEXT_H | |
| 21 | |
| 22 #ifdef __cplusplus | |
| 23 extern "C" { | |
| 24 #endif | |
| 25 | |
| 26 /* | |
| 27 * Define an apis array of name strings using an enumerated api_t as index. | |
| 28 * The enumerated type is defined here. The apis array is | |
| 29 * inititialized in gvplugin.c by redefining ELEM and reinvoking APIS. | |
| 30 */ | |
| 31 #define APIS ELEM(render) ELEM(layout) ELEM(textlayout) ELEM(device) ELEM(loadimage) | |
| 32 | |
| 33 /* | |
| 34 * Define api_t using names based on the plugin names with API_ prefixed. | |
| 35 */ | |
| 36 #define ELEM(x) API_##x, | |
| 37 typedef enum { APIS _DUMMY_ELEM_=0 } api_t; /* API_render, API_layout, ... */ | |
| 38 /* Stupid but true: The sole purpose of "_DUMMY_ELEM_=0" | |
| 39 * is to avoid a "," after the last element of the enum | |
| 40 * because some compilers when using "-pedantic" | |
| 41 * generate an error for about the dangling "," | |
| 42 * but only if this header is used from a .cpp file! | |
| 43 * Setting it to 0 makes sure that the enumeration | |
| 44 * does not define an extra value. (It does however | |
| 45 * define _DUMMY_ELEM_ as an enumeration symbol, | |
| 46 * but its value duplicates that of the first | |
| 47 * symbol in the enumeration - in this case "render".) | |
| 48 */ | |
| 49 | |
| 50 /* One could wonder why trailing "," in: | |
| 51 * int nums[]={1,2,3,}; | |
| 52 * is OK, but in: | |
| 53 * typedef enum {a,b,c,} abc_t; | |
| 54 * is not!!! | |
| 55 */ | |
| 56 #undef ELEM | |
| 57 | |
| 58 typedef struct GVJ_s GVJ_t; | |
| 59 typedef struct GVC_s GVC_t; | |
| 60 | |
| 61 typedef struct { | |
| 62 const char *name; | |
| 63 void* address; | |
| 64 } lt_symlist_t; | |
| 65 | |
| 66 typedef struct gvplugin_available_s gvplugin_available_t; | |
| 67 | |
| 68 /*visual studio*/ | |
| 69 #ifdef WIN32_DLL | |
| 70 #ifndef GVC_EXPORTS | |
| 71 __declspec(dllimport) lt_symlist_t lt_preloaded_symbols[]; | |
| 72 #else | |
| 73 __declspec(dllexport) lt_symlist_t lt_preloaded_symbols[]; | |
| 74 #endif | |
| 75 #endif | |
| 76 /*end visual studio*/ | |
| 77 | |
| 78 | |
| 79 #ifndef WIN32_DLL | |
| 80 #if defined(GVDLL) | |
| 81 __declspec(dllexport) lt_symlist_t lt_preloaded_symbols[]; | |
| 82 #else | |
| 83 extern lt_symlist_t lt_preloaded_symbols[]; | |
| 84 #endif | |
| 85 #endif | |
| 86 | |
| 87 | |
| 88 #ifdef __cplusplus | |
| 89 } | |
| 90 #endif | |
| 91 | |
| 92 | |
| 93 | |
| 94 #endif | 
