@@ -901,6 +901,7 @@ typedef struct
901
901
size_t count_spaces(const char *str);
902
902
bool starts_with(const char *str, const char *prefix);
903
903
```
904
+
904
905
- ** Conversely** : ` parse_iso8601_buf() ` needs ` _buf ` suffix when parsing from a buffer
905
906
906
907
#### Module Prefixing [ AVMCCS-N017]
@@ -1096,14 +1097,17 @@ func(target, inputs, outputs, options, environment)
1096
1097
#### Parameter Types
1097
1098
1098
1099
1. **target**: The primary parameter being operated on (must be initialized)
1100
+
1099
1101
```c
1100
1102
bool date_time_is_valid(const DateTime *dt);
1101
1103
void date_time_add_days(DateTime *dt, int days);
1102
1104
void buffer_append(Buffer *buf, const char *data);
1103
1105
```
1106
+
1104
1107
Exception: ` _init ` and ` _create ` functions initialize the target parameter
1105
1108
1106
1109
2 . ** inputs** : Additional input data with ` const ` qualification
1110
+
1107
1111
``` c
1108
1112
// Arrays/buffers must always be followed by their length
1109
1113
void hash_update (Hash * h, const uint8_t data[ ] , size_t data_len);
@@ -1112,15 +1116,18 @@ func(target, inputs, outputs, options, environment)
1112
1116
```
1113
1117
1114
1118
3. **outputs**: Usually uninitialized output parameters (come after inputs)
1119
+
1115
1120
```c
1116
1121
// Parse functions: input data first, then output location
1117
1122
parse_int_result_t parse_int(const char *str, int32_t *out);
1118
1123
base64_decode_result_t base64_decode(const char *encoded,
1119
1124
uint8_t decoded[], size_t *decoded_len);
1120
1125
```
1126
+
1121
1127
Note: Additional read-write parameters may precede pure output parameters when it makes semantic sense
1122
1128
1123
1129
4 . ** options** : Function options (prefer enums for clarity)
1130
+
1124
1131
``` c
1125
1132
void user_message_show (Display * display, const char * msg,
1126
1133
user_message_style_t style);
@@ -1129,6 +1136,7 @@ func(target, inputs, outputs, options, environment)
1129
1136
```
1130
1137
1131
1138
5. **environment**: Context or environment pointers (avoid globals)
1139
+
1132
1140
```c
1133
1141
void log_message(Logger *logger, const char *msg, log_level_t level,
1134
1142
Environment *env);
@@ -1899,6 +1907,7 @@ static uint32_t crc32_byte(uint32_t crc, uint8_t byte);
1899
1907
Choose documentation depth based on API complexity and safety requirements:
1900
1908
1901
1909
1 . ** Minimal** : Self-documenting functions need only brief description
1910
+
1902
1911
``` c
1903
1912
/* *
1904
1913
* @brief Check if buffer is empty
@@ -1907,6 +1916,7 @@ Choose documentation depth based on API complexity and safety requirements:
1907
1916
```
1908
1917
1909
1918
2. **Standard**: Add parameters, return values, and specific error codes [AVMCCS-D014]
1919
+
1910
1920
```c
1911
1921
/**
1912
1922
* @brief Parse integer from string
@@ -1922,6 +1932,7 @@ Choose documentation depth based on API complexity and safety requirements:
1922
1932
```
1923
1933
1924
1934
3 . ** Safety-Critical** : Add preconditions, warnings, and detailed behavior [ AVMCCS-D015]
1935
+
1925
1936
``` c
1926
1937
/* *
1927
1938
* @brief Resize dynamic buffer
0 commit comments