Graphviz 12.1.0~dev.20240716.0947
Loading...
Searching...
No Matches
gv_tcl_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 <tcl.h>
12#include <gvc/gvc.h>
13#include <gvc/gvplugin.h>
14#include <gvc/gvcjob.h>
15#include <gvc/gvcint.h>
16#include <limits.h>
17#include "gv_channel.h"
18
19static size_t gv_string_writer(GVJ_t *job, const char *s, size_t len)
20{
21 // clamp to INT_MAX
22 int l = len > (size_t)INT_MAX ? INT_MAX : (int)len;
23 Tcl_AppendToObj((Tcl_Obj*)(job->output_file), s, l);
24 return (size_t)l;
25}
26
27static size_t gv_channel_writer(GVJ_t *job, const char *s, size_t len)
28{
29 // clamp to INT_MAX
30 int l = len > (size_t)INT_MAX ? INT_MAX : (int)len;
31 return (size_t)Tcl_Write((Tcl_Channel)(job->output_file), s, l);
32}
33
38
43
static double len(glCompPoint p)
Definition glutils.c:150
node NULL
Definition grammar.y:149
language-specific bindings API
static size_t gv_channel_writer(GVJ_t *job, const char *s, size_t len)
Definition gv_tcl_init.c:27
void gv_channel_writer_init(GVC_t *gvc)
Definition gv_tcl_init.c:39
void gv_writer_reset(GVC_t *gvc)
Definition gv_tcl_init.c:44
static size_t gv_string_writer(GVJ_t *job, const char *s, size_t len)
Definition gv_tcl_init.c:19
void gv_string_writer_init(GVC_t *gvc)
Definition gv_tcl_init.c:34
Graphviz context library.
GVC_t * gvc
Definition htmlparse.c:99
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 grammar.c:93