[asterisk-commits] seanbright: trunk r137082 - in /trunk/main: ./ db1-ast/btree/ db1-ast/recno/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Aug 10 14:35:52 CDT 2008
Author: seanbright
Date: Sun Aug 10 14:35:50 2008
New Revision: 137082
URL: http://svn.digium.com/view/asterisk?view=rev&rev=137082
Log:
Another big chunk of changes from the RSW branch. Bunch of stuff from main/
Modified:
trunk/main/abstract_jb.c
trunk/main/acl.c
trunk/main/app.c
trunk/main/asterisk.c
trunk/main/astobj2.c
trunk/main/audiohook.c
trunk/main/callerid.c
trunk/main/cdr.c
trunk/main/channel.c
trunk/main/config.c
trunk/main/db1-ast/btree/bt_delete.c
trunk/main/db1-ast/btree/bt_put.c
trunk/main/db1-ast/recno/rec_delete.c
trunk/main/db1-ast/recno/rec_put.c
trunk/main/event.c
trunk/main/features.c
trunk/main/file.c
trunk/main/http.c
trunk/main/jitterbuf.c
trunk/main/manager.c
trunk/main/rtp.c
trunk/main/tdd.c
Modified: trunk/main/abstract_jb.c
URL: http://svn.digium.com/view/asterisk/trunk/main/abstract_jb.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/abstract_jb.c (original)
+++ trunk/main/abstract_jb.c Sun Aug 10 14:35:50 2008
@@ -551,16 +551,16 @@
}
-static long get_now(struct ast_jb *jb, struct timeval *tv)
+static long get_now(struct ast_jb *jb, struct timeval *when)
{
struct timeval now;
- if (!tv) {
- tv = &now;
- gettimeofday(tv, NULL);
- }
-
- return ast_tvdiff_ms(*tv, jb->timebase);
+ if (!when) {
+ when = &now;
+ gettimeofday(when, NULL);
+ }
+
+ return ast_tvdiff_ms(*when, jb->timebase);
}
Modified: trunk/main/acl.c
URL: http://svn.digium.com/view/asterisk/trunk/main/acl.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/acl.c (original)
+++ trunk/main/acl.c Sun Aug 10 14:35:50 2008
@@ -246,18 +246,18 @@
{
struct ast_ha *start = original;
struct ast_ha *ret = NULL;
- struct ast_ha *link, *prev = NULL;
+ struct ast_ha *current, *prev = NULL;
while (start) {
- link = ast_duplicate_ha(start); /* Create copy of this object */
+ current = ast_duplicate_ha(start); /* Create copy of this object */
if (prev)
- prev->next = link; /* Link previous to this object */
+ prev->next = current; /* Link previous to this object */
if (!ret)
- ret = link; /* Save starting point */
+ ret = current; /* Save starting point */
start = start->next; /* Go to next object */
- prev = link; /* Save pointer to this object */
+ prev = current; /* Save pointer to this object */
}
return ret; /* Return start of list */
}
Modified: trunk/main/app.c
URL: http://svn.digium.com/view/asterisk/trunk/main/app.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/app.c (original)
+++ trunk/main/app.c Sun Aug 10 14:35:50 2008
@@ -452,7 +452,7 @@
int ast_control_streamfile(struct ast_channel *chan, const char *file,
const char *fwd, const char *rev,
- const char *stop, const char *pause,
+ const char *stop, const char *suspend,
const char *restart, int skipms, long *offsetms)
{
char *breaks = NULL;
@@ -467,8 +467,8 @@
if (stop)
blen += strlen(stop);
- if (pause)
- blen += strlen(pause);
+ if (suspend)
+ blen += strlen(suspend);
if (restart)
blen += strlen(restart);
@@ -477,8 +477,8 @@
breaks[0] = '\0';
if (stop)
strcat(breaks, stop);
- if (pause)
- strcat(breaks, pause);
+ if (suspend)
+ strcat(breaks, suspend);
if (restart)
strcat(breaks, restart);
}
@@ -528,17 +528,17 @@
continue;
}
- if (pause && strchr(pause, res)) {
+ if (suspend && strchr(suspend, res)) {
pause_restart_point = ast_tellstream(chan->stream);
for (;;) {
ast_stopstream(chan);
res = ast_waitfordigit(chan, 1000);
if (!res)
continue;
- else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
+ else if (res == -1 || strchr(suspend, res) || (stop && strchr(stop, res)))
break;
}
- if (res == *pause) {
+ if (res == *suspend) {
res = 0;
continue;
}
Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Sun Aug 10 14:35:50 2008
@@ -644,14 +644,14 @@
ast_cli(a->fd, "%6s %8s %10s %12s %12s %s\n", "ID", "Scale", "Events",
"Value", "Average", "Name");
for (i = min; i < max; i++) {
- struct profile_entry *e = &prof_data->e[i];
+ struct profile_entry *entry = &prof_data->e[i];
if (!search || strstr(prof_data->e[i].name, search))
ast_cli(a->fd, "%6d: [%8ld] %10ld %12lld %12lld %s\n",
i,
- (long)e->scale,
- (long)e->events, (long long)e->value,
- (long long)(e->events ? e->value / e->events : e->value),
- e->name);
+ (long)entry->scale,
+ (long)entry->events, (long long)entry->value,
+ (long long)(entry->events ? entry->value / entry->events : entry->value),
+ entry->name);
}
return CLI_SUCCESS;
}
@@ -817,7 +817,7 @@
}
/*! \brief NULL handler so we can collect the child exit status */
-static void null_sig_handler(int signal)
+static void null_sig_handler(int sig)
{
}
@@ -1326,7 +1326,7 @@
AST_RWLIST_UNLOCK(&atexits);
}
-static void quit_handler(int num, int nice, int safeshutdown, int restart)
+static void quit_handler(int num, int niceness, int safeshutdown, int restart)
{
char filename[80] = "";
time_t s,e;
@@ -1335,7 +1335,7 @@
ast_cdr_engine_term();
if (safeshutdown) {
shuttingdown = 1;
- if (!nice) {
+ if (!niceness) {
/* Begin shutdown routine, hanging up active channels */
ast_begin_shutdown(1);
if (option_verbose && ast_opt_console)
@@ -1354,7 +1354,7 @@
usleep(100000);
}
} else {
- if (nice < 2)
+ if (niceness < 2)
ast_begin_shutdown(0);
if (option_verbose && ast_opt_console)
ast_verbose("Waiting for inactivity to perform %s...\n", restart ? "restart" : "halt");
@@ -1373,7 +1373,7 @@
return;
}
- if (nice)
+ if (niceness)
ast_module_shutdown();
}
if (ast_opt_console || ast_opt_remote) {
@@ -1899,7 +1899,7 @@
#endif /* ! LOW_MEMORY */
};
-static int ast_el_read_char(EditLine *el, char *cp)
+static int ast_el_read_char(EditLine *editline, char *cp)
{
int num_read = 0;
int lastpos = 0;
@@ -1993,7 +1993,7 @@
static struct ast_str *prompt = NULL;
-static char *cli_prompt(EditLine *el)
+static char *cli_prompt(EditLine *editline)
{
char tmp[100];
char *pfmt;
@@ -2225,7 +2225,7 @@
}
-static char *cli_complete(EditLine *el, int ch)
+static char *cli_complete(EditLine *editline, int ch)
{
int len = 0;
char *ptr;
@@ -2235,7 +2235,7 @@
char buf[2048];
int res;
- LineInfo *lf = (LineInfo *)el_line(el);
+ LineInfo *lf = (LineInfo *)el_line(editline);
*(char *)lf->cursor = '\0';
ptr = (char *)lf->cursor;
@@ -2302,14 +2302,14 @@
int matches_num, maxlen, match_len;
if (matches[0][0] != '\0') {
- el_deletestr(el, (int) len);
- el_insertstr(el, matches[0]);
+ el_deletestr(editline, (int) len);
+ el_insertstr(editline, matches[0]);
retval = CC_REFRESH;
}
if (nummatches == 1) {
/* Found an exact match */
- el_insertstr(el, " ");
+ el_insertstr(editline, " ");
retval = CC_REFRESH;
} else {
/* Must be more than one match */
@@ -2324,7 +2324,7 @@
ast_cli_display_match_list(matches, nummatches, maxlen);
retval = CC_REDISPLAY;
} else {
- el_insertstr(el," ");
+ el_insertstr(editline," ");
retval = CC_REFRESH;
}
}
@@ -2427,7 +2427,6 @@
char *cpid;
char *version;
int pid;
- char tmp[80];
char *stringp = NULL;
char *ebuf;
@@ -2453,6 +2452,7 @@
else
pid = -1;
if (!data) {
+ char tmp[80];
snprintf(tmp, sizeof(tmp), "core set verbose atleast %d", option_verbose);
fdsend(ast_consock, tmp);
snprintf(tmp, sizeof(tmp), "core set debug atleast %d", option_debug);
@@ -2480,10 +2480,10 @@
fds.events = POLLIN;
fds.revents = 0;
while (poll(&fds, 1, 500) > 0) {
- char buf[512] = "", *curline = buf, *nextline;
+ char buffer[512] = "", *curline = buffer, *nextline;
int not_written = 1;
- if (read(ast_consock, buf, sizeof(buf) - 1) <= 0) {
+ if (read(ast_consock, buffer, sizeof(buffer) - 1) <= 0) {
break;
}
@@ -2520,11 +2520,11 @@
ebuf[strlen(ebuf)-1] = '\0';
if (!remoteconsolehandler(ebuf)) {
/* Strip preamble from output */
- char *tmp;
- for (tmp = ebuf; *tmp; tmp++) {
- if (*tmp == 127) {
- memmove(tmp, tmp + 1, strlen(tmp));
- tmp--;
+ char *temp;
+ for (temp = ebuf; *temp; temp++) {
+ if (*temp == 127) {
+ memmove(temp, temp + 1, strlen(temp));
+ temp--;
}
}
res = write(ast_consock, ebuf, strlen(ebuf) + 1);
@@ -2831,15 +2831,15 @@
static void *canary_thread(void *unused)
{
struct stat canary_stat;
- struct timeval tv;
+ struct timeval now;
/* Give the canary time to sing */
sleep(120);
for (;;) {
stat(canary_filename, &canary_stat);
- tv = ast_tvnow();
- if (tv.tv_sec > canary_stat.st_mtime + 60) {
+ now = ast_tvnow();
+ if (now.tv_sec > canary_stat.st_mtime + 60) {
ast_log(LOG_WARNING, "The canary is no more. He has ceased to be! He's expired and gone to meet his maker! He's a stiff! Bereft of life, he rests in peace. His metabolic processes are now history! He's off the twig! He's kicked the bucket. He's shuffled off his mortal coil, run down the curtain, and joined the bleeding choir invisible!! THIS is an EX-CANARY. (Reducing priority)\n");
ast_set_priority(0);
pthread_exit(NULL);
Modified: trunk/main/astobj2.c
URL: http://svn.digium.com/view/asterisk/trunk/main/astobj2.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/astobj2.c (original)
+++ trunk/main/astobj2.c Sun Aug 10 14:35:50 2008
@@ -813,10 +813,10 @@
_ao2_callback(c, OBJ_UNLINK, cd_cb, NULL);
for (i = 0; i < c->n_buckets; i++) {
- struct bucket_list *cur;
-
- while ((cur = AST_LIST_REMOVE_HEAD(&c->buckets[i], entry))) {
- ast_free(cur);
+ struct bucket_list *current;
+
+ while ((current = AST_LIST_REMOVE_HEAD(&c->buckets[i], entry))) {
+ ast_free(current);
}
}
@@ -833,10 +833,10 @@
_ao2_callback_debug(c, OBJ_UNLINK, cd_cb_debug, NULL, "container_destruct_debug called", __FILE__, __LINE__, __PRETTY_FUNCTION__);
for (i = 0; i < c->n_buckets; i++) {
- struct bucket_list *cur;
-
- while ((cur = AST_LIST_REMOVE_HEAD(&c->buckets[i], entry))) {
- ast_free(cur);
+ struct bucket_list *current;
+
+ while ((current = AST_LIST_REMOVE_HEAD(&c->buckets[i], entry))) {
+ ast_free(current);
}
}
Modified: trunk/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/trunk/main/audiohook.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/audiohook.c (original)
+++ trunk/main/audiohook.c Sun Aug 10 14:35:50 2008
@@ -122,13 +122,13 @@
{
struct ast_slinfactory *factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_factory : &audiohook->write_factory);
struct ast_slinfactory *other_factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->write_factory : &audiohook->read_factory);
- struct timeval *time = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_time : &audiohook->write_time), previous_time = *time;
+ struct timeval *rwtime = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_time : &audiohook->write_time), previous_time = *rwtime;
/* Update last feeding time to be current */
- *time = ast_tvnow();
+ *rwtime = ast_tvnow();
/* If we are using a sync trigger and this factory suddenly got audio fed in after a lapse, then flush both factories to ensure they remain in sync */
- if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && ast_slinfactory_available(other_factory) && (ast_tvdiff_ms(*time, previous_time) > (ast_slinfactory_available(other_factory) / 8))) {
+ if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && ast_slinfactory_available(other_factory) && (ast_tvdiff_ms(*rwtime, previous_time) > (ast_slinfactory_available(other_factory) / 8))) {
if (option_debug)
ast_log(LOG_DEBUG, "Flushing audiohook %p so it remains in sync\n", audiohook);
ast_slinfactory_flush(factory);
@@ -666,12 +666,12 @@
*/
void ast_audiohook_trigger_wait(struct ast_audiohook *audiohook)
{
- struct timeval tv;
+ struct timeval wait;
struct timespec ts;
- tv = ast_tvadd(ast_tvnow(), ast_samp2tv(50000, 1000));
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = tv.tv_usec * 1000;
+ wait = ast_tvadd(ast_tvnow(), ast_samp2tv(50000, 1000));
+ ts.tv_sec = wait.tv_sec;
+ ts.tv_nsec = wait.tv_usec * 1000;
ast_cond_timedwait(&audiohook->trigger, &audiohook->lock, &ts);
Modified: trunk/main/callerid.c
URL: http://svn.digium.com/view/asterisk/trunk/main/callerid.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/callerid.c (original)
+++ trunk/main/callerid.c Sun Aug 10 14:35:50 2008
@@ -722,14 +722,14 @@
static int callerid_genmsg(char *msg, int size, const char *number, const char *name, int flags)
{
- struct timeval tv = ast_tvnow();
+ struct timeval now = ast_tvnow();
struct ast_tm tm;
char *ptr;
int res;
int i, x;
/* Get the time */
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&now, &tm, NULL);
ptr = msg;
Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Sun Aug 10 14:35:50 2008
@@ -201,15 +201,15 @@
return NULL;
}
-static void cdr_get_tv(struct timeval tv, const char *fmt, char *buf, int bufsize)
+static void cdr_get_tv(struct timeval when, const char *fmt, char *buf, int bufsize)
{
if (fmt == NULL) { /* raw mode */
- snprintf(buf, bufsize, "%ld.%06ld", (long)tv.tv_sec, (long)tv.tv_usec);
+ snprintf(buf, bufsize, "%ld.%06ld", (long)when.tv_sec, (long)when.tv_usec);
} else {
- if (tv.tv_sec) {
+ if (when.tv_sec) {
struct ast_tm tm;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_strftime(buf, bufsize, fmt, &tm);
}
}
@@ -1034,7 +1034,7 @@
void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *_flags)
{
- struct ast_cdr *dup;
+ struct ast_cdr *duplicate;
struct ast_flags flags = { 0 };
if (_flags)
@@ -1045,8 +1045,8 @@
if (ast_test_flag(&flags, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
if (ast_test_flag(&flags, AST_CDR_FLAG_POSTED)) {
ast_cdr_end(cdr);
- if ((dup = ast_cdr_dup(cdr))) {
- ast_cdr_detach(dup);
+ if ((duplicate = ast_cdr_dup(cdr))) {
+ ast_cdr_detach(duplicate);
}
ast_set_flag(cdr, AST_CDR_FLAG_POSTED);
}
@@ -1150,7 +1150,7 @@
return NULL;
}
-void ast_cdr_submit_batch(int shutdown)
+void ast_cdr_submit_batch(int do_shutdown)
{
struct ast_cdr_batch_item *oldbatchitems = NULL;
pthread_t batch_post_thread = AST_PTHREADT_NULL;
@@ -1167,7 +1167,7 @@
/* if configured, spawn a new thread to post these CDRs,
also try to save as much as possible if we are shutting down safely */
- if (batchscheduleronly || shutdown) {
+ if (batchscheduleronly || do_shutdown) {
ast_debug(1, "CDR single-threaded batch processing begins now\n");
do_batch_backend_process(oldbatchitems);
} else {
Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Sun Aug 10 14:35:50 2008
@@ -529,8 +529,8 @@
void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset)
{
- struct timeval tv = { offset, };
- ast_channel_setwhentohangup_tv(chan, tv);
+ struct timeval when = { offset, };
+ ast_channel_setwhentohangup_tv(chan, when);
}
/*! \brief Compare a offset with when to hangup channel */
@@ -1540,16 +1540,16 @@
return res;
}
-static void free_translation(struct ast_channel *clone)
-{
- if (clone->writetrans)
- ast_translator_free_path(clone->writetrans);
- if (clone->readtrans)
- ast_translator_free_path(clone->readtrans);
- clone->writetrans = NULL;
- clone->readtrans = NULL;
- clone->rawwriteformat = clone->nativeformats;
- clone->rawreadformat = clone->nativeformats;
+static void free_translation(struct ast_channel *clonechan)
+{
+ if (clonechan->writetrans)
+ ast_translator_free_path(clonechan->writetrans);
+ if (clonechan->readtrans)
+ ast_translator_free_path(clonechan->readtrans);
+ clonechan->writetrans = NULL;
+ clonechan->readtrans = NULL;
+ clonechan->rawwriteformat = clonechan->nativeformats;
+ clonechan->rawreadformat = clonechan->nativeformats;
}
/*! \brief Hangup a channel */
@@ -3617,17 +3617,17 @@
return rc;
}
-int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone)
+int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clonechan)
{
int res = -1;
struct ast_channel *final_orig, *final_clone, *base;
retrymasq:
final_orig = original;
- final_clone = clone;
+ final_clone = clonechan;
ast_channel_lock(original);
- while (ast_channel_trylock(clone)) {
+ while (ast_channel_trylock(clonechan)) {
ast_channel_unlock(original);
usleep(1);
ast_channel_lock(original);
@@ -3638,59 +3638,59 @@
if (original->_bridge && (original->_bridge != ast_bridged_channel(original)) && (original->_bridge->_bridge != original))
final_orig = original->_bridge;
- if (clone->_bridge && (clone->_bridge != ast_bridged_channel(clone)) && (clone->_bridge->_bridge != clone))
- final_clone = clone->_bridge;
+ if (clonechan->_bridge && (clonechan->_bridge != ast_bridged_channel(clonechan)) && (clonechan->_bridge->_bridge != clonechan))
+ final_clone = clonechan->_bridge;
if (final_clone->tech->get_base_channel && (base = final_clone->tech->get_base_channel(final_clone))) {
final_clone = base;
}
- if ((final_orig != original) || (final_clone != clone)) {
+ if ((final_orig != original) || (final_clone != clonechan)) {
/* Lots and lots of deadlock avoidance. The main one we're competing with
* is ast_write(), which locks channels recursively, when working with a
* proxy channel. */
if (ast_channel_trylock(final_orig)) {
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
goto retrymasq;
}
if (ast_channel_trylock(final_clone)) {
ast_channel_unlock(final_orig);
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
goto retrymasq;
}
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
original = final_orig;
- clone = final_clone;
- }
-
- if (original == clone) {
+ clonechan = final_clone;
+ }
+
+ if (original == clonechan) {
ast_log(LOG_WARNING, "Can't masquerade channel '%s' into itself!\n", original->name);
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
return -1;
}
ast_debug(1, "Planning to masquerade channel %s into the structure of %s\n",
- clone->name, original->name);
+ clonechan->name, original->name);
if (original->masq) {
ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
original->masq->name, original->name);
- } else if (clone->masqr) {
+ } else if (clonechan->masqr) {
ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
- clone->name, clone->masqr->name);
+ clonechan->name, clonechan->masqr->name);
} else {
- original->masq = clone;
- clone->masqr = original;
+ original->masq = clonechan;
+ clonechan->masqr = original;
ast_queue_frame(original, &ast_null_frame);
- ast_queue_frame(clone, &ast_null_frame);
- ast_debug(1, "Done planning to masquerade channel %s into the structure of %s\n", clone->name, original->name);
+ ast_queue_frame(clonechan, &ast_null_frame);
+ ast_debug(1, "Done planning to masquerade channel %s into the structure of %s\n", clonechan->name, original->name);
res = 0;
}
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
return res;
@@ -3751,20 +3751,20 @@
\note Assumes locks will be in place on both channels when called.
*/
-static void clone_variables(struct ast_channel *original, struct ast_channel *clone)
+static void clone_variables(struct ast_channel *original, struct ast_channel *clonechan)
{
struct ast_var_t *current, *newvar;
/* Append variables from clone channel into original channel */
/* XXX Is this always correct? We have to in order to keep MACROS working XXX */
- if (AST_LIST_FIRST(&clone->varshead))
- AST_LIST_APPEND_LIST(&original->varshead, &clone->varshead, entries);
+ if (AST_LIST_FIRST(&clonechan->varshead))
+ AST_LIST_APPEND_LIST(&original->varshead, &clonechan->varshead, entries);
/* then, dup the varshead list into the clone */
AST_LIST_TRAVERSE(&original->varshead, current, entries) {
newvar = ast_var_assign(current->name, current->value);
if (newvar)
- AST_LIST_INSERT_TAIL(&clone->varshead, newvar, entries);
+ AST_LIST_INSERT_TAIL(&clonechan->varshead, newvar, entries);
}
}
@@ -3778,11 +3778,11 @@
int x,i;
int res=0;
int origstate;
- struct ast_frame *cur;
+ struct ast_frame *current;
const struct ast_channel_tech *t;
void *t_pvt;
struct ast_callerid tmpcid;
- struct ast_channel *clone = original->masq;
+ struct ast_channel *clonechan = original->masq;
struct ast_cdr *cdr;
int rformat = original->readformat;
int wformat = original->writeformat;
@@ -3792,10 +3792,10 @@
char zombn[AST_CHANNEL_NAME];
ast_debug(4, "Actually Masquerading %s(%d) into the structure of %s(%d)\n",
- clone->name, clone->_state, original->name, original->_state);
+ clonechan->name, clonechan->_state, original->name, original->_state);
manager_event(EVENT_FLAG_CALL, "Masquerade", "Clone: %s\r\nCloneState: %s\r\nOriginal: %s\r\nOriginalState: %s\r\n",
- clone->name, ast_state2str(clone->_state), original->name, ast_state2str(original->_state));
+ clonechan->name, ast_state2str(clonechan->_state), original->name, ast_state2str(original->_state));
/* XXX This is a seriously wacked out operation. We're essentially putting the guts of
the clone channel into the original channel. Start by killing off the original
@@ -3803,24 +3803,24 @@
while the features are nice, the cost is very high in terms of pure nastiness. XXX */
/* We need the clone's lock, too */
- ast_channel_lock(clone);
-
- ast_debug(2, "Got clone lock for masquerade on '%s' at %p\n", clone->name, &clone->lock_dont_use);
+ ast_channel_lock(clonechan);
+
+ ast_debug(2, "Got clone lock for masquerade on '%s' at %p\n", clonechan->name, &clonechan->lock_dont_use);
/* Having remembered the original read/write formats, we turn off any translation on either
one */
- free_translation(clone);
+ free_translation(clonechan);
free_translation(original);
/* Unlink the masquerade */
original->masq = NULL;
- clone->masqr = NULL;
+ clonechan->masqr = NULL;
/* Save the original name */
ast_copy_string(orig, original->name, sizeof(orig));
/* Save the new name */
- ast_copy_string(newn, clone->name, sizeof(newn));
+ ast_copy_string(newn, clonechan->name, sizeof(newn));
/* Create the masq name */
snprintf(masqn, sizeof(masqn), "%s<MASQ>", newn);
@@ -3828,31 +3828,31 @@
ast_string_field_set(original, name, newn);
/* Mangle the name of the clone channel */
- ast_string_field_set(clone, name, masqn);
+ ast_string_field_set(clonechan, name, masqn);
/* Notify any managers of the change, first the masq then the other */
- manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clone->uniqueid);
+ manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clonechan->uniqueid);
manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", orig, newn, original->uniqueid);
/* Swap the technologies */
t = original->tech;
- original->tech = clone->tech;
- clone->tech = t;
+ original->tech = clonechan->tech;
+ clonechan->tech = t;
/* Swap the cdrs */
cdr = original->cdr;
- original->cdr = clone->cdr;
- clone->cdr = cdr;
+ original->cdr = clonechan->cdr;
+ clonechan->cdr = cdr;
t_pvt = original->tech_pvt;
- original->tech_pvt = clone->tech_pvt;
- clone->tech_pvt = t_pvt;
+ original->tech_pvt = clonechan->tech_pvt;
+ clonechan->tech_pvt = t_pvt;
/* Swap the alertpipes */
for (i = 0; i < 2; i++) {
x = original->alertpipe[i];
- original->alertpipe[i] = clone->alertpipe[i];
- clone->alertpipe[i] = x;
+ original->alertpipe[i] = clonechan->alertpipe[i];
+ clonechan->alertpipe[i] = x;
}
/*
@@ -3871,10 +3871,10 @@
AST_LIST_HEAD_SET_NOLOCK(&tmp_readq, NULL);
AST_LIST_APPEND_LIST(&tmp_readq, &original->readq, frame_list);
- AST_LIST_APPEND_LIST(&original->readq, &clone->readq, frame_list);
-
- while ((cur = AST_LIST_REMOVE_HEAD(&tmp_readq, frame_list))) {
- AST_LIST_INSERT_TAIL(&original->readq, cur, frame_list);
+ AST_LIST_APPEND_LIST(&original->readq, &clonechan->readq, frame_list);
+
+ while ((current = AST_LIST_REMOVE_HEAD(&tmp_readq, frame_list))) {
+ AST_LIST_INSERT_TAIL(&original->readq, current, frame_list);
if (original->alertpipe[1] > -1) {
int poke = 0;
write(original->alertpipe[1], &poke, sizeof(poke));
@@ -3884,77 +3884,77 @@
/* Swap the raw formats */
x = original->rawreadformat;
- original->rawreadformat = clone->rawreadformat;
- clone->rawreadformat = x;
+ original->rawreadformat = clonechan->rawreadformat;
+ clonechan->rawreadformat = x;
x = original->rawwriteformat;
- original->rawwriteformat = clone->rawwriteformat;
- clone->rawwriteformat = x;
-
- clone->_softhangup = AST_SOFTHANGUP_DEV;
+ original->rawwriteformat = clonechan->rawwriteformat;
+ clonechan->rawwriteformat = x;
+
+ clonechan->_softhangup = AST_SOFTHANGUP_DEV;
/* And of course, so does our current state. Note we need not
call ast_setstate since the event manager doesn't really consider
these separate. We do this early so that the clone has the proper
state of the original channel. */
origstate = original->_state;
- original->_state = clone->_state;
- clone->_state = origstate;
-
- if (clone->tech->fixup){
- res = clone->tech->fixup(original, clone);
+ original->_state = clonechan->_state;
+ clonechan->_state = origstate;
+
+ if (clonechan->tech->fixup){
+ res = clonechan->tech->fixup(original, clonechan);
if (res)
- ast_log(LOG_WARNING, "Fixup failed on channel %s, strange things may happen.\n", clone->name);
+ ast_log(LOG_WARNING, "Fixup failed on channel %s, strange things may happen.\n", clonechan->name);
}
/* Start by disconnecting the original's physical side */
- if (clone->tech->hangup)
- res = clone->tech->hangup(clone);
+ if (clonechan->tech->hangup)
+ res = clonechan->tech->hangup(clonechan);
if (res) {
ast_log(LOG_WARNING, "Hangup failed! Strange things may happen!\n");
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
return -1;
}
snprintf(zombn, sizeof(zombn), "%s<ZOMBIE>", orig);
/* Mangle the name of the clone channel */
- ast_string_field_set(clone, name, zombn);
- manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", masqn, zombn, clone->uniqueid);
+ ast_string_field_set(clonechan, name, zombn);
+ manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", masqn, zombn, clonechan->uniqueid);
/* Update the type. */
t_pvt = original->monitor;
- original->monitor = clone->monitor;
- clone->monitor = t_pvt;
+ original->monitor = clonechan->monitor;
+ clonechan->monitor = t_pvt;
/* Keep the same language. */
- ast_string_field_set(original, language, clone->language);
+ ast_string_field_set(original, language, clonechan->language);
/* Copy the FD's other than the generator fd */
for (x = 0; x < AST_MAX_FDS; x++) {
if (x != AST_GENERATOR_FD)
- ast_channel_set_fd(original, x, clone->fds[x]);
- }
-
- ast_app_group_update(clone, original);
+ ast_channel_set_fd(original, x, clonechan->fds[x]);
+ }
+
+ ast_app_group_update(clonechan, original);
/* Move data stores over */
- if (AST_LIST_FIRST(&clone->datastores)) {
+ if (AST_LIST_FIRST(&clonechan->datastores)) {
struct ast_datastore *ds;
- AST_LIST_APPEND_LIST(&original->datastores, &clone->datastores, entry);
+ AST_LIST_APPEND_LIST(&original->datastores, &clonechan->datastores, entry);
AST_LIST_TRAVERSE(&original->datastores, ds, entry) {
if (ds->info->chan_fixup)
- ds->info->chan_fixup(ds->data, clone, original);
- }
- }
-
- clone_variables(original, clone);
+ ds->info->chan_fixup(ds->data, clonechan, original);
+ }
+ }
+
+ clone_variables(original, clonechan);
/* Presense of ADSI capable CPE follows clone */
- original->adsicpe = clone->adsicpe;
+ original->adsicpe = clonechan->adsicpe;
/* Bridge remains the same */
/* CDR fields remain the same */
/* XXX What about blocking, softhangup, blocker, and lock and blockproc? XXX */
/* Application and data remain the same */
/* Clone exception becomes real one, as with fdno */
- ast_copy_flags(original, clone, AST_FLAG_EXCEPTION);
- original->fdno = clone->fdno;
+ ast_copy_flags(original, clonechan, AST_FLAG_EXCEPTION);
+ original->fdno = clonechan->fdno;
/* Schedule context remains the same */
/* Stream stuff stays the same */
/* Keep the original state. The fixup code will need to work with it most likely */
@@ -3962,14 +3962,14 @@
/* Just swap the whole structures, nevermind the allocations, they'll work themselves
out. */
tmpcid = original->cid;
- original->cid = clone->cid;
- clone->cid = tmpcid;
+ original->cid = clonechan->cid;
+ clonechan->cid = tmpcid;
/* Restore original timing file descriptor */
ast_channel_set_fd(original, AST_TIMING_FD, original->timingfd);
/* Our native formats are different now */
- original->nativeformats = clone->nativeformats;
+ original->nativeformats = clonechan->nativeformats;
/* Context, extension, priority, app data, jump table, remain the same */
/* pvt switches. pbx stays the same, as does next */
@@ -3981,18 +3981,18 @@
ast_set_read_format(original, rformat);
/* Copy the music class */
- ast_string_field_set(original, musicclass, clone->musicclass);
+ ast_string_field_set(original, musicclass, clonechan->musicclass);
ast_debug(1, "Putting channel %s in %d/%d formats\n", original->name, wformat, rformat);
/* Okay. Last thing is to let the channel driver know about all this mess, so he
can fix up everything as best as possible */
if (original->tech->fixup) {
- res = original->tech->fixup(clone, original);
+ res = original->tech->fixup(clonechan, original);
if (res) {
ast_log(LOG_WARNING, "Channel for type '%s' could not fixup channel %s\n",
original->tech->type, original->name);
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
return -1;
}
} else
@@ -4006,25 +4006,25 @@
/* Now, at this point, the "clone" channel is totally F'd up. We mark it as
a zombie so nothing tries to touch it. If it's already been marked as a
zombie, then free it now (since it already is considered invalid). */
- if (ast_test_flag(clone, AST_FLAG_ZOMBIE)) {
- ast_debug(1, "Destroying channel clone '%s'\n", clone->name);
- ast_channel_unlock(clone);
+ if (ast_test_flag(clonechan, AST_FLAG_ZOMBIE)) {
+ ast_debug(1, "Destroying channel clone '%s'\n", clonechan->name);
+ ast_channel_unlock(clonechan);
manager_event(EVENT_FLAG_CALL, "Hangup",
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"Cause: %d\r\n"
"Cause-txt: %s\r\n",
- clone->name,
- clone->uniqueid,
- clone->hangupcause,
- ast_cause2str(clone->hangupcause)
+ clonechan->name,
+ clonechan->uniqueid,
+ clonechan->hangupcause,
+ ast_cause2str(clonechan->hangupcause)
);
- ast_channel_free(clone);
+ ast_channel_free(clonechan);
} else {
- ast_debug(1, "Released clone lock on '%s'\n", clone->name);
- ast_set_flag(clone, AST_FLAG_ZOMBIE);
- ast_queue_frame(clone, &ast_null_frame);
- ast_channel_unlock(clone);
+ ast_debug(1, "Released clone lock on '%s'\n", clonechan->name);
+ ast_set_flag(clonechan, AST_FLAG_ZOMBIE);
+ ast_queue_frame(clonechan, &ast_null_frame);
+ ast_channel_unlock(clonechan);
}
/* Signal any blocker */
Modified: trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/trunk/main/config.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Sun Aug 10 14:35:50 2008
@@ -1060,10 +1060,10 @@
/* #exec </path/to/executable>
We create a tmp file, then we #include it, then we delete it. */
if (!do_include) {
- struct timeval tv = ast_tvnow();
+ struct timeval now = ast_tvnow();
if (!ast_test_flag(&flags, CONFIG_FLAG_NOCACHE))
config_cache_attribute(configfile, ATTRIBUTE_EXEC, NULL, who_asked);
- snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d%d.%ld", (int)tv.tv_sec, (int)tv.tv_usec, (long)pthread_self());
+ snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d%d.%ld", (int)now.tv_sec, (int)now.tv_usec, (long)pthread_self());
snprintf(cmd, sizeof(cmd), "%s > %s 2>&1", cur, exec_file);
ast_safe_system(cmd);
cur = exec_file;
@@ -1260,17 +1260,17 @@
* incorrectly cause no reload to be necessary. */
char fn2[256];
#ifdef AST_INCLUDE_GLOB
- int glob_ret;
- glob_t globbuf = { .gl_offs = 0 };
- glob_ret = glob(cfinclude->include, MY_GLOB_FLAGS, NULL, &globbuf);
+ int glob_return;
+ glob_t glob_buf = { .gl_offs = 0 };
+ glob_return = glob(cfinclude->include, MY_GLOB_FLAGS, NULL, &glob_buf);
/* On error, we reparse */
- if (glob_ret == GLOB_NOSPACE || glob_ret == GLOB_ABORTED)
+ if (glob_return == GLOB_NOSPACE || glob_return == GLOB_ABORTED)
unchanged = 0;
else {
/* loop over expanded files */
int j;
- for (j = 0; j < globbuf.gl_pathc; j++) {
- ast_copy_string(fn2, globbuf.gl_pathv[j], sizeof(fn2));
+ for (j = 0; j < glob_buf.gl_pathc; j++) {
+ ast_copy_string(fn2, glob_buf.gl_pathv[j], sizeof(fn2));
#else
ast_copy_string(fn2, cfinclude->include);
#endif
@@ -1387,9 +1387,9 @@
}
if (process_buf) {
- char *buf = ast_strip(process_buf);
- if (!ast_strlen_zero(buf)) {
- if (process_text_line(cfg, &cat, buf, lineno, fn, flags, comment_buffer, lline_buffer, suggested_include_file, &last_cat, &last_var, who_asked)) {
+ char *buffer = ast_strip(process_buf);
+ if (!ast_strlen_zero(buffer)) {
+ if (process_text_line(cfg, &cat, buffer, lineno, fn, flags, comment_buffer, lline_buffer, suggested_include_file, &last_cat, &last_var, who_asked)) {
cfg = NULL;
break;
}
Modified: trunk/main/db1-ast/btree/bt_delete.c
URL: http://svn.digium.com/view/asterisk/trunk/main/db1-ast/btree/bt_delete.c?view=diff&rev=137082&r1=137081&r2=137082
==============================================================================
--- trunk/main/db1-ast/btree/bt_delete.c (original)
+++ trunk/main/db1-ast/btree/bt_delete.c Sun Aug 10 14:35:50 2008
@@ -150,7 +150,7 @@
EPG *e;
EPGNO *parent;
PAGE *h;
- indx_t index = 0;
+ indx_t idx = 0;
pgno_t pgno;
recno_t nextpg, prevpg;
int exact, level;
@@ -188,8 +188,8 @@
/* Move to the next index. */
if (parent->index != NEXTINDEX(h) - 1) {
- index = parent->index + 1;
- BT_PUSH(t, h->pgno, index);
+ idx = parent->index + 1;
+ BT_PUSH(t, h->pgno, idx);
break;
}
mpool_put(t->bt_mp, h, 0);
@@ -198,7 +198,7 @@
/* Restore the stack. */
while (level--) {
/* Push the next level down onto the stack. */
- bi = GETBINTERNAL(h, index);
+ bi = GETBINTERNAL(h, idx);
pgno = bi->pgno;
BT_PUSH(t, pgno, 0);
@@ -208,7 +208,7 @@
/* Get the next level down. */
if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
return (1);
- index = 0;
+ idx = 0;
}
mpool_put(t->bt_mp, h, 0);
if ((h = mpool_get(t->bt_mp, nextpg, 0)) == NULL)
@@ -243,8 +243,8 @@
/* Move to the next index. */
if (parent->index != 0) {
- index = parent->index - 1;
- BT_PUSH(t, h->pgno, index);
+ idx = parent->index - 1;
+ BT_PUSH(t, h->pgno, idx);
break;
}
mpool_put(t->bt_mp, h, 0);
@@ -253,7 +253,7 @@
/* Restore the stack. */
while (level--) {
/* Push the next level down onto the stack. */
- bi = GETBINTERNAL(h, index);
+ bi = GETBINTERNAL(h, idx);
pgno = bi->pgno;
/* Lose the currently pinned page. */
@@ -263,8 +263,8 @@
if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
return (1);
- index = NEXTINDEX(h) - 1;
- BT_PUSH(t, pgno, index);
+ idx = NEXTINDEX(h) - 1;
+ BT_PUSH(t, pgno, idx);
}
mpool_put(t->bt_mp, h, 0);
if ((h = mpool_get(t->bt_mp, prevpg, 0)) == NULL)
@@ -382,7 +382,7 @@
BINTERNAL *bi;
PAGE *pg;
EPGNO *parent;
- indx_t cnt, index, *ip, offset;
+ indx_t cnt, idx, *ip, offset;
u_int32_t nksize;
char *from;
@@ -403,8 +403,8 @@
if ((pg = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
return (RET_ERROR);
- index = parent->index;
- bi = GETBINTERNAL(pg, index);
+ idx = parent->index;
+ bi = GETBINTERNAL(pg, idx);
/* Free any overflow pages. */
if (bi->flags & P_BIGKEY &&
@@ -436,11 +436,11 @@
pg->upper += nksize;
/* Adjust indices' offsets, shift the indices down. */
- offset = pg->linp[index];
- for (cnt = index, ip = &pg->linp[0]; cnt--; ++ip)
+ offset = pg->linp[idx];
+ for (cnt = idx, ip = &pg->linp[0]; cnt--; ++ip)
if (ip[0] < offset)
ip[0] += nksize;
- for (cnt = NEXTINDEX(pg) - index; --cnt; ++ip)
+ for (cnt = NEXTINDEX(pg) - idx; --cnt; ++ip)
ip[0] = ip[1] < offset ? ip[1] + nksize : ip[1];
pg->lower -= sizeof(indx_t);
}
@@ -471,11 +471,11 @@
* RET_SUCCESS, RET_ERROR.
*/
int
-__bt_dleaf(t, key, h, index)
+__bt_dleaf(t, key, h, idx)
BTREE *t;
const DBT *key;
PAGE *h;
- u_int index;
+ u_int idx;
{
BLEAF *bl;
indx_t cnt, *ip, offset;
@@ -486,12 +486,12 @@
/* If this record is referenced by the cursor, delete the cursor. */
if (F_ISSET(&t->bt_cursor, CURS_INIT) &&
!F_ISSET(&t->bt_cursor, CURS_ACQUIRE) &&
- t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index == index &&
- __bt_curdel(t, key, h, index))
+ t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index == idx &&
+ __bt_curdel(t, key, h, idx))
return (RET_ERROR);
/* If the entry uses overflow pages, make them available for reuse. */
- to = bl = GETBLEAF(h, index);
+ to = bl = GETBLEAF(h, idx);
if (bl->flags & P_BIGKEY && __ovfl_delete(t, bl->bytes) == RET_ERROR)
return (RET_ERROR);
if (bl->flags & P_BIGDATA &&
@@ -505,18 +505,18 @@
h->upper += nbytes;
/* Adjust the indices' offsets, shift the indices down. */
- offset = h->linp[index];
- for (cnt = index, ip = &h->linp[0]; cnt--; ++ip)
+ offset = h->linp[idx];
+ for (cnt = idx, ip = &h->linp[0]; cnt--; ++ip)
if (ip[0] < offset)
ip[0] += nbytes;
- for (cnt = NEXTINDEX(h) - index; --cnt; ++ip)
+ for (cnt = NEXTINDEX(h) - idx; --cnt; ++ip)
[... 980 lines stripped ...]
More information about the asterisk-commits
mailing list