localserv/include/client.h

19 lines
548 B
C

#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
// run this before using anything else
// path: filesystem path to server's unix socket
int client_init(char* path);
// once successfully connected, send a string request
int client_request(char* request);
// if your request is successful, get the response
// the memory will be freed next time you request,
// so copy it if you need it
char* client_get_response();