Skip to content

Commit 504f8a6

Browse files
committed
* update api of snowid.h
* update requirements in readme
1 parent eb41dea commit 504f8a6

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,37 @@ Two main functions to generate id are provided:
4040

4141
A)
4242
```c
43-
/**
44-
* Attempts to set `dest_as_binary` with a 128-bit id (represented as byte array). * Return true if operation succeeds.
43+
/*
44+
* Attempts to set `dest_as_binary` with a 128-bit id (represented as byte
45+
* array). Return true if operation succeeds.
4546
*/
46-
bool snow_get_id_as_binary(snow_id_binary_t dest_as_binary);
47+
bool snow_get_id_as_binary(snow_id_binary_t snowid_as_bin);
4748
```
4849
B)
4950
```c
50-
/**
51+
/*
5152
* Attempts to set `dest` with a `struct snow_id` that consists of individual
5253
* components of the id. Return true if operation succeeds.
5354
*/
54-
bool snow_get_id(snow_id_t *dest);
55+
bool snow_get_id(snow_id_t *snowid);
5556
```
5657

5758
The third function to convert A) from B).
5859
```c
59-
/**
60+
/*
6061
* Convenience function that attempts to convert `snowid` of type `struct
6162
* snow_id` into binary `dest_as_bin`. Return true if operation succeeds.
6263
*/
63-
bool snow_id_convert(snow_id_binary_t dest_as_bin, const snow_id_t *snowid);
64+
bool snow_id_convert(snow_id_binary_t snowid_as_bin, const snow_id_t *snowid);
6465
```
6566
6667
For full usage of reset of the public API's (`snowid.h`), checkout `main.c` that provides a driver program on how to use the library from an application (e.g. a (web)service).
6768
6869
## Dependencies
6970
71+
* Tested on macOS and GNU/Linux (via Docker). PR welcome to make it work on Windows.
7072
* C99 compatible C compiler (e.g. GCC or Clang).
71-
* This library doesn't depend on any external libraries.
73+
* This library doesn't depend on any external libraries.
7274
7375
## Build/Test/Benchmark
7476

snowid.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ 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 dest - If able to generate an id, set the value of id to `snow_id`.
54+
* @arg snowid - If able to generate an id, set the value of id to `snow_id`.
5555
* @return true if successfully able to generate an id, false if not.
5656
*/
57-
bool snow_get_id(snow_id_t *dest);
57+
bool snow_get_id(snow_id_t *snowid);
5858

5959
/**
6060
* Dump snow state and config to stdout for debugging.
@@ -85,17 +85,17 @@ void snow_shutdown(void);
8585
* Represented as:
8686
* <unix timestamp (64 bits) + MAC address (48 bits) + sequence number (16 bits)>
8787
*
88-
* @param dest_as_bin - set to snowid converted to 128 bits
88+
* @param snowid_as_bin - set to snowid as binary
8989
* @return true if success, else false.
9090
*/
91-
bool snow_get_id_as_binary(snow_id_binary_t dest_as_bin);
91+
bool snow_get_id_as_binary(snow_id_binary_t snowid_as_bin);
9292

9393
/**
94-
* Convert an already generated snow_id as binary - contiguous array of 128 bits.
94+
* Convert an already generated snow_id as binary (represented as byte array).
9595
*
96-
* @param out - set the converted snowid as binary
96+
* @param snowid_as_bin - set the converted snowid as binary
9797
* @param snowid - pass in already generated snowid
9898
*/
99-
bool snow_id_convert(snow_id_binary_t out, const snow_id_t *snowid);
99+
bool snow_id_convert(snow_id_binary_t snowid_as_bin, const snow_id_t *snowid);
100100

101101
#endif /* __SNOWID_H__ */

0 commit comments

Comments
 (0)