- Timestamp:
- Nov 1, 2013 7:11:48 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/pjsua2.i
r4638 r4639 15 15 %} 16 16 17 #ifdef SWIGPYTHON 18 %feature("director:except") { 19 if( $error != NULL ) { 20 PyObject *ptype, *pvalue, *ptraceback; 21 PyErr_Fetch( &ptype, &pvalue, &ptraceback ); 22 PyErr_Restore( ptype, pvalue, ptraceback ); 23 PyErr_Print(); 24 //Py_Exit(1); 25 } 26 } 27 #endif 28 29 // Constants from PJSIP libraries 30 %include "symbols.i" 31 32 33 // 34 // Classes that can be extended in the target language 35 // 36 %feature("director") LogWriter; 37 %feature("director") Endpoint; 38 %feature("director") Account; 39 40 17 41 // 18 42 // STL stuff. … … 21 45 %include "std_vector.i" 22 46 23 namespace std 24 { 25 %template(StringVector) std::vector<std::string>; 26 %template(IntVector) std::vector<int>; 27 %template(AuthCredInfoVector) std::vector<AuthCredInfo>; 28 %template(SipMultipartPartVector) std::vector<SipMultipartPart>; 29 %template(SipHeaderVector) std::vector<SipHeader>; 30 } 47 48 %template(StringVector) std::vector<std::string>; 49 %template(IntVector) std::vector<int>; 31 50 32 51 // 33 // Classes that can be extended in the target language 34 // 35 %feature("director") LogWriter; 36 %feature("director") EpCallback; 37 38 // 39 // And include supporting constants etc. Here we don't want to export 40 // the whole file, so we start with ignoring everything and then enable 41 // selected symbols 42 // 43 #define PJ_BEGIN_DECL 44 #define PJ_END_DECL 45 #define PJ_DECL(type) type 46 #define PJ_INLINE(type) type 47 #define PJ_DECL_DATA(type) extern type 48 49 // 50 // Start with ignoring everything 51 // 52 %ignore ""; 53 54 // Process the files. Keep them sorted. 55 56 // 57 // 58 %rename("%s") pj_file_access; // Unignore this 59 %rename("%s", regexmatch$name="PJ_O_.*") ""; // Unignore this 60 %include "pj/file_io.h" 61 62 // 63 // 64 %rename("%s") pj_log_decoration; // Unignore this 65 %rename("%s", regexmatch$name="PJ_LOG_HAS_.*") ""; // Unignore this 66 %include "pj/log.h" 67 68 // 69 // 70 %rename("%s") pj_qos_type; // Unignore this 71 %rename("%s", regexmatch$name="PJ_QOS_TYPE_.*") ""; // Unignore this 72 %rename("%s") pj_qos_flag; // Unignore this 73 %rename("%s", regexmatch$name="PJ_QOS_PARAM_HAS_.*") "";// Unignore this 74 %rename("%s") pj_qos_wmm_prio; // Unignore this 75 %rename("%s", regexmatch$name="PJ_QOS_WMM_PRIO_.*") ""; // Unignore this 76 // TODO: 77 // Wish there is a better way to unignore a struct than 78 // listing the fields one by one like below. Using regex 79 // doesn't seem to work? 80 %rename("%s") pj_qos_params; // Unignore this 81 %rename("%s") pj_qos_params::flags; // Unignore this 82 %rename("%s") pj_qos_params::dscp_val; // Unignore this 83 %rename("%s") pj_qos_params::so_prio; // Unignore this 84 %rename("%s") pj_qos_params::wmm_prio; // Unignore this 85 %include "pj/sock_qos.h" 86 87 // 88 // 89 %rename("%s") pj_ssl_cipher; // Unignore this 90 %rename("%s", regexmatch$name="PJ_O_.*") ""; // Unignore this 91 %include "pj/ssl_sock.h" 92 93 // 94 // 95 %rename("%s") pj_status_t; // Unignore this 96 %rename("%s") PJ_SUCCESS; // Unignore this 97 %include "pj/types.h" 98 99 // 100 // 101 %rename("%s") pj_stun_nat_type; // Unignore this 102 %rename("%s", regexmatch$name="PJ_STUN_NAT_TYPE_.*") "";// Unignore this 103 %include "pjnath/nat_detect.h" 104 105 // 106 // 107 %rename("%s") pj_turn_tp_type; // Unignore this 108 %rename("%s", regexmatch$name="PJ_TURN_TP_.*") ""; // Unignore this 109 %include "pjnath/turn_session.h" 110 111 // 112 // 113 %rename("%s") pjmedia_vid_stream_rc_method; // Unignore this 114 %rename("%s", regexmatch$name="PJMEDIA_VID_STREAM_RC_.*") "";// Unignore this 115 %include "pjmedia/vid_stream.h" 116 117 // 118 // 119 %rename("%s") pjmedia_srtp_use; // Unignore this 120 %rename("%s", regexmatch$name="PJMEDIA_SRTP_.*") ""; // Unignore this 121 %include "pjmedia/transport_srtp.h" 122 123 // 124 // 125 %rename("%s") pjmedia_vid_dev_index; // Unignore this 126 %rename("%s") PJMEDIA_VID_DEFAULT_CAPTURE_DEV; // Unignore this 127 %rename("%s") PJMEDIA_VID_DEFAULT_RENDER_DEV; // Unignore this 128 %rename("%s") PJMEDIA_VID_INVALID_DEV; // Unignore this 129 %include "pjmedia-videodev/videodev.h" 130 131 // 132 // 133 %rename("%s") pjsip_cred_data_type; // Unignore this 134 %rename("%s", regexmatch$name="PJSIP_CRED_DATA_.*") ""; // Unignore this 135 %include "pjsip/sip_auth.h" 136 137 // 138 // 139 %rename("%s") pjsip_status_code; // Unignore this 140 %rename("%s", regexmatch$name="PJSIP_SC_.*") ""; // Unignore this 141 %include "pjsip/sip_msg.h" 142 143 // 144 // 145 %rename("%s") pjsip_transport_type_e; // Unignore this 146 %rename("%s") pjsip_transport_flags_e; // Unignore this 147 %rename("%s") pjsip_transport_state; // Unignore this 148 %rename("%s", regexmatch$name="PJSIP_TRANSPORT_.*") ""; // Unignore this 149 %rename("%s", regexmatch$name="PJSIP_TP_STATE_.*") ""; // Unignore this 150 %include "pjsip/sip_transport.h" 151 152 // 153 // 154 %rename("%s") pjsip_ssl_method; // Unignore this 155 %rename("%s", regexmatch$name="PJSIP_TLS.*_METHOD") ""; // Unignore this 156 %rename("%s", regexmatch$name="PJSIP_SSL.*_METHOD") ""; // Unignore this 157 %include "pjsip/sip_transport_tls.h" 158 159 // 160 // 161 %rename("%s") PJSUA_INVALID_ID; // Unignore this 162 %rename("%s") pjsua_state; // Unignore this 163 %rename("%s", regexmatch$name="PJSUA_STATE_.*") ""; // Unignore this 164 %rename("%s") pjsua_stun_use; // Unignore this 165 %rename("%s", regexmatch$name="PJSUA_STUN_USE_.*") ""; // Unignore this 166 %rename("%s") pjsua_call_hold_type; // Unignore this 167 %rename("%s", regexmatch$name="PJSUA_CALL_HOLD_TYPE_.*") "";// Unignore this 168 %rename("%s") pjsua_acc_id; // Unignore this 169 %rename("%s") pjsua_destroy_flag; // Unignore this 170 %rename("%s", regexmatch$name="PJSUA_DESTROY_.*") ""; // Unignore this 171 %include "pjsua-lib/pjsua.h" 172 173 // 174 // Back to unignore everything 175 // 176 %rename("%s") ""; 177 178 // 179 // Ignore stuffs in pjsua2 itself 52 // Ignore stuffs in pjsua2 180 53 // 181 54 %ignore fromPj; … … 186 59 // 187 60 %include "pjsua2/types.hpp" 61 %template(SipHeaderVector) std::vector<pj::SipHeader>; 62 %template(AuthCredInfoVector) std::vector<pj::AuthCredInfo>; 63 %template(SipMultipartPartVector) std::vector<pj::SipMultipartPart>; 64 188 65 %include "pjsua2/endpoint.hpp" 189 #include "pjsua2/account.hpp"66 %include "pjsua2/account.hpp" 190 67
Note: See TracChangeset
for help on using the changeset viewer.