Browse Source

tripl: commit MAINTAINERS and the inti c coding style

rain 4 năm trước cách đây
mục cha
commit
4a76f7ba83
3 tập tin đã thay đổi với 68 bổ sung và 1 xóa
  1. 21 0
      MAINTAINERS
  2. 2 1
      README.md
  3. 45 0
      man/coding_style.1

+ 21 - 0
MAINTAINERS

@@ -0,0 +1,21 @@
+*** WRITING THE NAME IN THIS MEANS ACCEPTING THE GPLv3 LICENSE (LICENSE) AND THE INTI C CODING STYLE (man/coding_style.1)
+
+REAL NAME: 	'RN': YOUR REAL NAME THAT YOU ARE USING IN THE REAL WORLD (PINYIN IF CHINESE)
+EN NAME: 	'EN': YOUR ENGLISH NAME (ALSO CAN BE THE 'RN')
+MAIL: 		'EM': YOUR WORKING EMAIL ADDRESS
+WORK: 		'WR': THINGS YOU ARE WORKING AND ARE GOOD AT
+DESCRIBE: 	'DS': DESCRIPTOR OF YOUR PACTHES
+DIR: 		'DR': THE DIRECTORY WHICH YOU ARE WORKING ON (IN REGEX)
+
+*** ALWAYS USE TAB8 INSTEAD OF SPACES (FOR THE grep(1))
+
+
+RN:	Peng Ruiyang
+EN:	rain
+EM:	intirain@163.com
+WR:	porting on x86
+DS:	x86 and main tripl syntax
+DR:	'/', '/arch/x86*'
+
+
+

+ 2 - 1
README.md

@@ -16,4 +16,5 @@ tripl 编译并解释语言(编译暂仅支持x86-64架构)
 
 #### 使用说明
 
-参见main/tripl.1
+参见main/tripl.1
+

+ 45 - 0
man/coding_style.1

@@ -0,0 +1,45 @@
+.TH "INTI C CODING STYLE" 1 "14 Jan 21"
+.SH INTRODUCTION
+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. 
+
+Most of this standard copies from K&R (THE C PROGRAMMING LANGUAGE), but some of them are different. 
+
+.SH NAMES
+\fBALWAYS\fP use names with '_' and \fBNEVER\fPuse 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. :-)
+
+For some long words such as \fBattribute\fP and \fBsystem\fP, you should make them short and let them look 
+like \fBattr\fP and \fBsys\fP. 
+
+And if the name is not so long, don't use '_' to split. This is what we usually do in BSD and POSIX. 
+
+And, don't use some stupid words such as 'my' --- it makes your code dirty :-)
+
+\fBGOOD\fP: 	\fBi\fP, \fBp\fP, \fBname\fP, \fBp\fP, \fBattrmask\fP
+
+\fBBAD\fP: 	\fBattribute_mask\fP, \fBerror_number\fP, \fBget_my_name\fP
+
+\fBBADEST\fP: 	\fBIsSuccess\fP, \fBNameOfEveryStudent\fP, \fBMyStudentIdentify\fP
+
+.SH TABS
+\fBALWAYS\fP use tab8 instead of spaces. Right, spaces are more easy to port but it makes code big. And 
+I think tab is a tradition of C, is that okay? 
+
+.SH DECLARES
+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
+		\fBchar *name\fP
+
+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 
+and I start to try. You can use tabs, but you should use them at the right place. 
+
+.SH '{}'s
+You can use them as you want, but \fBNEVER\fP put '{}'s at next line after \fBif\fP or \fBwhile\fP etc. 
+
+