File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / chat.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 08:44:29 2013 UTC (10 years, 10 months ago) by misho
Branches: mpd, MAIN
CVS tags: v5_9p16, v5_9, v5_8p7, v5_8p1_cross, v5_8p1, v5_8, v5_7p0, v5_7, v5_6, HEAD
5.7


/*
 * chat.h
 *
 * Written by Archie Cobbs <archie@freebsd.org>
 * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
 * See ``COPYRIGHT.whistle''
 */

#ifndef _CHAT_H_
#define _CHAT_H_

/*
 * DEFINITIONS
 */

/* Bounds */

  #define CHAT_MAX_LINE		256
  #define CHAT_MAX_LABEL	32
  #define CHAT_MAX_MATCHES	32
  #define CHAT_MAX_TIMERS	32
  #define CHAT_NUM_VARIABLES	27
  #define CHAT_READBUF_SIZE	48

/* Chat logging levels */

  #define CHAT_LG_DEBUG		1
  #define CHAT_LG_NORMAL	2
  #define CHAT_LG_ERROR		3

/* Variable names that have special meaning in chat.c */

  #define CHAT_VAR_PREFIX	'$'
  #define CHAT_VAR_MATCHED	"$matchedString"
  #define CHAT_VAR_BAUDRATE	"$Baudrate"

/* Forward decls */

  struct chatinfo;
  typedef struct chatinfo	*ChatInfo;

/* Callback function types */

  typedef int	(*chatbaudfunc_t)(void *arg, int rate);
  typedef void	(*chatresultfunc_t)(void *arg, int r, const char *msg);

/*
 * FUNCTIONS
 */

  extern ChatInfo	ChatInit(void *arg, chatbaudfunc_t setBaudrate);
  extern void		ChatPresetVar(ChatInfo c,
			  const char *var, const char *value);
  extern char		*ChatGetVar(ChatInfo c, const char *var);
  extern void		ChatStart(ChatInfo c, int fd, FILE *scriptfp,
			  const char *label, chatresultfunc_t result);
  extern int		ChatActive(ChatInfo c);
  extern void		ChatAbort(ChatInfo c);

#endif


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>