shoes 0.3.2

A multi-protocol proxy server.
Documentation
/**
 * @file shoes.h
 * @brief C interface for the shoes proxy library (auto-generated by cbindgen).
 *
 * Provides C-compatible functions for embedding the shoes VPN/proxy engine
 * into iOS applications via Swift or Objective-C.
 */

#ifndef SHOES_H
#define SHOES_H

#include <stdbool.h>
#include <stdint.h>

/**
 * Socket protector callback type.
 * Called from Rust to protect sockets from VPN routing.
 * The callback receives a file descriptor and should return true if protected successfully.
 */
typedef bool (*ProtectSocketCallback)(int fd);

/**
 * Initialize the shoes library.
 *
 * # Arguments
 * * `log_level` - Log level string: "error", "warn", "info", "debug", "trace"
 *
 * # Returns
 * * 0 on success
 * * -1 on error
 *
 * # Safety
 * `log_level` must be a valid null-terminated C string.
 */
int shoes_init(const char *log_level);

/**
 * Start the shoes VPN service.
 *
 * # Arguments
 * * `config_yaml` - YAML configuration string (must include device_fd in TUN config)
 * * `protect_callback` - Callback function to protect sockets from VPN routing
 *
 * # Returns
 * * Handle (> 0) on success
 * * -1 on error
 *
 * # Safety
 * `config_yaml` must be a valid null-terminated C string.
 */
long shoes_start(const char *config_yaml, ProtectSocketCallback protect_callback);

/**
 * Stop the shoes VPN service.
 *
 * # Arguments
 * * `handle` - Handle returned by shoes_start (currently unused, we use global state)
 */
void shoes_stop(long _handle);

/**
 * Check if the shoes service is running.
 *
 * # Returns
 * * true if running
 * * false if not running
 */
bool shoes_is_running(void);

/**
 * Get the shoes library version.
 *
 * # Returns
 * A static string containing the version. Do not free this pointer.
 */
const char *shoes_get_version(void);

/**
 * Set the log file path for file-based logging.
 *
 * # Arguments
 * * `path` - Absolute path to the log file
 *
 * # Returns
 * * 0 on success
 * * -1 on error
 *
 * # Safety
 * `path` must be a valid null-terminated C string.
 */
int shoes_set_log_file(const char *path);

#endif  /* SHOES_H */