Graphviz  2.41.20170921.2350
gv_tcl_init.c
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #include <tcl.h>
15 #include "gvc.h"
16 #include "gvplugin.h"
17 #include "gvcjob.h"
18 #include "gvcint.h"
19 
20 static size_t gv_string_writer(GVJ_t *job, const char *s, size_t len)
21 {
22  Tcl_AppendToObj((Tcl_Obj*)(job->output_file), s, len);
23  return len;
24 }
25 
26 static size_t gv_channel_writer(GVJ_t *job, const char *s, size_t len)
27 {
28  return Tcl_Write((Tcl_Channel)(job->output_file), s, len);
29 }
30 
32 {
33  gvc->write_fn = gv_string_writer;
34 }
35 
37 {
38  gvc->write_fn = gv_channel_writer;
39 }
40 
void gv_writer_reset(GVC_t *gvc)
Definition: gv_dummy_init.c:5
Definition: gvcjob.h:271
void gv_string_writer_init(GVC_t *gvc)
Definition: gv_dummy_init.c:3
Definition: gvcint.h:70
Definition: grammar.c:79
#define NULL
Definition: logic.h:39
GVC_t * gvc
Definition: htmlparse.c:87
void gv_channel_writer_init(GVC_t *gvc)
Definition: gv_dummy_init.c:4
FILE * output_file
Definition: gvcjob.h:286
size_t(* write_fn)(GVJ_t *job, const char *s, size_t len)
Definition: gvcint.h:92