Skip to content

Commit 864595c

Browse files
committed
update HACK.TXT with coding style
1 parent 7907626 commit 864595c

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

HACK.TXT

+24-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
Capstone source is organized as followings.
1+
Code structure
2+
--------------
23

4+
Capstone source is organized as followings.
35

46
. <- core engine + README + COMPILE.TXT etc
57
├── arch <- code handling disasm engine for each arch
@@ -51,43 +53,50 @@ See bindings/<language>/README for detail instructions on how to compile &
5153
install the bindings.
5254

5355

54-
Adding an architecture :
56+
Coding style
57+
------------
58+
- C code follows Linux kernel coding style, using tabs for indentation.
59+
- Python code uses 4 spaces for indentation.
60+
61+
62+
Adding an architecture
63+
----------------------
5564

5665
Obviously, you first need to write all the logic and put it in a new directory arch/newarch
5766
Then, you have to modify other files.
5867
(You can look for one architecture such as EVM in these files to get what you need to do)
5968

60-
Integrate :
69+
Integrate:
6170
- cs.c
6271
- cstool/cstool.c
63-
- cstool/cstool_newarch.c : print the architecture specific details
72+
- cstool/cstool_newarch.c: print the architecture specific details
6473
- include/capstone/capstone.h
65-
- include/capstone/newarch.h : create this file to export all specifics about the new architecture
74+
- include/capstone/newarch.h: create this file to export all specifics about the new architecture
6675

67-
Compile :
76+
Compile:
6877
- CMakeLists.txt
6978
- Makefile
7079
- config.mk
7180

72-
Tests :
81+
Tests:
7382
- tests/Makefile
7483
- tests/test_basic.c
7584
- tests/test_detail.c
7685
- tests/test_iter.c
7786
- tests/test_newarch.c
78-
- suite/fuzz/fuzz_disasm.c : add the architecture and its modes to the list of fuzzed platforms
87+
- suite/fuzz/fuzz_disasm.c: add the architecture and its modes to the list of fuzzed platforms
7988

80-
Bindings :
89+
Bindings:
8190
- bindings/Makefile
82-
- bindings/const_generator.py : add the header file and the architecture
91+
- bindings/const_generator.py: add the header file and the architecture
8392
- bindings/python/Makefile
8493
- bindings/python/capstone/__init__.py
85-
- bindings/python/capstone/newarch.py : define the python structures
86-
- bindings/python/capstone/newarch_const.py : generate this file
87-
- bindings/python/test_newarch.py : create a basic decoding test
94+
- bindings/python/capstone/newarch.py: define the python structures
95+
- bindings/python/capstone/newarch_const.py: generate this file
96+
- bindings/python/test_newarch.py: create a basic decoding test
8897
- bindings/python/test_all.py
8998

90-
Docs :
99+
Docs:
91100
- README.md
92101
- HACK.txt
93-
- CREDITS.txt : add your name
102+
- CREDITS.txt: add your name

0 commit comments

Comments
 (0)