Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
08423342
Commit
08423342
authored
Aug 17, 2023
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vte: Remove the former all-in-one VCLI_VTE()
parent
c1f55638
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
50 deletions
+9
-50
vcli_serve.h
include/vcli_serve.h
+0
-3
vte.h
include/vte.h
+8
-0
vte.c
lib/libvarnish/vte.c
+1
-47
No files found.
include/vcli_serve.h
View file @
08423342
...
...
@@ -111,6 +111,3 @@ cli_func_t VCLS_func_ping_json;
/* VTE integration */
int
VCLI_VTE_format
(
void
*
priv
,
const
char
*
fmt
,
...)
v_printflike_
(
2
,
3
);
/* From libvarnish/vte.c */
void
VCLI_VTE
(
struct
cli
*
cli
,
struct
vsb
**
src
,
int
width
);
include/vte.h
View file @
08423342
...
...
@@ -25,6 +25,14 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Varnish Turbo Encabulator
*
* Align and print fields in a line-based output. Fields are delimited
* with a horizontal tab HT and lines starting with a space SP are kept
* verbatim. Lines are delimited with a single new line LF character.
*
* Using non-ASCII or non-printable ASCII character is undefined behavior.
*/
struct
vte
;
...
...
lib/libvarnish/vte.c
View file @
08423342
...
...
@@ -3,6 +3,7 @@
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
* Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*
...
...
@@ -34,21 +35,17 @@
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
/* for MUSL (ssize_t) */
#include "vdef.h"
#include "vqueue.h"
#include "miniobj.h"
#include "vas.h"
#include "vcli_serve.h"
#include "vsb.h"
#include "vte.h"
#define MAXCOL 10
#define MINSEP 1
#define MAXSEP 3
...
...
@@ -283,46 +280,3 @@ VTE_format(struct vte *vte, VTE_format_f *func, void *priv)
return
(
0
);
}
/* NB: cheating in the absence of a VCLI_Outv() */
static
int
vcli_vte
(
void
*
priv
,
const
char
*
fmt
,
...)
{
struct
cli
*
cli
;
va_list
ap
;
char
buf
[
2
];
cli
=
priv
;
AN
(
cli
);
va_start
(
ap
,
fmt
);
(
void
)
vsnprintf
(
buf
,
sizeof
buf
,
fmt
,
ap
);
va_end
(
ap
);
VCLI_Out
(
cli
,
"%c"
,
*
buf
);
return
(
0
);
}
void
VCLI_VTE
(
struct
cli
*
cli
,
struct
vsb
**
src
,
int
width
)
{
struct
vte
*
vte
;
AN
(
cli
);
AN
(
src
);
AN
(
*
src
);
AZ
(
VSB_finish
(
*
src
));
if
(
VSB_len
(
*
src
)
==
0
)
{
VSB_destroy
(
src
);
return
;
}
vte
=
VTE_new
(
MAXCOL
,
width
);
AN
(
vte
);
AZ
(
VTE_cat
(
vte
,
VSB_data
(
*
src
)));
AZ
(
VTE_finish
(
vte
));
AZ
(
VTE_format
(
vte
,
vcli_vte
,
cli
));
VTE_destroy
(
&
vte
);
VSB_destroy
(
src
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment