(1) Added $host_lookup_deferred.
[exim.git] / src / exim_monitor / em_text.c
CommitLineData
c988f1f4 1/* $Cambridge: exim/src/exim_monitor/em_text.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
059ec3d9
PH
2
3/*************************************************
4* Exim Monitor *
5*************************************************/
6
c988f1f4 7/* Copyright (c) University of Cambridge 1995 - 2005 */
059ec3d9
PH
8/* See the file NOTICE for conditions of use and distribution. */
9
10
11#include "em_hdr.h"
12
13
14/* This module contains functions for displaying text in a
15text widget. It is not used for the log widget, because that
16is dynamically updated and has special scrolling requirements. */
17
18
19/* Count of characters displayed */
20
21static int text_count = 0;
22
23
24/*************************************************
25* Empty the widget *
26*************************************************/
27
28void text_empty(Widget w)
29{
30XawTextBlock b;
31b.firstPos = 0;
32b.ptr = CS &b;
33b.format = FMT8BIT;
34b.length = 0;
35XawTextReplace(w, 0, text_count, &b);
36text_count = 0;
37XawTextSetInsertionPoint(w, text_count);
38}
39
40
41
42/*************************************************
43* Display text *
44*************************************************/
45
46void text_show(Widget w, uschar *s)
47{
48XawTextBlock b;
49b.firstPos = 0;
50b.ptr = CS s;
51b.format = FMT8BIT;
52b.length = Ustrlen(s);
53XawTextReplace(w, text_count, text_count, &b);
54text_count += b.length;
55XawTextSetInsertionPoint(w, text_count);
56}
57
58
59/*************************************************
60* Display text from format *
61*************************************************/
62
63void text_showf(Widget w, char *s, ...)
64{
65va_list ap;
66uschar buffer[1024];
67va_start(ap, s);
68vsprintf(CS buffer, s, ap);
69va_end(ap);
70text_show(w, buffer);
71}
72
73/* End of em_text.c */