summaryrefslogtreecommitdiff
path: root/doc/CODING-GUIDELINES
AgeCommit message (Collapse)Author
2012-08-30Restore CODING-GUIDELINES to doc folderMatthew Jordan
In r294740, the CODING-GUIDELINES was removed from the doc folder in favor of the content on the Asterisk wiki. Some folks still look in the doc folder initially for coding guideline suggestions; as such, this patch adds a CODING-GUIDELINES file back into the doc folder. The content of the file merely points to the correct page on the Asterisk wiki where the coding guidelines currently live. (closes issue ASTERISK-20279) Reported by: Andrew Latham Patches: CODING-GUIDELINES.diff uploaded by Andrew Latham (license 5985) ........ Merged revisions 371961 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371962 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371963 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-11Merged revisions 294740 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r294740 | russell | 2010-11-11 16:13:38 -0600 (Thu, 11 Nov 2010) | 11 lines Remove most of the contents of the doc dir in favor of the wiki content. This merge does the following things: * Removes most of the contents from the doc/ directory in favor of the wiki - http://wiki.asterisk.org/ * Updates the build_tools/prep_tarball script to know how to export the contents of the wiki in both PDF and plain text formats so that the documentation is still included in Asterisk release tarballs. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-26Reorder option flags. Change guidelines so that example code is consistent ↵Tilghman Lesher
with guidelines git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10Merged revisions 211583 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r211583 | tilghman | 2009-08-10 14:48:48 -0500 (Mon, 10 Aug 2009) | 1 line Conversion specifiers, not format specifiers ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01(closes issue #15515)Bradley Latus
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21Note that we use tabs instead of spaces for indentation.Russell Bryant
I'm surprised this was never actually in here... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15Last batch of 'static' qualifiers for module-level global variables.Kevin P. Fleming
Fix up modules in the 'apps' directory, and also correct the bad example of enum definitions in include/asterisk/app.h, which many developers followed (thanks for reading the documentation!). In addition, add some basic usage examples of the 'pahole' and 'pglobal' tools to the coding guidelines. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Update references to bugs.digium.com and reviewboard.digium.com to the new URLs.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-31Mostly just whitespace, but also convert 'CVS' to 'SVN' in a coupleSean Bright
places and fix a few typos I found in the CODING_GUIDELINES. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09(closes issue #13557)Steve Murphy
Reported by: nickpeirson Patches: pbx.c.patch uploaded by nickpeirson (license 579) replace_bzero+bcopy.patch uploaded by nickpeirson (license 579) Tested by: nickpeirson, murf 1. replaced all refs to bzero and bcopy to memset and memmove instead. 2. added a note to the CODING-GUIDELINES 3. add two macros to asterisk.h to prevent bzero, bcopy from creeping back into the source 4. removed bzero from configure, configure.ac, autoconfig.h.in git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02Add a locking section to the coding guidelines document.Russell Bryant
This section covers some locking fundamentals, as well as some information on locking as it is used in Asterisk. It describes some of the ways that are used and could be used to achieve deadlock avoidance. It also demonstrates the unfortunate conclusion that with the use of recursive locks, none of the constructs in use today are failsafe from deadlocks. Finally, it makes some recommendations for new code being written. As proper locking strategies is a complex subject, this section still has room for expansion and improvement. This is a result of collaboration between Luigi Rizzo and myself on the asterisk-dev mailing list. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30a few minor updates and typo fixesRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19Older versions of GNU gcc do not allow 'NULL' as sentinel.Michiel van Baak
They want (char *)NULL as sentinel. An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4 This commit introduces a contstant SENTINEL which is declared as: #define SENTINEL ((char *)NULL) All places I could test compile on my openbsd system are converted. Update CODING-GUIDELINES to tell about this constant. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17fileio.h does not exist; io.h does, though.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-261) Make braces mandatory for if/for/while, even around single statements.Tilghman Lesher
2) Revise the argument parsing section, showing use of the standard macros. 3) Fix a typo. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18A minor update, caused by a recent bug report ;-)Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18small documentation update (nothing important).Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10add a bit of info on the build infrastructureLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22new info on the management of headersLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14Merged revisions 82376 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82376 | mmichelson | 2007-09-14 09:42:29 -0500 (Fri, 14 Sep 2007) | 5 lines Fixing a typo in the coding guidelines (closes issue #10717, reported and patched by leedm777) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05add a note about inline commentsRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24add a note about using the intenal API for creating detached threadsRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-04a small upgrade to the coding standard, and an update to the code that ↵Steve Murphy
triggered the upgrade. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11More spelling fixes (issue 7930)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11fix minor typo in coding guidelinesRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23update to mention svn instead of cvsRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-10fix typo in the provided indent commandRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-04Clarify syntax of new manager events that reports a status.Olle Johansson
We do not longer approve "ThisEventOn" and "ThisEventOff" named events, they need to be named "ThisEvent" with a status header showing the current status. (Approved by Mark) Old events won't be changed to keep backwards compatibility, until we have a revision plan for the AMI. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-12major dialplan functions updateKevin P. Fleming
deprecate LANGUAGE() and MUSICCLASS(), in favor of CHANNEL() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-13Various cleanups from comments in an email from Luigi Rizzo. Thank you!Russell Bryant
- Use a cleaner syntax for declaring the allocation macros - Fix return value for ast_strdup/ast_strndup - remove safe_strdup from app_macro, since ast_strup does the same thing - fix a place in app_queue where ast_calloc+strncpy was used instead of ast_strdup. If you are helping out with these conversions, please watch out for other places where this is done. - add a note to the coding guidelines about the fix to app_queue git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-11fix typo, thanks Qwell!Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-10Add wrappers for commonly used memory allocation functions. These wrappersRussell Bryant
add an automatically generated Asterisk log message if the allocation fails for some reason. Otherwise, they are functionally the same, with the exception of ast_strdup and ast_strndup. These functions have the added ability to accept a NULL argument without error, which will just be ignored without generating an error. The coding guidelines have also been updated to reflect all of this information. (issue #4996) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29remove extraneous svn:executable propertiesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-10issue #5709Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-31various text/formatting updates (issue #5503 plus some minor additions)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-19update guidelines to explain indent parameteres (bug #4742)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-10more thoughtsKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-10minor fixes, and more topics coveredKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-07update guidelines to follow their own rules for whitespace (bug #4486)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-02add guidelines for doxygen documentation writing (bug #4417, with mods)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-02add a minor allocation/zeroing guidelineKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-19add IAXPEER function (bug #4310, with minor formatting and doc changes)Kevin P. Fleming
add note to CODING-GUIDELINES about minimizing indentation in function bodies git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-15more strncpy -> ast_copy_string conversions, fixing some buglets along the wayKevin P. Fleming
add recommendation to CODING-GUIDELINES to use ast_copy_string instead of strncpy in new code git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-01add some notes regarding the distinction between applications and functionsKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-23add guideline comment about not using '%i' with scanfKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-01Update README to reflect modern Asterisk features and requirementsKevin P. Fleming
Add note in UPGRADE.txt about compiler requirements Add note to CODING-GUIDELINES about new policy for CLI command structure git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-19Modify code example suggestionAnthony Minessale II
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-18Additional coding guidelines (bug #3374)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-11-08Provide "ident" command line (at least the start of one)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4185 65c4cc65-6c06-0410-ace0-fbb531ad65f3