1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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.
10 (require 'chess-network)
12 (defvar chess-transport-regexp-alist chess-network-regexp-alist)
14 (defun chess-transport-handler (event &rest args)
15 "This is an example of a generic transport engine."
17 ((eq event 'initialize)
18 ;; Initialize the transport here, if necessary. Make sure that
19 ;; any housekeeping data you use is kept in buffer-local
20 ;; variables. Otherwise, multiple games played using the same
21 ;; kind of transport might collide. For example:
23 ;; (set (make-local-variable 'chess-transport-data) (car args))
27 ;; Transmit the string given in `(car args)' to the outbound
28 ;; transport from here
32 ;; Pass all other events down to chess-network
33 (apply 'chess-network-handler event args))))
35 ;; Call `(chess-engine-submit engine STRING)' for text that arrives
36 ;; from the inbound transport
38 (provide 'chess-transport)
40 ;;; chess-transport.el ends here