diff --git a/README.md b/README.md index d3473b6..2fd777f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # libsnowflakeid -[![Latest release](https://img.shields.io/badge/latest_release----orange.svg)](https://github.com/thibaultmeyer/libsnowflakeid/releases) +[![Latest release](https://img.shields.io/badge/latest_release-1.0.0-orange.svg)](https://github.com/thibaultmeyer/libsnowflakeid/releases) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/thibaultmeyer/libsnowflakeid/blob/master/LICENSE) [![CodeFactor](https://www.codefactor.io/repository/github/thibaultmeyer/libsnowflakeid/badge)](https://www.codefactor.io/repository/github/thibaultmeyer/libsnowflakeid) @@ -18,5 +18,22 @@ clang or MSVC are being correctly installed. #> make install +## Usage +```c +int main(const int argc, const char *const *argv) { + enum e_snowflakeid_init_status status_out; + struct s_snowflakeid_generator_ctx *ctx = snowflakeid_initialize(datacenter_id, worker_id, &status_out); + + if (status_out == SNOWFLAKEID_INIT_SUCCESS) { + uint64_t = snowflakeid_next_value(ctx); + + snowflakeid_destroy(ctx); + } + + return (0); +} +``` + + ## License This project is released under terms of the [MIT license](https://github.com/thibaultmeyer/libsnowflakeid/blob/master/LICENSE).