You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB
Markdown

## An easy-to-use C socket library
*Easysock* is a single-file, easy-to-use socket library, that can be used for network programming in C. It has no dependencies other than the C standard library.
2 years ago
___
### Compiling
The library can be compiled using the provided Makefile.
```
make
```
2 years ago
There are a few optional targets, which enable specific functionality.
`allwarn - enable all warnings`
`debug - compile with 'debug' flag`
`static - compile as statically linked library - NOT IMPLEMENTED`
2 years ago
2 years ago
<br />
<br />
2 years ago
They can be used as follows:
2 years ago
`make [TARGET NAME]`
___
### Installation
2 years ago
The library can also be installed using the provided Mekfile.
```
make install
```
The `install` target supports two environment variables. `DESTDIR`, which specifies the installation directory, and `PREFIX` which specifies the installation prefix. They are used as follows:
`DESTDIR=/home/user PREFIX=/usr/local make install`
This will install the library file in `/home/user/usr/local/lib` and the header file in `/home/user/usr/local/include`.
___
### Usage
To use the library, simply include the header file:
```
#include <easysock.h>
...
```
2 years ago
and link the library:
2 years ago
`gcc example.c -o example -leasysock`
2 years ago
___
2 years ago
### Troubleshooting
2 years ago
#### * The library isn't loaded on Arch Linux, "cannot open shared object file: No such file or directory"
2 years ago
This is becacuse Arch Linux [doesn't include '/usr/local/lib'](https://libreddit.tiekoetter.com/r/archlinux/comments/ws9qty/why_is_usrlocallib_not_in_the_default_search_path/) in its library search path by default. To add it, create a file ending in '.conf' under `/etc/ld.so.conf.d/`, and add '/usr/local/lib' to it. Then, run `ldconfig` as root.
2 years ago
<br />
<br />
This file was written using [Dillinger](https://dillinger.io).
2 years ago