99PQS_EXPORT_API
void pqs_xfer_join_path(
char* output,
size_t outlen,
const char* first,
const char* second);
104PQS_EXPORT_API
void pqs_xfer_join_remote(
char* output,
size_t outlen,
const char* first,
const char* second);
144PQS_EXPORT_API
bool pqs_xfer_make_path(
char* output,
size_t outlen,
const char* root,
const char* relative);
188PQS_EXPORT_API
bool pqs_xfer_make_user_root(
char* output,
size_t outlen,
const char* root,
const char* username);
265PQS_EXPORT_API
bool pqs_xfer_hash_file(
const char* fpath,
char* hexhash,
size_t hexlen,
size_t* filesize);
289PQS_EXPORT_API
bool pqs_xfer_parse_metadata(
const char* metadata,
size_t* filesize,
char* hexhash,
size_t hexlen);
317PQS_EXPORT_API
bool pqs_xfer_parse_file_metadata(
const char* metadata,
char* relative,
size_t relen,
size_t* filesize,
char* hexhash,
size_t hexlen);
PQS_EXPORT_API bool pqs_xfer_parse_metadata(const char *metadata, size_t *filesize, char *hexhash, size_t hexlen)
Parse file-transfer metadata text.
Definition pqsxfer.c:1107
PQS_EXPORT_API bool pqs_xfer_walk_directory(const char *localroot, const char *remoteroot, size_t maxdepth, pqs_xfer_walk_callback callback, void *context)
Walk a local directory tree and report PQS transfer paths through a callback.
Definition pqsxfer.c:672
PQS_EXPORT_API bool pqs_xfer_format_file_metadata(char *output, size_t outlen, const char *relative, size_t filesize, const char *hexhash)
Format recursive file-transfer metadata text.
Definition pqsxfer.c:1141
PQS_EXPORT_API bool pqs_xfer_remove_confined(const char *root, const char *relative)
Remove a confined file inside the configured transfer root.
Definition pqsxfer.c:939
PQS_EXPORT_API size_t pqs_xfer_payload_size(const uint8_t *message, size_t msglen)
Return the plaintext payload length carried after the PQS application message header.
Definition pqsxfer.c:546
PQS_EXPORT_API bool pqs_xfer_publish_temporary_file(const char *root, const char *temporary, const char *relative)
Publish a staged temporary upload as its final confined file.
Definition pqsxfer.c:966
PQS_EXPORT_API bool pqs_xfer_make_local_recursive_path(char *output, size_t outlen, const char *root, const char *relative)
Build a local path for a recursive transfer member.
Definition pqsxfer.c:655
bool(* pqs_xfer_walk_callback)(pqs_xfer_walk_events event, const char *localpath, const char *relative, void *context)
File-transfer directory walk callback.
Definition pqsxfer.h:84
PQS_EXPORT_API bool pqs_xfer_local_path_is_directory(const char *path)
Test whether a local path is a directory.
Definition pqsxfer.c:594
PQS_EXPORT_API bool pqs_xfer_hash_file(const char *fpath, char *hexhash, size_t hexlen, size_t *filesize)
Compute the SHA3-256 hash of a local file.
Definition pqsxfer.c:1031
PQS_EXPORT_API void pqs_xfer_join_remote(char *output, size_t outlen, const char *first, const char *second)
Join two remote transfer path components using the PQS remote delimiter.
Definition pqsxfer.c:573
PQS_EXPORT_API bool pqs_xfer_path_is_symlink(const char *path)
Test whether a file-system path is a symbolic link or reparse point.
Definition pqsxfer.c:1208
PQS_EXPORT_API bool pqs_xfer_extract_relative(char *output, size_t outlen, const uint8_t *message, size_t msglen)
Extract a bounded relative path from a file-transfer application message.
Definition pqsxfer.c:700
PQS_EXPORT_API bool pqs_xfer_path_is_confined(const char *root, const char *path, bool existing)
Test whether a local path resolves inside the configured root.
Definition pqsxfer.c:725
PQS_EXPORT_API FILE * pqs_xfer_open_read_confined(const char *root, const char *relative)
Open a confined transfer file for binary reading.
Definition pqsxfer.c:1007
PQS_EXPORT_API bool pqs_xfer_path_is_safe(const char *relative)
Test whether a remote file-transfer path is safe.
Definition pqsxfer.c:691
PQS_EXPORT_API bool pqs_xfer_make_user_root(char *output, size_t outlen, const char *root, const char *username)
Build a per-user transfer root path.
Definition pqsxfer.c:852
PQS_EXPORT_API bool pqs_xfer_parse_file_metadata(const char *metadata, char *relative, size_t relen, size_t *filesize, char *hexhash, size_t hexlen)
Parse recursive file-transfer metadata text.
Definition pqsxfer.c:1160
PQS_EXPORT_API bool pqs_xfer_make_directory_confined(const char *root, const char *relative)
Create a confined directory inside the configured transfer root.
Definition pqsxfer.c:913
PQS_EXPORT_API FILE * pqs_xfer_open_write_confined(const char *root, const char *relative)
Open a confined transfer file for binary writing.
Definition pqsxfer.c:1019
PQS_EXPORT_API bool pqs_xfer_format_metadata(char *output, size_t outlen, size_t filesize, const char *hexhash)
Format file-transfer metadata text.
Definition pqsxfer.c:1088
PQS_EXPORT_API void pqs_xfer_join_path(char *output, size_t outlen, const char *first, const char *second)
Join two local file-system path components.
Definition pqsxfer.c:560
pqs_xfer_walk_events
File-transfer directory walk event types.
Definition pqsxfer.h:68
@ pqs_xfer_walk_event_directory_end
Definition pqsxfer.h:71
@ pqs_xfer_walk_event_file
Definition pqsxfer.h:70
@ pqs_xfer_walk_event_directory_begin
Definition pqsxfer.h:69
PQS_EXPORT_API bool pqs_xfer_make_temporary_path(char *output, size_t outlen, const char *relative)
Build a confined temporary upload path from a relative target path.
Definition pqsxfer.c:886
PQS_EXPORT_API bool pqs_xfer_create_parent_directories(const char *fpath)
Create all parent directories for a local output path.
Definition pqsxfer.c:619
PQS_EXPORT_API bool pqs_xfer_make_path(char *output, size_t outlen, const char *root, const char *relative)
Build a confined absolute path from a transfer root and a relative remote path.
Definition pqsxfer.c:821