mario rosell coolest site ever

Usage

anntp is a single-header library. This means you can just vendor it, add a -I C preprocessor flag and use it.

Including the implementation

You’ll be familiar with this if you’ve ever used an stb library.

Define the ANNTP_IMPLEMENTATION macro in exactly one file,* else you will get many linker errors:

You can also define a couple more macros to configure the library in a similar fashion, those will be covered later:

/* file1.h */
#define ANNTP_IMPLEMENTATION
#include <anntp.h>

/* file2.h */
#include <anntp.h>

Some folks also like to make a separate C file with the implementations; it’s worth it if you also use other single-header libraries.

IMPORTANT: You must define _POSIX_C_SOURCE to 200112L before including this library

Configuring anntp

You should be familiar with these macros:

API

The API is based on connections. Connections abstract the TCP channel between a server and client.

They contain lots of data and things for the library of course, but most importantly, they contain the read and write buffers. All I/O functions operate on these.


To post a comment you need to login first.