]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
remove freeswitch's privates (couldn't resist)
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 26 Feb 2006 04:52:34 +0000 (04:52 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 26 Feb 2006 04:52:34 +0000 (04:52 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@677 d0543943-73ff-0310-b7d9-9358b9ac24b2

13 files changed:
src/include/switch_channel.h
src/include/switch_core.h
src/include/switch_module_interfaces.h
src/mod/codecs/mod_g729/mod_g729.c
src/mod/codecs/mod_gsm/mod_gsm.c
src/mod/codecs/mod_ilbc/mod_ilbc.c
src/mod/codecs/mod_speex/mod_speex.c
src/mod/directories/mod_ldap/mod_ldap.c
src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
src/mod/formats/mod_sndfile/mod_sndfile.c
src/mod/timers/mod_softtimer/mod_softtimer.c
src/switch_channel.c
src/switch_core.c

index 7fe43ab1f0b12e0a28ce9c2efb265b267d951f8c..347824e696a7e23cf9c3e5f03ab90e0dd72147ca 100644 (file)
@@ -234,7 +234,7 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_hand
   \param private void pointer to private data
   \return SWITCH_STATUS_SUCCESS if data was set
 */
-SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private);
+SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private_info);
 
 /*!
   \brief Retrieve private from a given channel
index fb0039067bd2c1b000b8a1c6af44ad581ebc2659..10cfde05fb54b865180212fbe3b75660f7c1f8a6 100644 (file)
@@ -283,24 +283,24 @@ SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *sess
 /*! 
   \brief Add private user data to a session
   \param session the session to add used data to
-  \param private the used data to add
+  \param private_info the used data to add
   \return SWITCH_STATUS_SUCCESS if data is added
 */
-SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private);
+SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private_info);
 
 /*!
   \brief Add a logical stream to a session
   \param session the session to add the stream to
-  \param private an optional pointer to private data for the new stream
+  \param private_info an optional pointer to private data for the new stream
   \return the stream id of the new stream
  */
-SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private);
+SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private_info);
 
 /*!
   \brief Retreive a logical stream from a session
   \param session the session to add the stream to
   \param index the index to retrieve
-  \return the private data (if any)
+  \return the stream
  */
 SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session *session, int index);
 
index ffa0e5e96a70e12bfb86ba331b5a0cf428b571c4..76a6a84db8072886d8a2b9c116851c49ad5ca7a9 100644 (file)
@@ -186,7 +186,7 @@ struct switch_endpoint_interface {
        const switch_state_handler_table *state_handler;
 
        /*! private information */
-       void *private;
+       void *private_info;
 
        /* to facilitate linking */
        const struct switch_endpoint_interface *next;
@@ -207,7 +207,7 @@ struct switch_timer {
        /*! the timer's memory pool */
        switch_memory_pool *memory_pool;
        /*! private data for loadable modules to store information */
-       void *private;
+       void *private_info;
 };
 
 /*! \brief A table of functions that a timer module implements */
@@ -276,7 +276,7 @@ struct switch_file_handle {
        /*! the handle's memory pool */
        switch_memory_pool *memory_pool;
        /*! private data for the format module to store handle specific info */
-       void *private;
+       void *private_info;
 };
 
 
@@ -316,7 +316,7 @@ struct switch_speech_handle {
        /*! the handle's memory pool */
        switch_memory_pool *memory_pool;
        /*! private data for the format module to store handle specific info */
-       void *private;
+       void *private_info;
 };
 
 
@@ -349,7 +349,7 @@ struct switch_directory_handle {
        /*! the handle's memory pool */
        switch_memory_pool *memory_pool;
        /*! private data for the format module to store handle specific info */
-       void *private;
+       void *private_info;
 };
 
 
@@ -403,7 +403,7 @@ struct switch_codec {
        /*! the handle's memory pool*/
        switch_memory_pool *memory_pool;
        /*! private data for the codec module to store handle specific info */
-       void *private;
+       void *private_info;
 };
 
 /*! \brief A table of settings and callbacks that define a paticular implementation of a codec */
index c9ddf4eddf428ffe63bfbe66e5647056be3c2613..bb851daf46f8cf214cefc5281bbbd06ed246443c 100644 (file)
@@ -64,7 +64,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla
                        g729_init_decoder(&context->decoder_object);
                }
 
