libmp/include/util.h

17 lines
536 B
C

#pragma once
#include "types.h"
#include <libintl.h>
#include <stdbool.h>
#include <stdio.h>
#define _(x) gettext(x)
void pdebug(lm_ctx_t *ctx, const char *func, const char *fmt, ...);
bool parse_host(char *addr, char *host, uint16_t *port);
bool contains(char *str, char s);
bool eq(char *s1, char *s2);
bool is_letter(char c);
bool is_digit(char c);
bool copy_to_buffer(void *buffer, void *src, size_t size, ssize_t *total, ssize_t *used);
bool copy_from_buffer(void *dst, void *buffer, size_t size, ssize_t *total, ssize_t *used);