|
@@ -1,4 +1,4 @@
|
|
|
-.TH "INTI C CODING STYLE" 1 "14 Jan 21"
|
|
|
|
|
|
|
+.TH "INTI C CODING STYLE" 1 "14 Jan 22
|
|
|
.SH INTRODUCTION
|
|
.SH INTRODUCTION
|
|
|
This is the inti C Language Coding Style standard. Everybody in the inti (inti's not interpreters) should
|
|
This is the inti C Language Coding Style standard. Everybody in the inti (inti's not interpreters) should
|
|
|
read this carefully and use it in their code which will commit to inti softwares.
|
|
read this carefully and use it in their code which will commit to inti softwares.
|
|
@@ -6,7 +6,7 @@ read this carefully and use it in their code which will commit to inti softwares
|
|
|
Most of this standard copies from K&R (THE C PROGRAMMING LANGUAGE), but some of them are different.
|
|
Most of this standard copies from K&R (THE C PROGRAMMING LANGUAGE), but some of them are different.
|
|
|
|
|
|
|
|
.SH NAMES
|
|
.SH NAMES
|
|
|
-\fBALWAYS\fP use names with '_' and \fBNEVER\fPuse NamesLikeThis. We use names like both BSD and linux, but
|
|
|
|
|
|
|
+\fBALWAYS\fP use names with '_' and \fBNEVER\fP use NamesLikeThis. We use names like both BSD and linux, but
|
|
|
\fBNEVER\fP like Windows! Remember that here is C, not Java or other. And here is UNIX, not Windows. :-)
|
|
\fBNEVER\fP like Windows! Remember that here is C, not Java or other. And here is UNIX, not Windows. :-)
|
|
|
|
|
|
|
|
For some long words such as \fBattribute\fP and \fBsystem\fP, you should make them short and let them look
|
|
For some long words such as \fBattribute\fP and \fBsystem\fP, you should make them short and let them look
|
|
@@ -29,11 +29,13 @@ I think tab is a tradition of C, is that okay?
|
|
|
.SH DECLARES
|
|
.SH DECLARES
|
|
|
You can use tabs after types and you can also don't. These are okay:
|
|
You can use tabs after types and you can also don't. These are okay:
|
|
|
|
|
|
|
|
-\fBGOOD\fP: \fBint id;\fP
|
|
|
|
|
- \fBchar *name;\fP
|
|
|
|
|
|
|
+\fBGOOD\fP: \fBint id;\fP\n
|
|
|
|
|
|
|
|
-\fBGOOD\fP: \fBint id\fP
|
|
|
|
|
- \fBchar *name\fP
|
|
|
|
|
|
|
+ \fBchar *name;\fP\n
|
|
|
|
|
+
|
|
|
|
|
+\fBGOOD\fP: \fBint id;\fP\n
|
|
|
|
|
+
|
|
|
|
|
+ \fBchar *name\fP\n
|
|
|
|
|
|
|
|
Before, I didn't use tabs after types because my first was python and it brings me a lot such as '{}' at
|
|
Before, I didn't use tabs after types because my first was python and it brings me a lot such as '{}' at
|
|
|
end of line and don't use tabs. But after reading the tyt code from linux 0.0.1, I relize it is more beatiful
|
|
end of line and don't use tabs. But after reading the tyt code from linux 0.0.1, I relize it is more beatiful
|