source: include/vapi/vsl.h @ 6e6edd

Revision 6e6edd, 3.4 KB checked in by Poul-Henning Kamp <phk@…>, 3 years ago (diff)

Complete (?) the varnish API #include cleanup.

We now have

<vapi/vs[mcl].h> for the programmatic API

<vapi/vs[cl]_int.h> for the underlying structure,

shared between API and varnishd

  • Property mode set to 100644
Line 
1/*-
2 * Copyright (c) 2006 Verdens Gang AS
3 * Copyright (c) 2006-2011 Varnish Software AS
4 * All rights reserved.
5 *
6 * Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#ifndef VAPI_VSL_H_INCLUDED
32#define VAPI_VSL_H_INCLUDED
33
34#include <stdint.h>
35
36#include "vapi/vsl_int.h"
37
38/*---------------------------------------------------------------------
39 * VSL level access functions
40 */
41
42void VSL_Setup(struct VSM_data *vd);
43        /*
44         * Setup vd for use with VSL functions.
45         */
46
47int VSL_Open(struct VSM_data *vd, int diag);
48        /*
49         * Attempt to open and map the shared memory file.
50         * If diag is non-zero, diagnostics are emitted.
51         * Returns:
52         *      0 on success
53         *      != 0 on failure
54         */
55
56#define VSL_ARGS        "bCcdI:i:k:n:r:s:X:x:m:"
57#define VSL_b_USAGE     "[-b]"
58#define VSL_c_USAGE     "[-c]"
59#define VSL_C_USAGE     "[-C]"
60#define VSL_d_USAGE     "[-d]"
61#define VSL_i_USAGE     "[-i tag]"
62#define VSL_I_USAGE     "[-I regexp]"
63#define VSL_k_USAGE     "[-k keep]"
64#define VSL_m_USAGE     "[-m tag:regex]"
65#define VSL_n_USAGE     VSM_n_USAGE
66#define VSL_r_USAGE     "[-r file]"
67#define VSL_s_USAGE     "[-s skip]"
68#define VSL_x_USAGE     "[-x tag]"
69#define VSL_X_USAGE     "[-X regexp]"
70#define VSL_USAGE       "[-bCcd] "              \
71                        VSL_i_USAGE " "         \
72                        VSL_I_USAGE " "         \
73                        VSL_k_USAGE " "         \
74                        VSL_m_USAGE " "         \
75                        VSL_n_USAGE " "         \
76                        VSL_r_USAGE " "         \
77                        VSL_s_USAGE " "         \
78                        VSL_X_USAGE " "         \
79                        VSL_x_USAGE
80
81int VSL_Arg(struct VSM_data *vd, int arg, const char *opt);
82        /*
83         * Handle standard log-presenter arguments
84         * Return:
85         *      -1 error
86         *       0 not handled
87         *       1 Handled.
88         */
89
90typedef int VSL_handler_f(void *priv, enum VSL_tag_e tag, unsigned fd,
91    unsigned len, unsigned spec, const char *ptr, uint64_t bitmap);
92
93#define VSL_S_CLIENT    (1 << 0)
94#define VSL_S_BACKEND   (1 << 1)
95VSL_handler_f VSL_H_Print;
96struct VSM_data;
97void VSL_Select(const struct VSM_data *vd, unsigned tag);
98void VSL_NonBlocking(const struct VSM_data *vd, int nb);
99int VSL_Dispatch(struct VSM_data *vd, VSL_handler_f *func, void *priv);
100int VSL_NextLog(const struct VSM_data *lh, uint32_t **pp, uint64_t *bitmap);
101int VSL_Matched(const struct VSM_data *vd, uint64_t bitmap);
102int VSL_Name2Tag(const char *name, int l);
103extern const char *VSL_tags[256];
104
105#endif /* VAPI_VSL_H_INCLUDED */
Note: See TracBrowser for help on using the repository browser.