Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abranhe/os.c
Small C library to know your operating system.
https://github.com/abranhe/os.c
c c-library clib clibs freebsd linux macos operating-system os win32 win64 window
Last synced: about 1 month ago
JSON representation
Small C library to know your operating system.
- Host: GitHub
- URL: https://github.com/abranhe/os.c
- Owner: abranhe
- License: mit
- Created: 2018-11-10T15:43:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-18T19:49:05.000Z (almost 5 years ago)
- Last Synced: 2024-05-21T00:39:44.850Z (6 months ago)
- Topics: c, c-library, clib, clibs, freebsd, linux, macos, operating-system, os, win32, win64, window
- Language: C
- Homepage: https://p.abranhe.com/os.c/
- Size: 12.7 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
os.c: Small C library to know your operating system.
## Installation
*Installing using [Clib](https://github.com/clibs/clib)*
```sh
$ clib install abranhe/os.c
```## Usage
```c
#include
#include "os.h"int main()
{
printf("%s\n", operating_system());
// macOS
return 0;
}
```## API
#### `char *operating_system(void);`
*Return the operating system you are using.*
###### Params:
- `void`: It takes no parameters
###### Available operating systems
| Operating System | `operating_system()` |
|:---------------- | :------------------- |
| macOS | `macOS` |
| Window 32 | `win32` |
| Window 64 | `win64` |
| Unix | `unix` |
| Linux | `linux` |
| Free BSD | `freeBSD` |
| Other | `other` |## Related
- [os][os]: cli tool for this library.
## Team|[![Carlos Abraham Logo][abranhe-img]][abranhe]|
| :-: |
| [Carlos Abraham][abranhe] |## License
[MIT][license] License © [Carlos Abraham][abranhe]
[abranhe]: https://github.com/abranhe
[abranhe-img]: https://avatars3.githubusercontent.com/u/21347264?s=50
[license]: https://github.com/abranhe/os.c/blob/master/license
[example]: https://github.com/abranhe/os.c/blob/master/example.c
[os]: https://github.com/abranhe/os
[travis-badge]: https://img.shields.io/travis/abranhe/os.c.svg
[travis-status]: https://travis-ci.org/abranhe/os.c
[coverage-badge]: https://img.shields.io/coveralls/abranhe/os.c.svg
[coverage-status]: https://coveralls.io/r/abranhe/os.c?branch=master