]> code.delx.au - gnu-emacs-elpa/blob - chess-transport.el
*** no comment ***
[gnu-emacs-elpa] / chess-transport.el
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;;
3 ;; An example of a generic transport engine, based on the protocol
4 ;; used by chess-network.el. The only parts missing are send and
5 ;; receive. This could be used for transmitting chess.el protocol
6 ;; over CTCP, for example.
7 ;;
8 ;; NOTE: Make sure that any housekeeping data you use is kept in
9 ;; buffer-local variables. Otherwise, multiple games played using the
10 ;; same kind of transport might collide.
11 ;;
12 ;; $Revision$
13
14 (require 'chess-network)
15
16 (defalias 'chess-network-regexp-alist 'chess-transport-regexp-alist)
17
18 (defun chess-transport-handler (event &rest args)
19 "This is an example of a generic transport engine."
20 (cond
21 ((eq event 'initialize)
22 ;; initialize your transport here
23 )
24
25 ((eq event 'send)
26 ;; transmit the string given in (car args) to your outbound
27 ;; transport from here
28 )))
29
30 ;; call (chess-engine-submit engine STRING) for text that arrives from
31 ;; your inbound transport
32
33 (provide 'chess-transport)
34
35 ;;; chess-transport.el ends here