/* See LICENSE file for copyright and license details. */
#ifndef EXTRACT_H
#define EXTRACT_H
#include <stddef.h>
/* Callback invoked for each extracted URL.
* url: the extracted URL string
* ctx: user context pointer */
typedef void (*UrlCallback)(const char *url, void *ctx);
/* Extract all http/https URLs from a buffer.
* Calls cb for each URL found.
* Handles: plain text, HTML, Markdown, MDX */
void extract_urls(const char *data, size_t len,
UrlCallback cb, void *ctx);
/* Check if a file appears to be binary (contains null bytes) */
int is_binary(const char *data, size_t len);
#endif /* EXTRACT_H */