[asterisk-commits] kpfleming: branch kpfleming/nostubs r70947 - in /team/kpfleming/nostubs: incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 21 17:26:50 CDT 2007


Author: kpfleming
Date: Thu Jun 21 17:26:49 2007
New Revision: 70947

URL: http://svn.digium.com/view/asterisk?view=rev&rev=70947
Log:
look ma! no stubs for res_adsi!

Removed:
    team/kpfleming/nostubs/main/adsistub.c
Modified:
    team/kpfleming/nostubs/include/asterisk/adsi.h
    team/kpfleming/nostubs/main/Makefile
    team/kpfleming/nostubs/pbx/pbx_dundi.c
    team/kpfleming/nostubs/res/res_adsi.c

Modified: team/kpfleming/nostubs/include/asterisk/adsi.h
URL: http://svn.digium.com/view/asterisk/team/kpfleming/nostubs/include/asterisk/adsi.h?view=diff&rev=70947&r1=70946&r2=70947
==============================================================================
--- team/kpfleming/nostubs/include/asterisk/adsi.h (original)
+++ team/kpfleming/nostubs/include/asterisk/adsi.h Thu Jun 21 17:26:49 2007
@@ -117,6 +117,12 @@
 #define ADSI_DIR_FROM_LEFT (0)
 #define ADSI_DIR_FROM_RIGHT (1)
 
+#if defined(AST_MODULE_RES_ADSI)
+#define adsi_api(name, ...) int name(__VA_ARGS__)
+#else
+#define adsi_api(name, ...) static inline int name(__VA_ARGS__) { return -1; }
+#endif
+
 /*! Perform Asterisk ADSI initialization (for channel drivers that want */
 /*    to support ADSI when the handset is first lifted) */
 /*!
@@ -125,11 +131,10 @@
  * Returns 0 on success (or adsi unavailable) and -1 on hangup
  *
  */
