root/src/noit_console.h

Revision 1d69a01311e58ce6ddb007d690b4e9aa4ac08c8c, 1.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 7 years ago)

And make it all work on OpenBSD (ld -E ? sigh...)

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_CONSOLE_H
7 #define _NOIT_CONSOLE_H
8
9 #include "noit_defines.h"
10 #include "eventer/eventer.h"
11 #include "noitedit/histedit.h"
12 #include "noit_console_telnet.h"
13 #include <stdarg.h>
14
15 typedef struct __noit_console_closure {
16   eventer_t e;           /* The event it is attached to.  This
17                           * is needed so it can write itself out */
18   int   wants_shutdown;  /* Set this to 1 to have it die */
19
20   /* nice console support */
21   EditLine *el;
22   History *hist;
23
24   int   pty_master;
25   int   pty_slave;
26
27   /* Output buffer for non-blocking sends */
28   char *outbuf;
29   int   outbuf_allocd;
30   int   outbuf_len;
31   int   outbuf_completed;
32
33   /* This tracks telnet protocol state (if we're doing telnet) */
34   noit_console_telnet_closure_t telnet;
35
36 } * noit_console_closure_t;;
37
38 API_EXPORT(void) noit_console_init();
39
40 API_EXPORT(int)
41   noit_console_handler(eventer_t e, int mask, void *closure,
42                        struct timeval *now);
43
44
45 API_EXPORT(int)
46   nc_printf(noit_console_closure_t ncct, const char *fmt, ...);
47
48 API_EXPORT(int)
49   nc_vprintf(noit_console_closure_t ncct, const char *fmt, va_list arg);
50
51 API_EXPORT(int)
52   nc_write(noit_console_closure_t ncct, void *buf, int len);
53
54 API_EXPORT(int)
55   noit_console_continue_sending(noit_console_closure_t ncct,
56                                 int *mask);
57 #endif
Note: See TracBrowser for help on using the browser.