pyperanger / fuptcha

fuptcha - CAPTCHA Fuzzer Image Recon
Apache License 2.0
5 stars 0 forks source link

Improve code structure #3

Open pyperanger opened 4 years ago

growlnx commented 4 years ago

What do you think of this structure? For me, this can be good for maintaining the organization of the code in the project.

+ 
| - README.md
| - Makefile
| - configure
| + src 
| | + header - a separate folder for the headers.
| | | - fuptcha.h
| | | - util.h
| | | - cli.h
| | - main.c - the main function resides here.
| | - fuptcha.c  - the fuptcha functions implementation.
| | - util.c - utilitary things like die, help_msg, sorting ... 
| | - cli.c - comand line interface parser implementation.

For the coding style, we can use the Mozilla style clang format as the default.

pyperanger commented 4 years ago

We already decide to use Mozilla style for this project. About code organization issue, we'll review the code and try improve the files tree

growlnx commented 4 years ago

Pass "EXIT_STATUS_CODE" as arg can make die macro more flexible.

https://github.com/pyperanger/fuptcha/blob/79efa6ccf97898b9ab9d99abe3458dea6e420d28/src/util.h#L31

growlnx commented 4 years ago

Coding standards

For functions and vars, will we use the camel case or snake case?

A prefix to simulate a "namespace", such as glib. Example:

int
fup_img_init(struct WORD* w) 
{ ... }
int
fupImgInit(struct WORD* w) 
{ ... }

In structs, the first character always being uppercase?

pyperanger commented 4 years ago

snake case

pyperanger commented 4 years ago

Python Extension

Some piece of the code will change in python extension development process. We set this branch as main developer priority.

Bugs, good practices, vulnerabilities will be commit in the master branch.