Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gv_java_init.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <stdio.h>
12#include <stdlib.h>
13#include <gvc/gvc.h>
14#include <gvc/gvplugin.h>
15#include <gvc/gvcjob.h>
16#include <gvc/gvcint.h>
17#include "gv_channel.h"
18
19typedef struct {
20 char* data;
21 size_t sz; /* buffer size */
22 size_t len; /* length of array */
23} BA;
24
25static size_t gv_string_writer(GVJ_t *job, const char *s, size_t len)
26{
27 BA* bap = (BA*)(job->output_file);
28 size_t newlen = bap->len + len;
29 if (newlen > bap->sz) {
30 bap->sz *= 2;
31 if (newlen > bap->sz)
32 bap->sz = 2*newlen;
33 bap->data = realloc(bap->data, bap->sz);
34 }
35 memcpy (bap->data+bap->len, s, len);
36 bap->len = newlen;
37 return len;
38}
39
44
45static size_t gv_channel_writer(GVJ_t *job, const char *s, size_t len)
46{
47 (void)job;
48 (void)s;
49 return len;
50}
51
56
static double len(glCompPoint p)
Definition glutils.c:150
node NULL
Definition grammar.y:163
static GVC_t * gvc
Definition gv.cpp:23
language-specific bindings API
static size_t gv_channel_writer(GVJ_t *job, const char *s, size_t len)
void gv_channel_writer_init(GVC_t *gvc)
void gv_writer_reset(GVC_t *gvc)
static size_t gv_string_writer(GVJ_t *job, const char *s, size_t len)
void gv_string_writer_init(GVC_t *gvc)
Graphviz context library.
Definition gv.cpp:665
int sz
Definition gv.cpp:667
size_t sz
int len
Definition gv.cpp:668
char * data
Definition gv.cpp:666
size_t len
Definition gvcint.h:80
size_t(* write_fn)(GVJ_t *job, const char *s, size_t len)
Definition gvcint.h:103
FILE * output_file
Definition gvcjob.h:277
Definition legal.c:50
Definition grammar.c:93