2024-06-20 00:34:32 +00:00
|
|
|
#pragma once
|
|
|
|
#include "types.h"
|
2024-06-20 22:36:56 +00:00
|
|
|
#include <libintl.h>
|
2024-06-28 17:51:56 +00:00
|
|
|
#include <netinet/in.h>
|
2024-06-20 22:36:56 +00:00
|
|
|
#include <stdbool.h>
|
2024-06-22 22:55:01 +00:00
|
|
|
#include <stdio.h>
|
2024-06-20 00:34:32 +00:00
|
|
|
|
|
|
|
#define _(x) gettext(x)
|
|
|
|
|
|
|
|
bool contains(char *str, char s);
|
|
|
|
bool eq(char *s1, char *s2);
|
|
|
|
bool is_letter(char c);
|
|
|
|
bool is_digit(char c);
|
2024-07-01 03:43:20 +00:00
|
|
|
|
2024-06-22 22:55:01 +00:00
|
|
|
bool copy_from_buffer(void *dst, void *buffer, size_t size, ssize_t *total, ssize_t *used);
|
2024-07-01 03:43:20 +00:00
|
|
|
bool copy_to_buffer(void *buffer, void *src, size_t size, ssize_t *total, ssize_t *used);
|
|
|
|
|
|
|
|
bool can_write(char *path);
|
|
|
|
bool can_read(char *path);
|
2024-06-27 20:05:39 +00:00
|
|
|
bool is_file(char *path);
|
|
|
|
bool is_dir(char *path);
|
2024-07-01 03:43:20 +00:00
|
|
|
bool exists(char *path);
|
|
|
|
|
|
|
|
bool package_parse(char *package, char *name, char *version);
|
|
|
|
bool package_version_valid(char *name);
|
|
|
|
bool package_name_valid(char *name);
|
|
|
|
|
|
|
|
void pdebug(const char *func, const char *fmt, ...);
|
|
|
|
bool parse_host(char *addr, char *host, uint16_t *port);
|
|
|
|
bool extract_archive(char *dst, char *src);
|
2024-06-28 17:51:56 +00:00
|
|
|
bool mkdir_ifnot(char *path);
|
|
|
|
void sockaddr_to_str(struct sockaddr *addr, char *str);
|
2024-07-01 03:43:20 +00:00
|
|
|
|
|
|
|
int join_multiple(char *res, const char *base, const char *pth, const char *pth2);
|
|
|
|
int join(char *res, const char *base, const char *pth);
|
|
|
|
char *join_alloc(const char *base, const char *pth);
|