Skip to content

Commit f0b92fa

Browse files
authored
Merge pull request #8 from beyonddream/fix-header-comments
fix function decl comments in the header.
2 parents e4453e5 + 7537c38 commit f0b92fa

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

snowid.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,24 @@ typedef unsigned char snow_id_binary_t[16];
5151
* sequence_id is incremented as many times as the function is called within the
5252
* same timestamp.
5353
*
54-
* @arg snowid - If able to generate an id, set the value of id to `snow_id`.
55-
* @return true if successfully able to generate an id, false if not.
54+
* @param snowid - If able to generate an id, set the value of id to `snow_id`.
55+
* @return bool - true if successfully able to generate an id, false if not.
5656
*/
5757
bool snow_get_id(snow_id_t *snowid);
5858

5959
/**
6060
* Dump snow state and config to stdout for debugging.
61-
* @arg stream - any file descriptor (stdout if NULL)
61+
*
62+
* @param stream - any file descriptor (stdout if NULL)
63+
* @return void
6264
*/
6365
void snow_dump(FILE *stream);
6466

6567
/**
6668
* Initializes the snowid engine with the config. It has to be called only once before
6769
* calling any other API functions.
6870
*
69-
* @arg config - The snowid configuration
71+
* @param config - The snowid configuration
7072
* @return void
7173
*/
7274
void snow_init(snow_config_t *config);
@@ -75,7 +77,7 @@ void snow_init(snow_config_t *config);
7577
* Deinitializes the snowid engine. It has to be called only once at the end
7678
* and no other API functions should be called after it except snow_init().
7779
*
78-
* @arg void
80+
* @param void
7981
* @return void
8082
*/
8183
void snow_shutdown(void);
@@ -86,7 +88,7 @@ void snow_shutdown(void);
8688
* <unix timestamp (64 bits) + MAC address (48 bits) + sequence number (16 bits)>
8789
*
8890
* @param snowid_as_bin - set to snowid as binary
89-
* @return true if success, else false.
91+
* @return bool - true if success, else false.
9092
*/
9193
bool snow_get_id_as_binary(snow_id_binary_t snowid_as_bin);
9294

@@ -95,6 +97,7 @@ bool snow_get_id_as_binary(snow_id_binary_t snowid_as_bin);
9597
*
9698
* @param snowid_as_bin - set the converted snowid as binary
9799
* @param snowid - pass in already generated snowid
100+
* @return bool - true if success, else false.
98101
*/
99102
bool snow_id_convert(snow_id_binary_t snowid_as_bin, const snow_id_t *snowid);
100103

snowid_checkpoint.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727

2828
#include <stdbool.h>
2929

30+
/**
31+
* Start a child process to periodically save current time in `timestamp_path`
32+
* location.
33+
*
34+
* @param timestamp_path - filepath to store timestamp
35+
* @return bool - true if success, else false.
36+
*/
3037
bool snow_checkpoint_start(char *timestamp_path);
3138

3239
#endif /* __SNOWID_CHECKPOINT_H__ */

snowid_util.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@
3535
*
3636
* @param workerid Binary representation of the mac address of the interface.
3737
* @param interface Interface name to pull the address from.
38-
* @return success if we could set a workerid, else failure.
38+
* @return bool - true if we could return hw address, else false.
3939
*/
4040
bool get_hw_addr_as_binary(uint64_t *workerid, char *interface);
4141

4242
/**
43+
* Get current timestamp
44+
*
4345
* @param result - set the current timestamp to the value pointed by result.
44-
* @return true if success else false.
46+
* @return bool - true if we can get current timestamp, else false.
4547
*/
4648
bool get_current_ts(uint64_t *result);
4749

0 commit comments

Comments
 (0)