diff --git a/license b/license index 540b9d7..9146125 100644 --- a/license +++ b/license @@ -1,4 +1,4 @@ -MIT License 2019 +MIT License Copyright (c) Abraham Hernandez (abranhe.com) diff --git a/open.c b/open.c index 6313317..7013a41 100644 --- a/open.c +++ b/open.c @@ -20,11 +20,11 @@ create_cmd(const char * cmd, const char * link) { return url; } -void -open(const char * url) { +int +open(const char *url) { - const char * platform = operating_system(); - const char * cmd = NULL; + const char *platform = operating_system(); + const char *cmd = NULL; // Hanlde macOS if (!strcmp(platform, "macOS")) { @@ -42,8 +42,9 @@ open(const char * url) { cmd = "xdg-open"; } - char * script = create_cmd(cmd, url); + char *script = create_cmd(cmd, url); system(script); free(script); + return 0; } \ No newline at end of file diff --git a/open.h b/open.h index 56b3f70..a5a66c6 100644 --- a/open.h +++ b/open.h @@ -12,7 +12,7 @@ extern "C" { #endif -void open(const char * url); +int open(const char *url); #ifdef __cplusplus } diff --git a/readme.md b/readme.md index c0ff790..c34fdde 100644 --- a/readme.md +++ b/readme.md @@ -47,13 +47,13 @@ $ make run-example ## API -#### `void open(char * url);` +#### `int open(const char *link);` *Open a URL on the default browser.* ###### Params: -- `url`: The url you whish to be opened +- `link`: The url you whish to be opened ## Related