Commit Graph

53 Commits

Author SHA1 Message Date
Matthew Jordan 4781be6e93 Restore CODING-GUIDELINES to doc folder
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
2012-08-30 12:50:03 +00:00
Russell Bryant 893ca656af Merged revisions 294740 via svnmerge from
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
2010-11-11 22:14:25 +00:00
Tilghman Lesher 23b4a700f4 Reorder option flags. Change guidelines so that example code is consistent with guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-26 02:09:58 +00:00
Tilghman Lesher 4344e26b09 Merged revisions 211583 via svnmerge from
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-10 19:49:41 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Bradley Latus 0a47411334 (closes issue #15515)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01 23:25:16 +00:00
Russell Bryant ced2554f60 Note that we use tabs instead of spaces for indentation.
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-07-21 22:22:18 +00:00
Kevin P. Fleming aaeec3b40f Last batch of 'static' qualifiers for module-level global variables.
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-06-15 19:10:10 +00:00
Sean Bright f51bb019bb Update references to bugs.digium.com and reviewboard.digium.com to the new URLs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 21:50:27 +00:00
Sean Bright e1f941d7f6 Mostly just whitespace, but also convert 'CVS' to 'SVN' in a couple
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-12-31 23:07:14 +00:00
Steve Murphy e235a07376 (closes issue #13557)
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-10-09 14:17:33 +00:00
Russell Bryant 604b819b1c Add a locking section to the coding guidelines document.
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-07-02 12:08:33 +00:00
Russell Bryant dc5c54eaf2 a few minor updates and typo fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 12:49:56 +00:00
Michiel van Baak 8e8359465b Older versions of GNU gcc do not allow 'NULL' as sentinel.
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-06-19 20:48:33 +00:00
Tilghman Lesher 631d8e5fbe fileio.h does not exist; io.h does, though.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 15:12:52 +00:00
Tilghman Lesher a616346c6d 1) Make braces mandatory for if/for/while, even around single statements.
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
2008-02-26 18:40:26 +00:00
Olle Johansson d66be1efca A minor update, caused by a recent bug report ;-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 07:56:29 +00:00
Luigi Rizzo 97a87204fc small documentation update (nothing important).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 07:22:26 +00:00
Luigi Rizzo b70e98be1a add a bit of info on the build infrastructure
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10 04:38:49 +00:00
Luigi Rizzo 45491422b8 new info on the management of headers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22 07:10:37 +00:00
Mark Michelson e14ac6f380 Merged revisions 82376 via svnmerge from
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-09-14 14:44:15 +00:00
Russell Bryant bcd0bf437a add a note about inline comments
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 14:59:34 +00:00
Russell Bryant a45cf4d0fb add a note about using the intenal API for creating detached threads
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 19:11:09 +00:00
Steve Murphy 02337303ef a small upgrade to the coding standard, and an update to the code that triggered the upgrade.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-04 17:49:20 +00:00
Tilghman Lesher cfaf938f21 More spelling fixes (issue 7930)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11 17:02:37 +00:00
Russell Bryant 723448c1f1 fix minor typo in coding guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11 04:17:23 +00:00
Russell Bryant 8f08d7cc13 update to mention svn instead of cvs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 02:50:25 +00:00
Russell Bryant d146e7b92c fix typo in the provided indent command
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-10 01:54:13 +00:00
Olle Johansson a0b9439bee Clarify syntax of new manager events that reports a status.
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-04-04 07:59:02 +00:00
Kevin P. Fleming 96bf384e7d major dialplan functions update
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-02-12 04:28:58 +00:00
Russell Bryant 55c8fc92a9 Various cleanups from comments in an email from Luigi Rizzo. Thank you!
- 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-13 18:38:55 +00:00
Russell Bryant 79aa72e2e7 fix typo, thanks Qwell!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-11 00:06:15 +00:00
Russell Bryant 15fb0b2061 Add wrappers for commonly used memory allocation functions. These wrappers
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
2006-01-10 23:51:42 +00:00
Kevin P. Fleming 2c65582b66 remove extraneous svn:executable properties
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29 18:24:39 +00:00
Russell Bryant 14d426098e issue #5709
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-10 23:08:00 +00:00
Kevin P. Fleming b099701da9 various text/formatting updates (issue #5503 plus some minor additions)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-31 22:47:58 +00:00
Russell Bryant 11fae70fca update guidelines to explain indent parameteres (bug #4742)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-19 17:59:27 +00:00
Kevin P. Fleming 5bf8872b42 more thoughts
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-10 23:58:07 +00:00
Kevin P. Fleming 312122c113 minor fixes, and more topics covered
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-10 23:51:10 +00:00
Kevin P. Fleming b6ae77bcdf update guidelines to follow their own rules for whitespace (bug #4486)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-07 21:28:56 +00:00
Kevin P. Fleming 6cb7849dcb add guidelines for doxygen documentation writing (bug #4417, with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-02 19:38:55 +00:00
Kevin P. Fleming 5c33b52ced add a minor allocation/zeroing guideline
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-02 19:17:04 +00:00
Kevin P. Fleming c8889e6563 add IAXPEER function (bug #4310, with minor formatting and doc changes)
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-19 04:31:02 +00:00
Kevin P. Fleming 9bf21dbf58 more strncpy -> ast_copy_string conversions, fixing some buglets along the way
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-15 23:26:45 +00:00
Kevin P. Fleming 6cd346ebe1 add some notes regarding the distinction between applications and functions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-01 19:34:50 +00:00
Kevin P. Fleming f9876ccfa8 add guideline comment about not using '%i' with scanf
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-23 15:11:28 +00:00
Kevin P. Fleming 93c8e08989 Update README to reflect modern Asterisk features and requirements
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-04-01 04:38:12 +00:00
Anthony Minessale II 01a2a2a19f Modify code example suggestion
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-19 02:34:59 +00:00
Mark Spencer 581ae73586 Additional coding guidelines (bug #3374)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-18 23:35:30 +00:00
Mark Spencer dd7e72feca Provide "ident" command line (at least the start of one)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-11-08 02:49:33 +00:00