-               codec->private = context;
+               codec->private_info = context;
 
                return SWITCH_STATUS_SUCCESS;
 
@@ -74,7 +74,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla
 
 static switch_status switch_g729_destroy(switch_codec *codec) 
 {
-       codec->private = NULL;
+       codec->private_info = NULL;
        return SWITCH_STATUS_SUCCESS;
 }
 
@@ -93,7 +93,7 @@ static switch_status switch_g729_encode(switch_codec *codec,
                                                                                unsigned int *flag) 
 {
 
-       struct g729_context *context = codec->private;
+       struct g729_context *context = codec->private_info;
        int cbret = 0;
 
        if (!context) {
@@ -139,7 +139,7 @@ static switch_status switch_g729_decode(switch_codec *codec,
                                                                                unsigned int *flag) 
 {
 
-       struct g729_context *context = codec->private;
+       struct g729_context *context = codec->private_info;
 
 
        if (!context) {
@@ -250,4 +250,4 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
        /* indicate that the module should continue to be loaded */ 
        return SWITCH_STATUS_SUCCESS;
 
-}
\ No newline at end of file
+}
index effab2196fa322f0d11d8543b781e5d363e777d8..001ebd6ed83324e8dab7bc5f0e5e47c3dbef013f 100644 (file)
@@ -52,26 +52,26 @@ static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flag
                if (decoding)
                        context->decoder = gsm_create();
        }
-       codec->private = context;
+       codec->private_info = context;
        return SWITCH_STATUS_SUCCESS;
 }
 static switch_status switch_gsm_destroy(switch_codec *codec) 
 {
-       struct gsm_context *context = codec->private;
+       struct gsm_context *context = codec->private_info;
        int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);
        int decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE);
        if (encoding)
                gsm_destroy(context->encoder);
        if (decoding)
                gsm_destroy(context->decoder);
-       codec->private = NULL;
+       codec->private_info = NULL;
        return SWITCH_STATUS_SUCCESS;
 }
 static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_codec, void *decoded_data,
                                                                                  size_t decoded_data_len, int decoded_rate, void *encoded_data,
                                                                                  size_t *encoded_data_len, int *encoded_rate, unsigned int *flag) 
 {
-       struct gsm_context *context = codec->private;
+       struct gsm_context *context = codec->private_info;
        if (!context) {
                return SWITCH_STATUS_FALSE;
        }
@@ -100,7 +100,7 @@ static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_
                                                                                  size_t encoded_data_len, int encoded_rate, void *decoded_data,
                                                                                  size_t *decoded_data_len, int *decoded_rate, unsigned int *flag) 
 {
-       struct gsm_context *context = codec->private;
+       struct gsm_context *context = codec->private_info;
        if (!context) {
                return SWITCH_STATUS_FALSE;
        }
index 0c0cf53e13ea9d5685d67892cf7500e90037e9a1..43c4723e1cb2fe710a7e7044b5138c406e46b092 100644 (file)
@@ -59,14 +59,14 @@ static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag fla
                        context->decoder = ilbc_create();
        }
 
-       codec->private = context;
+       codec->private_info = context;
        return SWITCH_STATUS_SUCCESS;
 }
 
 
 static switch_status switch_ilbc_destroy(switch_codec *codec) 
 {
-       struct ilbc_context *context = codec->private;
+       struct ilbc_context *context = codec->private_info;
 
        int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);
        int decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE);
@@ -76,7 +76,7 @@ static switch_status switch_ilbc_destroy(switch_codec *codec)
        if (decoding)
                ilbc_destroy(context->decoder);
 
-       codec->private = NULL;
+       codec->private_info = NULL;
        return SWITCH_STATUS_SUCCESS;
 }
 
