Unix and Linux Discussions Tagged with spaces |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
1,922 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
15,179 |
Shell Programming and Scripting |
|
|
|
3 |
7,271 |
Shell Programming and Scripting |
|
|
|
3 |
1,996 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
2,262 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
10,924 |
Shell Programming and Scripting |
|
|
|
1 |
3,747 |
Shell Programming and Scripting |
|
|
|
10 |
6,759 |
Shell Programming and Scripting |
|
|
|
9 |
3,669 |
Shell Programming and Scripting |
|
|
|
11 |
2,757 |
Shell Programming and Scripting |
|
|
|
4 |
2,362 |
Shell Programming and Scripting |
|
|
|
15 |
9,632 |
AIX |
|
|
|
4 |
2,024 |
Shell Programming and Scripting |
|
|
|
2 |
7,621 |
Shell Programming and Scripting |
|
|
|
8 |
12,109 |
Shell Programming and Scripting |
|
|
|
5 |
2,028 |
Shell Programming and Scripting |
|
|
|
6 |
3,335 |
Shell Programming and Scripting |
|
|
|
6 |
3,514 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
11,648 |
Shell Programming and Scripting |
|
|
|
2 |
2,393 |
Shell Programming and Scripting |
|
|
|
2 |
2,547 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
3,130 |
Shell Programming and Scripting |
|
|
|
3 |
4,571 |
Shell Programming and Scripting |
|
|
|
3 |
5,524 |
Shell Programming and Scripting |
|
|
|
4 |
16,509 |
Shell Programming and Scripting |
|
|
|
17 |
32,967 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
5,782 |
Shell Programming and Scripting |
|
|
|
1 |
24,466 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
5,896 |
Shell Programming and Scripting |
|
|
|
1 |
3,932 |
Shell Programming and Scripting |
|
|
|
12 |
11,001 |
Programming |
|
|
|
6 |
7,068 |
Shell Programming and Scripting |
|
|
|
7 |
10,368 |
Shell Programming and Scripting |
|
|
|
4 |
3,201 |
Shell Programming and Scripting |
|
|
|
5 |
5,755 |
Shell Programming and Scripting |
|
|
|
6 |
8,913 |
Shell Programming and Scripting |
|
|
|
2 |
23,811 |
Shell Programming and Scripting |
|
|
|
3 |
8,870 |
Shell Programming and Scripting |
|
|
|
5 |
16,567 |
Shell Programming and Scripting |
|
|
|
3 |
2,425 |
UNIX for Dummies Questions & Answers |
libcaca-style(3caca) libcaca libcaca-style(3caca)
NAME
libcaca-style - Libcaca coding style
General guidelines
A pretty safe rule of thumb is: look at what has already been done and try to do the same.
o Tabulations should be avoided and replaced with eight spaces.
o Indentation is generally 4 spaces.
o Lines should wrap at most at 79 characters.
o Do not leave whitespace at the end of lines.
o Do not use multiple spaces for anything else than indentation.
o Code qui fait des warnings == code de porc == deux baffes dans ta gueule
C coding style
Try to use short names whenever possible (i for indices, w for width, cv for canvas...). Macros are always uppercase, variable and function
names are always lowercase. Use the underscore to separate words within names:
#define BROKEN 0
#define MAX(x, y) ((x > y) ? (x) : (y))
unsigned int x, y, w, h;
char *font_name;
void frobulate_every_three_seconds(void);
const is a suffix. It's char const *foo, not const char *foo.
Use spaces after commas and between operators. Do not use spaces after an opening parenthesis or before a closing one:
a += 2;
b = (a * (c + d));
x = min(x1, x2, x3);
Do not put a space between functions and the corresponding opening parenthesis:
int function(int);
A space can be inserted after keywords such as for, while or if, but consistency with the rest of the page is encouraged:
if(a == b)
return;
if (p == NULL)
Do not put parentheses around return values:
return a + (b & x) + d[10];
Opening braces should be on a line of their own, aligned with the current block. Braces are optional for one-liners:
int function(int a)
{
if(a & 0x84)
return a;
if(a < 0)
{
return -a;
}
else
{
a /= 2;
switch(a)
{
case 0:
case 1:
return -1;
break;
default:
return a;
}
}
}
C++ coding style
Nothing here yet.
Version 0.99.beta18 Fri Apr 6 2012 libcaca-style(3caca)