website

my website
git clone git://git.evenfri.xyz/website.git
Log | Files | Refs | LICENSE

commit 946f7695f2815844211ad02b4694a273922faf8a
parent 17d4429055c913b2c1e2ed625528cc27335230de
Author: evenfri <evenfri256@gmail.com>
Date:   Sun, 30 Aug 2026 16:58:11 +0800

update code style

Diffstat:
Mcontributing.html | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/contributing.html b/contributing.html @@ -36,8 +36,8 @@ <h3>2. naming conventions</h3> <ul> <li><strong>style:</strong> <code>snake_case</code> for functions, variables, and structures</li> - <li><strong>macros:</strong> <code>lower_case</code> for constant macros; <code>UPPER_CASE</code> for standard macros</li> - <li><strong>config macros:</strong> <code>CONFIG_UPPER_CASE</code> in <code>config.h</code></li> + <li><strong>macros:</strong> <code>UPPER_CASE</code> for macros</li> + <li><strong>config macros:</strong> <code>CONFIG_UPPER_CASE</code> in <code>config.h</code> with prefix <code>CONFIG_</code></li> <li><strong>pointers:</strong> <code>char* func(...)</code> for types, <code>const char *str</code> for variables</li> </ul> @@ -52,7 +52,10 @@ <li>write in English, lowercase, no trailing dot (except copyright notices)</li> <li>explain <em>why</em>, not <em>what</em></li> <li>use standard C-style comments (<code>/* ... */</code>)</li> - <li>use include guards in lowercase for header files (e.g., <code>#ifndef filename_h</code>)</li> + <li>use include guards in lowercase for header files (e.g., <code><br> + #ifndef DIR_FILENAME_H<br> + #define DIR_FILENAME_H<br> + #endif /* DIR_FILENAME_H */</code>)</li> <li>keep header files minimal: max 4 headers (<code>fns.h</code>, <code>dat.h</code>, project header, <code>config.h</code>)</li> </ul> @@ -61,15 +64,14 @@ <li><strong>dependencies:</strong> max 1-2 external dependencies; write custom code if non-essential</li> <li><strong>allowed defaults:</strong> gcc, make, X11, libc, mk</li> <li><strong>shell scripts:</strong> use <code>#!/bin/sh</code> and <code>snake_case</code> naming</li> - <li><strong>build tool:</strong> Makefile/mkfile required with <code>-Wall -Wextra</code> flags</li> - <li><strong>build targets:</strong> mandatory <code>all</code>, <code>rebuild</code>, <code>clean</code>, and <code>nuke</code></li> + <li><strong>build tool:</strong> mkfile from <a href="http://git.evenfri.xyz/mk-standalone/log.html">repository</a></li> <li><strong>languages:</strong> C, GASM, NASM</li> </ul> <h3>6. required files</h3> <ul> <li><code>README</code> and <code>LICENSE</code> in plain text format</li> - <li><code>Makefile</code> or <code>mkfile</code></li> + <li><code>mkfile</code></li> </ul> <h3>example</h3> @@ -77,22 +79,22 @@ * main.c — entry point example */ -#define sys_write 1 -#define stdout 1 +#define SYS_write 1 +#define STDOUT 1 static long write(int fd, const void *buf, unsigned long count) { long ret; asm volatile ( "syscall" : "=a"(ret) - : "a"(sys_write), "D"(fd), "S"(buf), "d"(count) + : "a"(SYS_write), "D"(fd), "S"(buf), "d"(count) : "rcx", "r11", "memory" ); return ret; } int main(int argc, char *argv[]) { - write(stdout, "hello world\n", 12); + write(STDOUT, "hello world\n", 12); return 0; }</pre>