-extern int (*ast_adsi_channel_init)(struct ast_channel *chan);
-
-extern int (*ast_adsi_begin_download)(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
-
-extern int (*ast_adsi_end_download)(struct ast_channel *chan);
+adsi_api(ast_adsi_channel_init, struct ast_channel *chan);
+
+adsi_api(ast_adsi_begin_download, struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
+adsi_api(ast_adsi_end_download, struct ast_channel *chan);
 
 /*! Restore ADSI initialization (for applications that play with ADSI */
 /*   and want to restore it to normal.  If you touch "INFO" then you */
@@ -140,7 +145,7 @@
  * Returns 0 on success (or adsi unavailable) and -1 on hangup
  *
  */
-extern int (*ast_adsi_channel_restore)(struct ast_channel *chan);
+adsi_api(ast_adsi_channel_restore, struct ast_channel *chan);
 
 /*! Display some stuff on the screen */
 /*!
@@ -152,7 +157,7 @@
  * Return 0 on success (or adsi unavailable) and -1 on hangup
  *
  */
-extern int (*ast_adsi_print)(struct ast_channel *chan, char **lines, int *align, int voice);
+adsi_api(ast_adsi_print, struct ast_channel *chan, char **lines, int *align, int voice);
 
 /*! Check if scripts for a given app are already loaded.  Version may be -1 */
 /*   if any version is okay, or 0-255 for a specific version. */
@@ -165,18 +170,19 @@
  * Returns 0 if scripts is not loaded or not an ADSI CPE.  Returns -1
  * on hangup.  Returns 1 if script already loaded.
  */
-extern int (*ast_adsi_load_session)(struct ast_channel *chan, unsigned char *app, int ver, int data);
-extern int (*ast_adsi_unload_session)(struct ast_channel *chan);
+adsi_api(ast_adsi_load_session, struct ast_channel *chan, unsigned char *app, int ver, int data);
+adsi_api(ast_adsi_unload_session, struct ast_channel *chan);
 
 /* ADSI Layer 2 transmission functions */
-extern int (*ast_adsi_transmit_messages)(struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype);
-extern int (*ast_adsi_transmit_message)(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype);
-extern int (*ast_adsi_transmit_message_full)(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait);
+adsi_api(ast_adsi_transmit_messages, struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype);
+adsi_api(ast_adsi_transmit_message, struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype);
+adsi_api(ast_adsi_transmit_message_full, struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait);
+
 /*! Read some encoded DTMF data.   */
 /*!
  * Returns number of bytes received
  */
-extern int (*ast_adsi_read_encoded_dtmf)(struct ast_channel *chan, unsigned char *buf, int maxlen);
+adsi_api(ast_adsi_read_encoded_dtmf, struct ast_channel *chan, unsigned char *buf, int maxlen);
 
 /* ADSI Layer 3 creation functions */
 
@@ -189,15 +195,14 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-
-extern int (*ast_adsi_connect_session)(unsigned char *buf, unsigned char *fdn, int ver);
+adsi_api(ast_adsi_connect_session, unsigned char *buf, unsigned char *fdn, int ver);
 
 /*! Build Query CPE ID of equipment */
 /*!
  *  Returns number of bytes added to message
  */
-extern int (*ast_adsi_query_cpeid)(unsigned char *buf);
-extern int (*ast_adsi_query_cpeinfo)(unsigned char *buf);
+adsi_api(ast_adsi_query_cpeid, unsigned char *buf);
+adsi_api(ast_adsi_query_cpeinfo, unsigned char *buf);
 
 /*! Get CPE ID from an attached ADSI compatible CPE. */
 /*!
@@ -205,9 +210,8 @@
  * or -1 on hangup, or 0 if there was no hangup but it failed to find the
  * device ID.  Returns to voice mode if "voice" is non-zero.
  */
-extern int (*ast_adsi_get_cpeid)(struct ast_channel *chan, unsigned char *cpeid, int voice);
-
-extern int (*ast_adsi_get_cpeinfo)(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
+adsi_api(ast_adsi_get_cpeid, struct ast_channel *chan, unsigned char *cpeid, int voice);
+adsi_api(ast_adsi_get_cpeinfo, struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
 
 /*! Begin an ADSI script download */
 /*!
@@ -220,8 +224,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-
-extern int (*ast_adsi_download_connect)(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
+adsi_api(ast_adsi_download_connect, unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
 
 /*! Disconnects a running session */
 /*!
@@ -230,7 +233,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_disconnect_session)(unsigned char *buf);
+adsi_api(ast_adsi_disconnect_session, unsigned char *buf);
 
 /*! Disconnects (and hopefully saves) a downloaded script */
 /*!
@@ -239,7 +242,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_download_disconnect)(unsigned char *buf);
+adsi_api(ast_adsi_download_disconnect, unsigned char *buf);
 
 /*! Puts CPE in data mode... */
 /*!
@@ -248,9 +251,10 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_data_mode)(unsigned char *buf);
-extern int (*ast_adsi_clear_soft_keys)(unsigned char *buf);
-extern int (*ast_adsi_clear_screen)(unsigned char *buf);
+adsi_api(ast_adsi_data_mode, unsigned char *buf);
+
+adsi_api(ast_adsi_clear_soft_keys, unsigned char *buf);
+adsi_api(ast_adsi_clear_screen, unsigned char *buf);
 
 /*! Puts CPE in voice mode... */
 /*!
@@ -260,14 +264,14 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_voice_mode)(unsigned char *buf, int when);
+adsi_api(ast_adsi_voice_mode, unsigned char *buf, int when);
 
 /*! Returns non-zero if Channel does or might support ADSI */
 /*!
  * \param chan Channel to check
  *
  */
-extern int (*ast_adsi_available)(struct ast_channel *chan);
+adsi_api(ast_adsi_available, struct ast_channel *chan);
 
 /*! Loads a line of info into the display */
 /*!
@@ -282,8 +286,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-
-extern int (*ast_adsi_display)(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
+adsi_api(ast_adsi_display, unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
 
 /*! Sets the current line and page */
 /*!
@@ -294,8 +297,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-
-extern int (*ast_adsi_set_line)(unsigned char *buf, int page, int line);
+adsi_api(ast_adsi_set_line, unsigned char *buf, int page, int line);
 
 /*! Creates "load soft key" parameters */
 /*!
@@ -309,7 +311,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_load_soft_key)(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data);
+adsi_api(ast_adsi_load_soft_key, unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data);
 
 /*! Set which soft keys should be displayed */
 /*!
@@ -320,7 +322,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_set_keys)(unsigned char *buf, unsigned char *keys);
+adsi_api(ast_adsi_set_keys, unsigned char *buf, unsigned char *keys);
 
 /*! Set input information */
 /*!
@@ -334,7 +336,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_input_control)(unsigned char *buf, int page, int line, int display, int format, int just);
+adsi_api(ast_adsi_input_control, unsigned char *buf, int page, int line, int display, int format, int just);
 
 /*! Set input format */
 /*!
@@ -348,7 +350,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int (*ast_adsi_input_format)(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
+adsi_api(ast_adsi_input_format, unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
 
 #endif /* _ASTERISK_ADSI_H */
 

Modified: team/kpfleming/nostubs/main/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/nostubs/main/Makefile?view=diff&rev=70947&r1=70946&r2=70947
==============================================================================
--- team/kpfleming/nostubs/main/Makefile (original)
+++ team/kpfleming/nostubs/main/Makefile Thu Jun 21 17:26:49 2007
@@ -26,7 +26,7 @@
 	utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
 	netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
 	sha1.o http.o fixedjitterbuf.o abstract_jb.o \
-	strcompat.o threadstorage.o dial.o event.o adsistub.o
+	strcompat.o threadstorage.o dial.o event.o
 
 # we need to link in the objects statically, not as a library, because
 # otherwise modules will not have them available if none of the static

Modified: team/kpfleming/nostubs/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/nostubs/pbx/pbx_dundi.c?view=diff&rev=70947&r1=70946&r2=70947
==============================================================================
--- team/kpfleming/nostubs/pbx/pbx_dundi.c (original)
+++ team/kpfleming/nostubs/pbx/pbx_dundi.c Thu Jun 21 17:26:49 2007
@@ -24,7 +24,7 @@
 
 /*** MODULEINFO
 	<depend>zlib</depend>
-	<use>crypto</use>
+	<use>res_crypto</use>
  ***/
 
 #include "asterisk.h"

Modified: team/kpfleming/nostubs/res/res_adsi.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/nostubs/res/res_adsi.c?view=diff&rev=70947&r1=70946&r2=70947
==============================================================================
--- team/kpfleming/nostubs/res/res_adsi.c (original)
+++ team/kpfleming/nostubs/res/res_adsi.c Thu Jun 21 17:26:49 2007
@@ -323,7 +323,7 @@
 	
 }
 
-static int _ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
+int ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
 {
 	int bytes;
 	unsigned char buf[256];
@@ -342,7 +342,7 @@
 	return -1;
 }
 
-static int _ast_adsi_end_download(struct ast_channel *chan)
+int ast_adsi_end_download(struct ast_channel *chan)
 {
 	int bytes;
 	unsigned char buf[256];
@@ -355,7 +355,7 @@
 	return 0;
 }
 
-static int _ast_adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
+int ast_adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
 {
 	unsigned char *msgs[5] = { NULL, NULL, NULL, NULL, NULL };
 	int msglens[5];
@@ -432,7 +432,7 @@
 	return res;
 }
 
-static int _ast_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
+int ast_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
 {
 	return ast_adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
 }
@@ -448,7 +448,7 @@
 	return x;
 }
 
-static int _ast_adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data)
+int ast_adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data)
 {
 	int bytes=0;
 
@@ -487,7 +487,7 @@
 	
 }
 
