| 1 | /* $Id: Coin_C_defines.h 1448 2011-06-19 15:34:41Z stefan $ */ |
| 2 | /* |
| 3 | Copyright (C) 2002, 2003 International Business Machines Corporation |
| 4 | and others. All Rights Reserved. |
| 5 | |
| 6 | This code is licensed under the terms of the Eclipse Public License (EPL). |
| 7 | */ |
| 8 | #ifndef CoinCDefine_H |
| 9 | #define CoinCDefine_H |
| 10 | |
| 11 | /** This has #defines etc for the "C" interface to Coin. |
| 12 | If COIN_EXTERN_C defined then an extra extern C |
| 13 | */ |
| 14 | |
| 15 | #if defined (CLP_EXTERN_C) |
| 16 | #define COIN_EXTERN_C |
| 17 | #define COIN_NO_SBB |
| 18 | #define COIN_NO_CBC |
| 19 | #endif |
| 20 | #if defined (SBB_EXTERN_C) |
| 21 | #define COIN_EXTERN_C |
| 22 | #define COIN_NO_CLP |
| 23 | #endif |
| 24 | #if defined (CBC_EXTERN_C) |
| 25 | #define COIN_EXTERN_C |
| 26 | #define COIN_NO_CLP |
| 27 | #endif |
| 28 | /* We need to allow for Microsoft */ |
| 29 | #ifndef COINLIBAPI |
| 30 | |
| 31 | #if defined(CBCCINTERFACEDLL_EXPORTS) || defined(CLPMSDLL) |
| 32 | #if defined (COIN_EXTERN_C) |
| 33 | # define COINLIBAPI __declspec(dllexport) |
| 34 | #else |
| 35 | # define COINLIBAPI __declspec(dllexport) |
| 36 | #endif |
| 37 | # define COINLINKAGE __stdcall |
| 38 | # define COINLINKAGE_CB __cdecl |
| 39 | #else |
| 40 | #if defined (COIN_EXTERN_C) |
| 41 | # define COINLIBAPI extern "C" |
| 42 | #else |
| 43 | # define COINLIBAPI |
| 44 | #endif |
| 45 | # define COINLINKAGE |
| 46 | # define COINLINKAGE_CB |
| 47 | #endif |
| 48 | |
| 49 | #endif |
| 50 | /** User does not need to see structure of model but C++ code does */ |
| 51 | #if defined (CLP_EXTERN_C) |
| 52 | /* Real typedef for structure */ |
| 53 | class CMessageHandler; |
| 54 | typedef struct { |
| 55 | ClpSimplex * model_; |
| 56 | CMessageHandler * handler_; |
| 57 | } Clp_Simplex; |
| 58 | #else |
| 59 | typedef void Clp_Simplex; |
| 60 | #endif |
| 61 | |
| 62 | #ifndef COIN_NO_CLP |
| 63 | /** typedef for user call back. |
| 64 | The cvec are constructed so don't need to be const*/ |
| 65 | typedef void (COINLINKAGE_CB *clp_callback) (Clp_Simplex * model,int msgno, int ndouble, |
| 66 | const double * dvec, int nint, const int * ivec, |
| 67 | int nchar, char ** cvec); |
| 68 | #endif |
| 69 | /** User does not need to see structure of model but C++ code does */ |
| 70 | #if defined (SBB_EXTERN_C) |
| 71 | /* Real typedef for structure */ |
| 72 | class Sbb_MessageHandler; |
| 73 | typedef struct { |
| 74 | OsiClpSolverInterface * solver_; |
| 75 | SbbModel * model_; |
| 76 | Sbb_MessageHandler * handler_; |
| 77 | char * information_; |
| 78 | } Sbb_Model; |
| 79 | #else |
| 80 | typedef void Sbb_Model; |
| 81 | #endif |
| 82 | #if defined (CBC_EXTERN_C) |
| 83 | /* Real typedef for structure */ |
| 84 | class Cbc_MessageHandler; |
| 85 | typedef struct { |
| 86 | OsiClpSolverInterface * solver_; |
| 87 | CbcModel * model_; |
| 88 | Cbc_MessageHandler * handler_; |
| 89 | char * information_; |
| 90 | } Cbc_Model; |
| 91 | #else |
| 92 | typedef void Cbc_Model; |
| 93 | #endif |
| 94 | #ifndef COIN_NO_SBB |
| 95 | /** typedef for user call back. |
| 96 | The cvec are constructed so don't need to be const*/ |
| 97 | typedef void (COINLINKAGE_CB *sbb_callback) (Sbb_Model * model,int msgno, int ndouble, |
| 98 | const double * dvec, int nint, const int * ivec, |
| 99 | int nchar, char ** cvec); |
| 100 | typedef void (COINLINKAGE_CB *cbc_callback) (Cbc_Model * model,int msgno, int ndouble, |
| 101 | const double * dvec, int nint, const int * ivec, |
| 102 | int nchar, char ** cvec); |
| 103 | #endif |
| 104 | #if COIN_BIG_INDEX==0 |
| 105 | typedef int CoinBigIndex; |
| 106 | #elif COIN_BIG_INDEX==1 |
| 107 | typedef long CoinBigIndex; |
| 108 | #else |
| 109 | typedef long long CoinBigIndex; |
| 110 | #endif |
| 111 | /* just in case used somewhere */ |
| 112 | #undef COIN_NO_CLP |
| 113 | #undef COIN_NO_SBB |
| 114 | #undef COIN_NO_CBC |
| 115 | #endif |
| 116 | |