aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/strings.h
AgeCommit message (Collapse)AuthorFilesLines
2007-10-15Merged revisions 85561 via svnmerge from russell1-3/+3
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85561 | russell | 2007-10-15 11:34:13 -0500 (Mon, 15 Oct 2007) | 4 lines Make a few changes so that characters in the upper half of the ISO-8859-1 character set don't get stripped when reading configuration. (closes issue #10982, dandre) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85562 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-05Doxygen cleanups/fixes.qwell1-8/+8
Closes issue #10654, patch by snuffy git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81560 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22Merged revisions 80362 via svnmerge from russell1-1/+19
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80362 | russell | 2007-08-22 15:21:36 -0500 (Wed, 22 Aug 2007) | 34 lines Merge changes from team/russell/iax_refcount. This set of changes fixes problems with the handling of iax2_user and iax2_peer objects. It was very possible for a thread to still hold a reference to one of these objects while a reload operation tries to delete them. The fix here is to ensure that all references to these objects are tracked so that they can't go away while still in use. To accomplish this, I used the astobj2 reference counted object model. This code has been in one of Luigi Rizzo's branches for a long time and was primarily developed by one of his students, Marta Carbone. I wanted to go ahead and bring this in to 1.4 because there are other problems similar to the ones fixed by these changes, so we might as well go ahead and use the new astobj if we're going to go through all of the work necessary to fix the problems. As a nice side benefit of these changes, peer and user handling got more efficient. Using astobj2 lets us not hold the container lock for peers or users nearly as long while iterating. Also, by changing a define at the top of chan_iax2.c, the objects will be distributed in a hash table, drastically increasing lookup speed in these containers, which will have a very big impact on systems that have a large number of users or peers. The use of the hash table will be made the default in trunk. It is not the default in 1.4 because it changes the behavior slightly. Previously, since peers and users were stored in memory in the same order they were specified in the configuration file, you could influence peer and user matching order based on the order they are specified in the configuration. The hash table does not guarantee any order in the container, so this behavior will be going away. It just means that you have to be a little more careful ensuring that peers and users are matched explicitly and not forcing chan_iax2 to have to guess which user is the right one based on secret, host, and access list settings, instead of simply using the username. If you have any questions, feel free to ask on the asterisk-dev list. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80387 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-17Merged revisions 79904 via svnmerge from qwell1-0/+7
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10430) ........ r79904 | qwell | 2007-08-17 14:12:19 -0500 (Fri, 17 Aug 2007) | 11 lines Don't send a semicolon over the wire in sip notify messages. Caused by fix for issue 9938. I basically took the code that existed before 9938 was fixed, and copied it into a new function - ast_unescape_semicolon There should be very few places this will be needed (pbx_config does NOT need this (see issue 9938 for details)) Issue 10430, patch by me, with help/ideas from murf (thanks murf). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79905 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18Merge in ast_strftime branch, which changes timestamps to be accurate to the ↵tilghman1-0/+10
microsecond, instead of only to the second git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16Merge a bunch of doxygen updates to header files. This includes changes torussell1-10/+18
use the \retval tag for documenting return values, fixing various warnings when generating the documentation, and various other things. (closes issue #10203, snuffy) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75164 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-28Remove the ill-advised ast_restrdupa API call and related structurestilghman1-18/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72492 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-07Fix a bunch of doxygen errors and document more thingsrussell1-12/+12
(issue #9842, snuffy) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@68339 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-19As the comment in the diff says:rizzo1-6/+16
AST_INLINE_API() is a macro that takes a block of code as an argument. Using preprocessor #directives in the argument is not supported by all compilers, and it is a bit of an obfuscation anyways, so avoid it. As a workaround, define a macro that produces either its argument or nothing, and use that instead of #ifdef/#endif within the argument to AST_INLINE_API(). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@51312 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-10Return the useless casts that ensure this file is C++ clean. (issue #8602 ↵file1-4/+6
reported by mikma) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@50397 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-04ensure that the proper file/function/line shows up for dynamic string ↵kpfleming1-3/+27
threadstorage objects remove pointless casts git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49580 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-04Merged revisions 49553 via svnmerge from kpfleming1-1/+9
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r49553 | kpfleming | 2007-01-04 16:51:01 -0600 (Thu, 04 Jan 2007) | 2 lines add support for tracking thread-local-storage objects that exist via 'threadstorage' CLI commands ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49578 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-18apply the proposed fix for bug 8602rizzo1-6/+30
http://bugs.digium.com/view.php?id=8602 (i am not sure if there is still missing cast in front of the alloca() call - being a macro this is probably triggered only when actually used). Add function ast_str_reset() to reinitialize the string to an empty string instead of playing with the internal fields. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48560 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-16replace ast_build_string() with ast_str_*() functions.rizzo1-0/+21
This makes the code easier to follow and saves some copies to intermediate buffers. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48515 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-15simplify the ast_dynamic_str_*.... routines byrizzo1-147/+61
renaming them to ast_str ... and putting the struct ast_threadstorage pointer into the struct ast_str. This makes the code a lot more readable. At this point we can use these routines also to replace ast_build_string(). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48510 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-15move the dynamic string support in a better place i.e. string.hrizzo1-0/+396
While doing this, add a bit of documentation, and slightly extend the functionality as follows: + a max_len of -1 means that we take whatever the current size is, and never try to extend the buffer; + add support for alloca()-ted dynamic strings, which is very useful for all cases where we do an ast_build_string() now. Next step is to simplify the interface by using shorter names (e.g. ast_str as a prefix) and removing the _thread variant of the functions by saving the threadstorage reference into the struct ast_str. This can be done by overloading the 'type' field. Finally, I will do my best to remove the convoluted interface that results from trying to support platforms without va_copy(). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48509 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-15Many Solaris fixes - this moves some of the stuff from utils.c to strcompat.cqwell1-24/+0
Every OS uses strcompat now - this was done on purpose. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42982 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-10Fixed. Done. Good. Make ast_join work like it used to.file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37348 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-10Unbreak ast_join due to whitespace changesfile1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37347 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-26add the missing prototype for the included asprintfrussell1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22526 f38db490-d61c-443f-a65b-d21fe96a405b
2006-03-24as discussed on the -dev list, introduce a macro to simplify therizzo1-0/+5
writing of common constructs like chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>"; (or the if/then/else form) into chan = S_OR(cdr->channel, "<unknown>"); The name can be changed if we find a better (and not too long) one; currently, it is S as String, OR as it mimics the behaviour of the || operator, but applied to strings. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@14747 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-23add 'consumed' argument to ast_get_time_t, so callers can know how many ↵kpfleming1-1/+2
characters were used in the parser update pbx_dundi to use ast_get_time_t eliminate some compiler warnings git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10871 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-15add API function for parsing strings to time_t (issue #6320, with mods)kpfleming1-1/+10
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10105 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-07Bug 6164 - Allow ast_skip_blanks on const strings without spewing warningtilghman1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7854 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-05Merged revisions 7827 via svnmerge fromtilghman1-1/+1
/branches/1.2 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7828 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-20- move the string join() function to utils.c since it is used in both cli.c ↵russell1-0/+13
and res_agi.c - reimplement ast_join to be of linear effieciency instead of quadratic - remove some useless checks for "if (e)" - reorder checks for strings starting with '_' to avoid a useless call to ast_join() - check array bounds when parsing arguments to AGI (issue #5868) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7556 f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-29git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7221 ↵kpfleming1-0/+0
f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-01add new GCC-specific macro and force inlining of certain functions where ↵kpfleming1-1/+1
speed is paramount, even when optimization is disabled git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6929 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-26clean up a lot of doxygen errors and warnings (issue #5522)russell1-1/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6865 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-26change ast_strlen_zero to also check for the string to be definedrussell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6862 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-24Doxygen documentation update from oej (issue #5505)russell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6847 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-01add ast_build_string_va(), which accepts a varargs list directlykpfleming1-0/+14
ensure the _entire_ manager_event() output is either queued or sent via ast_carefulwrite() git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6708 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-14don't double define our own string functions on platforms that don't have ↵kpfleming1-2/+2
them (issue #5169) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6587 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-08first set of Cygwin portability stuff (issue #4678)kpfleming1-19/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6547 f38db490-d61c-443f-a65b-d21fe96a405b
2005-08-30major header file cleanup: license, copyrights, descriptions, markers, etc.kpfleming1-4/+15
remove deprecated config_old.c/config_old.h remove unused cvsid.h git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6454 f38db490-d61c-443f-a65b-d21fe96a405b
2005-08-04ensure that strings.h has va_list defined (bug #4900)russell1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6280 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-20move strtoq into new string files (bug #4740)kpfleming1-0/+11
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6171 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-15phase two of string portability stuff:kpfleming1-8/+26
don't need ast_ prefixes on functions use individual #defines for function presence add vasprintf to portability library git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6143 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-15first phase of proper fix for portable string function problems (bug #4669)kpfleming1-3/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6133 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-12convert ast_copy_string to use AST_INLINE_API macro (bug #4682)russell1-7/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6108 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-11simplify (and document!) macro for inlinable API functions (inspired by bug ↵kpfleming1-29/+13
#4603, with slightly different implementation) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6090 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-24add new header fileskpfleming1-0/+226
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6009 f38db490-d61c-443f-a65b-d21fe96a405b