Annotation of embedaddon/mpd/src/chat.h, revision 1.1
1.1 ! misho 1:
! 2: /*
! 3: * chat.h
! 4: *
! 5: * Written by Archie Cobbs <archie@freebsd.org>
! 6: * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
! 7: * See ``COPYRIGHT.whistle''
! 8: */
! 9:
! 10: #ifndef _CHAT_H_
! 11: #define _CHAT_H_
! 12:
! 13: /*
! 14: * DEFINITIONS
! 15: */
! 16:
! 17: /* Bounds */
! 18:
! 19: #define CHAT_MAX_LINE 256
! 20: #define CHAT_MAX_LABEL 32
! 21: #define CHAT_MAX_MATCHES 32
! 22: #define CHAT_MAX_TIMERS 32
! 23: #define CHAT_NUM_VARIABLES 27
! 24: #define CHAT_READBUF_SIZE 48
! 25:
! 26: /* Chat logging levels */
! 27:
! 28: #define CHAT_LG_DEBUG 1
! 29: #define CHAT_LG_NORMAL 2
! 30: #define CHAT_LG_ERROR 3
! 31:
! 32: /* Variable names that have special meaning in chat.c */
! 33:
! 34: #define CHAT_VAR_PREFIX '$'
! 35: #define CHAT_VAR_MATCHED "$matchedString"
! 36: #define CHAT_VAR_BAUDRATE "$Baudrate"
! 37:
! 38: /* Forward decls */
! 39:
! 40: struct chatinfo;
! 41: typedef struct chatinfo *ChatInfo;
! 42:
! 43: /* Callback function types */
! 44:
! 45: typedef int (*chatbaudfunc_t)(void *arg, int rate);
! 46: typedef void (*chatresultfunc_t)(void *arg, int r, const char *msg);
! 47:
! 48: /*
! 49: * FUNCTIONS
! 50: */
! 51:
! 52: extern ChatInfo ChatInit(void *arg, chatbaudfunc_t setBaudrate);
! 53: extern void ChatPresetVar(ChatInfo c,
! 54: const char *var, const char *value);
! 55: extern char *ChatGetVar(ChatInfo c, const char *var);
! 56: extern void ChatStart(ChatInfo c, int fd, FILE *scriptfp,
! 57: const char *label, chatresultfunc_t result);
! 58: extern int ChatActive(ChatInfo c);
! 59: extern void ChatAbort(ChatInfo c);
! 60:
! 61: #endif
! 62:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>