-static int _ast_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
+int ast_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
 {
 	int bytes=0;
 	int x;
@@ -510,7 +510,7 @@
 
 }
 
-static int _ast_adsi_download_connect(unsigned char *buf, char *service,  unsigned char *fdn, unsigned char *sec, int ver)
+int ast_adsi_download_connect(unsigned char *buf, char *service,  unsigned char *fdn, unsigned char *sec, int ver)
 {
 	int bytes=0;
 	int x;
@@ -540,7 +540,7 @@
 
 }
 
-static int _ast_adsi_disconnect_session(unsigned char *buf)
+int ast_adsi_disconnect_session(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -555,7 +555,7 @@
 
 }
 
-static int _ast_adsi_query_cpeid(unsigned char *buf)
+int ast_adsi_query_cpeid(unsigned char *buf)
 {
 	int bytes = 0;
 	buf[bytes++] = ADSI_QUERY_CPEID;
@@ -565,7 +565,7 @@
 	return bytes;
 }
 
-static int _ast_adsi_query_cpeinfo(unsigned char *buf)
+int ast_adsi_query_cpeinfo(unsigned char *buf)
 {
 	int bytes = 0;
 	buf[bytes++] = ADSI_QUERY_CONFIG;
@@ -575,7 +575,7 @@
 	return bytes;
 }
 
-static int _ast_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
+int ast_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
 {
 	int bytes = 0;
 	int res;
@@ -610,7 +610,7 @@
 	return bytes;
 }
 
-static int _ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
+int ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
 {
 	unsigned char buf[256];
 	int bytes = 0;
@@ -642,7 +642,7 @@
 	return res;
 }
 
-static int _ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
+int ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
 {
 	unsigned char buf[256];
 	int bytes = 0;
@@ -707,7 +707,7 @@
 	return res;
 }
 
-static int _ast_adsi_data_mode(unsigned char *buf)
+int ast_adsi_data_mode(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -722,7 +722,7 @@
 
 }
 
-static int _ast_adsi_clear_soft_keys(unsigned char *buf)
+int ast_adsi_clear_soft_keys(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -737,7 +737,7 @@
 
 }
 
-static int _ast_adsi_clear_screen(unsigned char *buf)
+int ast_adsi_clear_screen(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -752,7 +752,7 @@
 
 }
 
