Mercurial > geeqie.yaz
annotate CODING @ 737:8a8873e7a552
Make shell command and its option rc file options instead of hardcoded strings.
This allows users to modify the shell command that execute "editors".
Two new options appear in rc file:
- shell.path (default to "/bin/sh")
- shell.options (default to "-c")
These options can only be changed from the rc file, not at runtime.
Tests are made to check that shell.path is not empty and lead to
an executable file.
author | zas_ |
---|---|
date | Thu, 22 May 2008 20:22:13 +0000 |
parents | f20e7cebcb12 |
children | 83d3abd80b64 |
rev | line source |
---|---|
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
1 GPL header, in every file, like this: |
524 | 2 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
3 /** @file relativ/path/with/this/file/name.c |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
4 * Short description of this file. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
5 * @author Author1 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
6 * @author Author2 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
7 * |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
8 * Optionaly detailed description of this file |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
9 * on more lines. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
10 */ |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
11 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
12 /* |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
13 * This file is a part of Geeqie project (http://geeqie.sourceforge.net/). |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
14 * Copyright (C) 2008 Geeqie team |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
15 * |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
16 * This program is free software; you can redistribute it and/or modify |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
17 * it under the terms of the GNU General Public License as published by |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
18 * the Free Software Foundation; either version 2 of the License, or |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
19 * (at your option) any later version. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
20 * |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
21 * This program is distributed in the hope that it will be useful, |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
24 * GNU General Public License for more details. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
25 */ |
524 | 26 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
27 -------------------------------------------------------------------------------- |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
28 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
29 svn change-log: |
524 | 30 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
31 Use whole sentences begins with Capital letter. For each modification use new line. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
32 Or you can write the theme, colon and then every change on new line, begin |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
33 with "- ". |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
34 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
35 Example: |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
36 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
37 I done some bugfixes. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
38 Library: |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
39 - I change the interface |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
40 - added some new functions |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
41 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
42 -------------------------------------------------------------------------------- |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
43 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
44 sources: |
524 | 45 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
46 Indentation: tabs |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
47 Names of variables & functions: small_letters |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
48 of defines: CAPITAL_LETTERS |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
49 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
50 Try to use explicit variable and function names. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
51 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
52 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
53 Try not to use macros. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
54 Use EITHER "struct foo" OR "foo"; never both |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
55 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
56 Conditions, cycles: |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
57 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
58 if (<cond>) |
524 | 59 { |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
60 <command>; |
524 | 61 ... |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
62 <command>; |
524 | 63 } |
64 else | |
65 { | |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
66 <command>; |
524 | 67 ... |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
68 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
69 } |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
70 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
71 if (<cond_very_very_very_very_very_very_very_very_very_long> && |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
72 <cond2very_very_very_very_very_very_very_very_very_long) |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
73 <the_only_command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
74 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
75 switch (<var>) |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
76 { |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
77 case 0: |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
78 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
79 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
80 break; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
81 case 1: |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
82 <command>; break; |
524 | 83 } |
84 | |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
85 for (i = 0; i <= 10; i++) |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
86 { |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
87 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
88 ... |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
89 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
90 } |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
91 |
524 | 92 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
93 Functions: |
524 | 94 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
95 int bar(<var_def>, <var_def>, <var_def>) |
611
f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
zas_
parents:
525
diff
changeset
|
96 { |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
97 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
98 ... |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
99 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
100 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
101 return 0; // i.e. SUCCESS; if error, you must return minus <err_no> |
611
f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
zas_
parents:
525
diff
changeset
|
102 } |
f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
zas_
parents:
525
diff
changeset
|
103 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
104 void bar2(void) |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
105 { |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
106 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
107 ... |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
108 <command>; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
109 } |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
110 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
111 Pragma: (Indentation 2 spaces) |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
112 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
113 #ifdef ENABLE_NLS |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
114 # undef _ |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
115 # define _(String) (String) |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
116 #endif /* ENABLE_NLS */ |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
117 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
118 Headers: |
524 | 119 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
120 #ifndef _FILENAME_H |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
121 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
122 -------------------------------------------------------------------------------- |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
123 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
124 Use spaces around every operator (except ".", "->", "++" and "--"); |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
125 unary operator '*' and '&' are missing the space from right; |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
126 (and also unary '-'). |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
127 As you can see above, parentheses are closed to inside, i.e. " (blah blah) " |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
128 In "function(<var>)" there are no space before '('. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
129 You MAY use more tabs/spaces than you OUGHT TO (according to this CodingStyle), if |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
130 it makes your code nicer in being verticaly indented. |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
131 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
132 -------------------------------------------------------------------------------- |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
133 |
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
134 Use glib types when possible (ie. gint and gchar instead of int and char). |
611
f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
zas_
parents:
525
diff
changeset
|
135 Use glib functions when possible (ie. g_ascii_isspace() instead of isspace()). |
f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
zas_
parents:
525
diff
changeset
|
136 Check if used functions are not deprecated. |
f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
zas_
parents:
525
diff
changeset
|
137 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
138 -------------------------------------------------------------------------------- |
524 | 139 |
685
f20e7cebcb12
Updated CODING (GPL header, macros, svn change-log, ...).
bruclik
parents:
611
diff
changeset
|
140 Documentation: use Doxygen |