remove freeswitch's privates (couldn't resist)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@677 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-02-26 04:52:34 +00:00
parent c30a71fa9c
commit 14072e8725
13 changed files with 64 additions and 64 deletions

View 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

View 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);

View 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 */

View 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;
}
}

View 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;
}

View 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;

View 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;
}

View 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;

View 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");

View 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);

View 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;
}

View 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)

View 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;
}