-static int _ast_adsi_voice_mode(unsigned char *buf, int when)
+int ast_adsi_voice_mode(unsigned char *buf, int when)
 {
 	int bytes=0;
 
@@ -769,7 +769,7 @@
 
 }
 
-static int _ast_adsi_available(struct ast_channel *chan)
+int ast_adsi_available(struct ast_channel *chan)
 {
 	int cpe = chan->adsicpe & 0xff;
 	if ((cpe == AST_ADSI_AVAILABLE) ||
@@ -778,7 +778,7 @@
 	return 0;
 }
 
-static int _ast_adsi_download_disconnect(unsigned char *buf)
+int ast_adsi_download_disconnect(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -793,7 +793,7 @@
 
 }
 
-static int _ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap, 
+int ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap, 
 		 char *col1, char *col2)
 {
 	int bytes=0;
@@ -839,7 +839,7 @@
 
 }
 
-static int _ast_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
+int ast_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
 {
 	int bytes=0;
 
@@ -862,7 +862,7 @@
 
 }
 
-static int _ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
+int ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
 {
 	int bytes = 0;
 
@@ -881,7 +881,7 @@
 	return bytes;
 }
 
-static int _ast_adsi_set_keys(unsigned char *buf, unsigned char *keys)
+int ast_adsi_set_keys(unsigned char *buf, unsigned char *keys)
 {
 	int bytes=0;
 	int x;
@@ -896,7 +896,7 @@
 	return bytes;
 }
 
-static int _ast_adsi_set_line(unsigned char *buf, int page, int line)
+int ast_adsi_set_line(unsigned char *buf, int page, int line)
 {
 	int bytes=0;
 
@@ -927,7 +927,7 @@
 static int total = 0;
 static int speeds = 0;
 
-static int _ast_adsi_channel_restore(struct ast_channel *chan)
+int ast_adsi_channel_restore(struct ast_channel *chan)
 {
 	unsigned char dsp[256];
 	int bytes;
@@ -954,7 +954,7 @@
 
 }
 
-static int _ast_adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
+int ast_adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
 {
 	unsigned char buf[4096];
 	int bytes=0;
@@ -974,7 +974,7 @@
 	return res;
 }
 
-static int _ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
+int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
 {
 	unsigned char dsp[256];
 	int bytes;
@@ -1015,7 +1015,7 @@
 
 }
 
-static int _ast_adsi_unload_session(struct ast_channel *chan)
+int ast_adsi_unload_session(struct ast_channel *chan)
 {
 	unsigned char dsp[256];
 	int bytes;
@@ -1118,35 +1118,6 @@
 {
 	adsi_load();
 
-	ast_adsi_begin_download = _ast_adsi_begin_download;
-	ast_adsi_end_download = _ast_adsi_end_download;
-	ast_adsi_channel_restore = _ast_adsi_channel_restore;
-	ast_adsi_print = _ast_adsi_print;
-	ast_adsi_load_session = _ast_adsi_load_session;
-	ast_adsi_unload_session = _ast_adsi_unload_session;
-	ast_adsi_transmit_message = _ast_adsi_transmit_message;
-	ast_adsi_transmit_message_full = _ast_adsi_transmit_message_full;
-	ast_adsi_read_encoded_dtmf = _ast_adsi_read_encoded_dtmf;
-	ast_adsi_connect_session = _ast_adsi_connect_session;
-	ast_adsi_query_cpeid = _ast_adsi_query_cpeid;
-	ast_adsi_query_cpeinfo = _ast_adsi_query_cpeinfo;
-	ast_adsi_get_cpeid = _ast_adsi_get_cpeid;
-	ast_adsi_get_cpeinfo = _ast_adsi_get_cpeinfo;
-	ast_adsi_download_connect = _ast_adsi_download_connect;
-	ast_adsi_disconnect_session = _ast_adsi_disconnect_session;
-	ast_adsi_download_disconnect = _ast_adsi_download_disconnect;
-	ast_adsi_data_mode = _ast_adsi_data_mode;
-	ast_adsi_clear_soft_keys = _ast_adsi_clear_soft_keys;
-	ast_adsi_clear_screen = _ast_adsi_clear_screen;
-	ast_adsi_voice_mode = _ast_adsi_voice_mode;
-	ast_adsi_available = _ast_adsi_available;
-	ast_adsi_display = _ast_adsi_display;
-	ast_adsi_set_line = _ast_adsi_set_line;
-	ast_adsi_load_soft_key = _ast_adsi_load_soft_key;
-	ast_adsi_set_keys = _ast_adsi_set_keys;
-	ast_adsi_input_control = _ast_adsi_input_control;
-	ast_adsi_input_format = _ast_adsi_input_format;
-
 	return 0;
 }
 




More information about the asterisk-commits mailing list