@@ -92,7 +92,7 @@ static switch_status switch_ilbc_encode(switch_codec *codec,
                                                                                int *encoded_rate, 
                                                                                unsigned int *flag) 
 {
-       struct ilbc_context *context = codec->private;
+       struct ilbc_context *context = codec->private_info;
        int cbret = 0;
 
        if (!context) {
@@ -132,7 +132,7 @@ static switch_status switch_ilbc_decode(switch_codec *codec,
                                                                                int *decoded_rate, 
                                                                                unsigned int *flag) 
 {
-       struct ilbc_context *context = codec->private;
+       struct ilbc_context *context = codec->private_info;
 
        if (!context) {
                return SWITCH_STATUS_FALSE;
index c1110dceabc8143687e0177dd5ddc31cc6f310da..b4477cb02dcdf9825724cf279ea712557b1065fc 100644 (file)
@@ -152,7 +152,7 @@ static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag fl
 
 
 
-               codec->private = context;
+               codec->private_info = context;
                return SWITCH_STATUS_SUCCESS;
        }
 }
@@ -165,7 +165,7 @@ static switch_status switch_speex_encode(switch_codec *codec,
                                                                                 void *encoded_data,
                                                                                 size_t *encoded_data_len, int *encoded_rate, unsigned int *flag)
 {
-       struct speex_context *context = codec->private;
+       struct speex_context *context = codec->private_info;
        short *buf;
        int is_speech = 1;
 
@@ -220,7 +220,7 @@ static switch_status switch_speex_decode(switch_codec *codec,
                                                                                 void *decoded_data,
                                                                                 size_t *decoded_data_len, int *decoded_rate, unsigned int *flag)
 {
-       struct speex_context *context = codec->private;
+       struct speex_context *context = codec->private_info;
        short *buf;
 
        if (!context) {
@@ -242,7 +242,7 @@ static switch_status switch_speex_decode(switch_codec *codec,
 static switch_status switch_speex_destroy(switch_codec *codec)
 {
        int encoding, decoding;
-       struct speex_context *context = codec->private;
+       struct speex_context *context = codec->private_info;
 
        if (!context) {
                return SWITCH_STATUS_FALSE;
@@ -261,7 +261,7 @@ static switch_status switch_speex_destroy(switch_codec *codec)
                speex_decoder_destroy(context->decoder_state);
        }
 
-       codec->private = NULL;
+       codec->private_info = NULL;
 
        return SWITCH_STATUS_SUCCESS;
 }
index ce974b42a8372fc2b963d1be9691e5625d78f374..5ec4ec8568a3b2d1d1e37431a0af19474a12e09a 100644 (file)
@@ -81,7 +81,7 @@ static switch_status mod_ldap_open(switch_directory_handle *dh, char *source, ch
        }
 
        
-       dh->private = context;
+       dh->private_info = context;
 
        return SWITCH_STATUS_SUCCESS;
 }
@@ -90,7 +90,7 @@ static switch_status mod_ldap_close(switch_directory_handle *dh)
 {
        struct ldap_context *context;
 
-       context = dh->private;
+       context = dh->private_info;
        assert(context != NULL);
 
        ldap_unbind_s(context->ld);
@@ -102,7 +102,7 @@ static switch_status mod_ldap_query(switch_directory_handle *dh, char *base, cha
 {
        struct ldap_context *context;
 
-       context = dh->private;
+       context = dh->private_info;
        assert(context != NULL);
 
        if (ldap_search_s(context->ld, base, LDAP_SCOPE_SUBTREE, query, NULL, 0, &context->msg) != LDAP_SUCCESS) {
@@ -120,7 +120,7 @@ static switch_status mod_ldap_next(switch_directory_handle *dh)
 {
        struct ldap_context *context;
 
-       context = dh->private;
+       context = dh->private_info;
        assert(context != NULL);
 
        context->vitt = 0;
@@ -144,7 +144,7 @@ switch_status mod_ldap_next_pair(switch_directory_handle *dh, char **var, char *
 {
        struct ldap_context *context;
 
-       context = dh->private;
+       context = dh->private_info;
        assert(context != NULL);
 
        *var = *val = NULL;
index fd2179562479274b786335b726f0cbff7b6b0ade..e88035e3e7acdacbfd85f0ac4495c97dca5bab10 100644 (file)
@@ -313,7 +313,7 @@ static switch_status wanpipe_on_hangup(switch_core_session *session)
        tech_pvt = switch_core_session_get_private(session);
        assert(tech_pvt != NULL);
 
-       chanmap = tech_pvt->spri->private;
+       chanmap = tech_pvt->spri->private_info;
 
        sangoma_socket_close(&tech_pvt->socket);
 
@@ -423,7 +423,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
 
                        do {
                                if ((spri = &SPANS[span]->spri)) {
-                                       chanmap = spri->private;
+                                       chanmap = spri->private_info;
                                        if (channo == 0) {
                                                if (autochan > 0) {
                                                        for(channo = 1; channo < SANGOMA_MAX_CHAN_PER_SPAN; channo++) {
@@ -813,7 +813,7 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
        switch_core_session *session;
        struct private_object *tech_pvt;
 
-       chanmap = spri->private;
+       chanmap = spri->private_info;
        if ((session = chanmap->map[event->hangup.channel])) {
                switch_channel *channel = NULL;
 
@@ -843,7 +843,7 @@ static int on_answer(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
        switch_channel *channel;
        struct channel_map *chanmap;
 
-       chanmap = spri->private;
+       chanmap = spri->private_info;
 
        if ((session = chanmap->map[event->answer.channel])) {
                switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Answer on channel %d\n", event->answer.channel);
@@ -864,7 +864,7 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
        switch_channel *channel;
        struct channel_map *chanmap;
 
-       chanmap = spri->private;
+       chanmap = spri->private_info;
 
        if ((session = chanmap->map[event->proceeding.channel])) {
                switch_caller_profile *originator;
@@ -902,7 +902,7 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
        struct channel_map *chanmap;
        struct private_object *tech_pvt;
 
-       chanmap = spri->private;
+       chanmap = spri->private_info;
 
        if ((session = chanmap->map[event->ringing.channel])) {
                switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Ringing on channel %d\n", event->ringing.channel);
@@ -935,7 +935,7 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
 
 
 
-       chanmap = spri->private;
+       chanmap = spri->private_info;
        if (chanmap->map[event->ring.channel]) {
                switch_console_printf(SWITCH_CHANNEL_CONSOLE, "--Duplicate Ring on channel %d (ignored)\n",
                                                          event->ring.channel);
@@ -1027,7 +1027,7 @@ static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
 
        switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Restarting channel %d\n", event->restart.channel);
 
-       chanmap = spri->private;
+       chanmap = spri->private_info;
        
        if ((session = chanmap->map[event->restart.channel])) {
                switch_channel *channel;
@@ -1070,7 +1070,7 @@ static void *pri_thread_run(switch_thread *thread, void *obj)
        SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RESTART, on_restart);
 
        spri->on_loop = check_flags;
-       spri->private = &chanmap;
+       spri->private_info = &chanmap;
 
        if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
                switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_pri._tcp");
index 2b34c67f534f760ece49a27a3037becb7e80242d..27d825595755f4009b0c5356b5cc32424315c8c2 100644 (file)
@@ -139,14 +139,14 @@ switch_status sndfile_file_open(switch_file_handle *handle, char *path)
        handle->sections = context->sfinfo.sections;
        handle->seekable = context->sfinfo.seekable;
 
-       handle->private = context;
+       handle->private_info = context;
 
        return SWITCH_STATUS_SUCCESS;
 }
 
 switch_status sndfile_file_close(switch_file_handle *handle)
 {
-       sndfile_context *context = handle->private;
+       sndfile_context *context = handle->private_info;
 
        sf_close(context->handle);
 
@@ -155,7 +155,7 @@ switch_status sndfile_file_close(switch_file_handle *handle)
 
 switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sample, unsigned int samples, int whence)
 {
-       sndfile_context *context = handle->private;
+       sndfile_context *context = handle->private_info;
 
        if (!handle->seekable) {
                return SWITCH_STATUS_NOTIMPL;
@@ -170,7 +170,7 @@ switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sa
 switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *len)
 {
        size_t inlen = *len;
-       sndfile_context *context = handle->private;
+       sndfile_context *context = handle->private_info;
 
        if (switch_test_flag(handle, SWITCH_FILE_DATA_RAW)) {
                *len = (size_t) sf_read_raw(context->handle, data, inlen);
@@ -192,7 +192,7 @@ switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *
 switch_status sndfile_file_write(switch_file_handle *handle, void *data, size_t *len)
 {
        size_t inlen = *len;
-       sndfile_context *context = handle->private;
+       sndfile_context *context = handle->private_info;
 
        if (switch_test_flag(handle, SWITCH_FILE_DATA_RAW)) {
                *len = (size_t) sf_write_raw(context->handle, data, inlen);
index 8da44f9064398ceb124ab99eaa173660f62d75e0..0eff96b2469c76dc4d51360ac2a1060d99363813 100644 (file)
@@ -53,7 +53,7 @@ static switch_status soft_timer_init(switch_timer *timer)
        struct timer_private *private;
 
        private = switch_core_alloc(timer->memory_pool, sizeof(*private));
-       timer->private = private;
+       timer->private_info = private;
 
 #ifdef WINTIMER
        QueryPerformanceFrequency(&private->freq);
@@ -67,7 +67,7 @@ static switch_status soft_timer_init(switch_timer *timer)
 
 static switch_status soft_timer_next(switch_timer *timer)
 {
-       struct timer_private *private = timer->private;
+       struct timer_private *private = timer->private_info;
 
 #ifdef WINTIMER
        private->base.QuadPart += timer->interval * (private->freq.QuadPart / 1000);
@@ -93,7 +93,7 @@ static switch_status soft_timer_next(switch_timer *timer)
 
 static switch_status soft_timer_destroy(switch_timer *timer)
 {
-       timer->private = NULL;
+       timer->private_info = NULL;
        return SWITCH_STATUS_SUCCESS;
 }
 
index b68670d37d5ad3fd6b298fc778a65b1d1518269a..ee0def55fe25ec1322ce941cca67c38bc6e2c9f0 100644 (file)
@@ -46,7 +46,7 @@ struct switch_channel {
        int state_handler_index;
        switch_hash *variables;
        switch_channel_timetable_t times;
-       void *private;
+       void *private_info;
        int freq;
        int bits;
        int channels;
@@ -185,17 +185,17 @@ SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel *channel, char
        return switch_core_hash_find(channel->variables, varname);
 }
 
-SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private)
+SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private_info)
 {
        assert(channel != NULL);
-       channel->private = private;
+       channel->private_info = private_info;
        return SWITCH_STATUS_SUCCESS;
 }
 
 SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel *channel)
 {
        assert(channel != NULL);
-       return channel->private;
+       return channel->private_info;
 }
 
 SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel *channel, char *name)
index 0caf5bc188833cb178d33186470f63106e81c3cc..83ce2059c834e242ba80939cace5ff0451585db3 100644 (file)
@@ -82,7 +82,7 @@ struct switch_core_session {
        int stream_count;
 
        char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
-       void *private;
+       void *private_info;
 };
 
 struct switch_core_runtime {
@@ -741,20 +741,20 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup)
 SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *session)
 {
        assert(session != NULL);
-       return session->private;
+       return session->private_info;
 }
 
 
-SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private)
+SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private_info)
 {
        assert(session != NULL);
-       session->private = private;
+       session->private_info = private_info;
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private)
+SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private_info)
 {
-       session->streams[session->stream_count++] = private;
+       session->streams[session->stream_count++] = private_info;
        return session->stream_count - 1;
 }