viruri.h 1.2 KB
Newer Older
M
Martin Kletzander 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * viruri.h: internal definitions used for URI parsing.
 *
 * Copyright (C) 2012 Red Hat, Inc.
 *
 * See COPYING.LIB for the License of this software
 */

#ifndef __VIR_URI_H__
# define __VIR_URI_H__

# include <libxml/uri.h>

# include "internal.h"

16 17 18
typedef struct _virURI virURI;
typedef virURI *virURIPtr;

19 20 21 22 23 24 25 26 27
typedef struct _virURIParam virURIParam;
typedef virURIParam *virURIParamPtr;

struct _virURIParam {
    char *name;  /* Name (unescaped). */
    char *value; /* Value (unescaped). */
    bool ignore; /* Ignore this field in virURIFormatParams */
};

28 29 30 31 32 33 34 35
struct _virURI {
    char *scheme;       /* the URI scheme */
    char *server;       /* the server part */
    char *user;         /* the user part */
    int port;           /* the port number */
    char *path;         /* the path string */
    char *query;        /* the query string */
    char *fragment;     /* the fragment string */
36 37 38 39

    size_t paramsCount;
    size_t paramsAlloc;
    virURIParamPtr params;
40
};
M
Martin Kletzander 已提交
41

42 43 44 45
virURIPtr virURIParse(const char *uri)
    ATTRIBUTE_NONNULL(1);
char *virURIFormat(virURIPtr uri)
    ATTRIBUTE_NONNULL(1);
M
Martin Kletzander 已提交
46

47 48
char *virURIFormatParams(virURIPtr uri);

49 50
void virURIFree(virURIPtr uri);

M
Martin Kletzander 已提交
51
#endif /* __VIR_URI_H__ */