/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "Licence").
 * You may not use this file except in compliance with the Licence.
 *
 * You can obtain a copy of the licence at RISC OS path @.^.LICENCE
 * or http://www.riscosdev.com/lanman98/LICENCE.CDDL
 * See the Licence for the specific language governing permissions
 * and limitations under the Licence.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the Licence file.
 *
 * CDDL HEADER END
 *
 * Portions Copyright 2026 RISC OS Developments
 * SPDX-License-Identifier: CDDL-1.0
 */
/*
 * Bounded HTTP/1.1 transport for the WebDAV backend. */
#ifndef LM98_WEBHTTP_H
#define LM98_WEBHTTP_H
#include <stdio.h>
#define WEB_PATH_MAX 4096
#define WEB_HEADER_MAX 16384
#define WEB_ETAG_MAX 512
#define WEB_XML_MAX (16*1024*1024)

typedef struct {
    char host[254];
    char base[WEB_PATH_MAX];
    int port, secure;
    int cert_prompt_cs;
} web_url;
typedef struct {
    int status;
    long length;
    char etag[WEB_ETAG_MAX];
} web_reply;
int WebParseURL(const char *, web_url *);
int WebEscapePath(const char *, char *, int);
struct web_io_s;
void WebRequest(const web_url *, const char *, const char *, const char *,
                const char *, const char *, FILE *, long, FILE *, web_reply *,
                struct web_io_s *);
#endif
