# # AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: 0\n" "POT-Creation-Date: 2018-05-14 18:03-0500\n" "PO-Revision-Date: 2018-05-14 18:03-0500\n" "Last-Translator: Automatically generated\n" "Language-Team: None\n" "MIME-Version: 1.0\n" "Content-Type: application/x-publican; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Tag: title #, no-c-format msgid "C Coding Guidelines" msgstr "" #. Tag: para #, no-c-format msgid "" msgstr "" #. Tag: title #, no-c-format msgid "C Boilerplate" msgstr "" #. Tag: para #, no-c-format msgid " Cboilerplate boilerplate licensingC boilerplate C boilerplate " msgstr "" #. Tag: para #, no-c-format msgid "Every C file should start like this:" msgstr "" #. Tag: programlisting #, no-c-format msgid "/*\n" " * Copyright <YYYY[-YYYY]> Andrew Beekhof <andrew@beekhof.net>\n" " *\n" " * This source code is licensed under <LICENSE> WITHOUT ANY WARRANTY.\n" " */" msgstr "" #. Tag: para #, no-c-format msgid "<YYYY> is the year the code was originally created. See the U.S. Copyright Office’s \"Compendium of U.S. Copyright Office Practices\", particularly \"Chapter 2200: Notice of Copyright\", sections 2205.1(A) and 2205.1(F), or \"Updating Copyright Notices\" for a more readable summary. If the code is modified in later years, add -YYYY with the most recent year of modification." msgstr "" #. Tag: para #, no-c-format msgid "<LICENSE> should follow the policy set forth in the COPYING file, generally one of \"GNU General Public License version 2 or later (GPLv2+)\" or \"GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)\"." msgstr "" #. Tag: title #, no-c-format msgid "Formatting" msgstr "" #. Tag: title #, no-c-format msgid "Whitespace" msgstr "" #. Tag: para #, no-c-format msgid " Cwhitespace whitespace " msgstr "" #. Tag: para #, no-c-format msgid "Indentation must be 4 spaces, no tabs." msgstr "" #. Tag: para #, no-c-format msgid "Do not leave trailing whitespace." msgstr "" #. Tag: title #, no-c-format msgid "Line Length" msgstr "" #. Tag: para #, no-c-format msgid "Lines should be no longer than 80 characters unless limiting line length significantly impacts readability." msgstr "" #. Tag: title #, no-c-format msgid "Pointers" msgstr "" #. Tag: para #, no-c-format msgid " Cpointers pointers " msgstr "" #. Tag: para #, no-c-format msgid "The * goes by the variable name, not the type:" msgstr "" #. Tag: programlisting #, no-c-format msgid "char *foo;" msgstr "" #. Tag: para #, no-c-format msgid "Use a space before the * and after the closing parenthesis in a cast:" msgstr "" #. Tag: programlisting #, no-c-format msgid "char *foo = (char *) bar;" msgstr "" #. Tag: title #, no-c-format msgid "Functions" msgstr "" #. Tag: para #, no-c-format msgid " Cfunctions functions " msgstr "" #. Tag: para #, no-c-format msgid "In the function definition, put the return type on its own line, and place the opening brace by itself on a line:" msgstr "" #. Tag: programlisting #, no-c-format msgid "static int\n" "foo(void)\n" "{" msgstr "" #. Tag: para #, no-c-format msgid "For functions with enough arguments that they must break to the next line, align arguments with the first argument:" msgstr "" #. Tag: programlisting #, no-c-format msgid "static int\n" "function_name(int bar, const char *a, const char *b,\n" " const char *c, const char *d)\n" "{" msgstr "" #. Tag: para #, no-c-format msgid "If a function name gets really long, start the arguments on their own line with 8 spaces of indentation:" msgstr "" #. Tag: programlisting #, no-c-format msgid "static int\n" "really_really_long_function_name_this_is_getting_silly_now(\n" " int bar, const char *a, const char *b,\n" " const char *c, const char *d)\n" "{" msgstr "" #. Tag: title #, no-c-format msgid "Control Statements (if, else, while, for, switch)" msgstr "" #. Tag: para #, no-c-format msgid "The keyword is followed by one space, then left parenthesis without space, condition, right parenthesis, space, opening bracket on the same line. else and else if are on the same line with the ending brace and opening brace, separated by a space:" msgstr "" #. Tag: programlisting #, no-c-format msgid "if (condition1) {\n" " statement1;\n" "} else if (condition2) {\n" " statement2;\n" "} else {\n" " statement3;\n" "}" msgstr "" #. Tag: para #, no-c-format msgid "In a switch statement, case is indented one level, and the body of each case is indented by another level. The opening brace is on the same line as switch." msgstr "" #. Tag: programlisting #, no-c-format msgid "switch (expression) {\n" " case 0:\n" " command1;\n" " break;\n" " case 1:\n" " command2;\n" " break;\n" " default:\n" " command3;\n" "}" msgstr "" #. Tag: title #, no-c-format msgid "Operators" msgstr "" #. Tag: para #, no-c-format msgid " Coperators operators " msgstr "" #. Tag: para #, no-c-format msgid "Operators have spaces from both sides. Do not rely on operator precedence; use parentheses when mixing operators with different priority." msgstr "" #. Tag: para #, no-c-format msgid "No space is used after opening parenthesis and before closing parenthesis." msgstr "" #. Tag: programlisting #, no-c-format msgid "x = a + b - (c * d);" msgstr "" #. Tag: title #, no-c-format msgid "Naming Conventions" msgstr "" #. Tag: para #, no-c-format msgid " Cnaming naming " msgstr "" #. Tag: para #, no-c-format msgid "Any exposed symbols in libraries (non-static function names, type names, etc.) must begin with a prefix appropriate to the library, for example, crm_, pe_, st_, lrm_." msgstr "" #. Tag: title #, no-c-format msgid "vim Settings" msgstr "" #. Tag: para #, no-c-format msgid " vim " msgstr "" #. Tag: para #, no-c-format msgid "Developers who use vim to edit source code can add the following settings to their ~/.vimrc file to follow Pacemaker C coding guidelines:" msgstr "" #. Tag: screen #, no-c-format msgid "\" follow Pacemaker coding guidelines when editing C source code files\n" "filetype plugin indent on\n" "au FileType c setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 textwidth=80\n" "autocmd BufNewFile,BufRead *.h set filetype=c\n" "let c_space_errors = 1" msgstr ""