home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume27 / bam / part02 < prev    next >
Text File  |  1992-01-06  |  18KB  |  599 lines

  1. Newsgroups: comp.sources.misc
  2. From: sbo@vlsi.polymtl.ca (Stephane Boucher)
  3. Subject:  v27i069:  bam - Open Look Menu System for GNU Emacs, Part02/02
  4. Message-ID: <1992Jan6.162142.9934@sparky.imd.sterling.com>
  5. X-Md4-Signature: 30dd90c74c21933a1a831ede25a8d235
  6. Date: Mon, 6 Jan 1992 16:21:42 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: sbo@vlsi.polymtl.ca (Stephane Boucher)
  10. Posting-number: Volume 27, Issue 69
  11. Archive-name: bam/part02
  12. Environment: Xview, Sun
  13.  
  14. #! /bin/sh
  15. # into a shell via "sh file" or similar.  To overwrite existing files,
  16. # type "sh file -c".
  17. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  18. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  19. # Contents:  bam-1.0/DOC bam-1.0/args.c bam-1.0/bam.c bam-1.0/bam.el
  20. #   bam-1.0/bam.h bam-1.0/emacs_init_addin
  21. #   bam-1.0/menus/emacs-base-ol.el bam-1.0/menus/ex1
  22. #   bam-1.0/menus/ex1.el bam-1.0/menus/latex.el bam-1.0/send.c
  23. # Wrapped by kent@sparky on Fri Jan  3 21:06:20 1992
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 2 (of 2)."'
  27. if test -f 'bam-1.0/DOC' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'bam-1.0/DOC'\"
  29. else
  30.   echo shar: Extracting \"'bam-1.0/DOC'\" \(2067 characters\)
  31.   sed "s/^X//" >'bam-1.0/DOC' <<'END_OF_FILE'
  32. XCommand Line Options
  33. X--------------------
  34. X
  35. Xbam [-e <error command string>] [<XView switches>] <menufile>
  36. X
  37. X    -e <error command string>
  38. X        the command string is the string sent to
  39. X        emacs when an error is encounter durring
  40. X        the excution of bam. This string
  41. X        must contain exactly one %s which will
  42. X        be replaced by the message genarated
  43. X        by bam.
  44. X    <XView swithes> 
  45. X        The program can take any XView switches,
  46. X        since it is written in XView.
  47. X        The ones that are particularly interesting
  48. X        are:
  49. X        -Wp <x> <y> for the window position
  50. X        -Wt <font name> to specify a font for
  51. X         the menus. It is recommanded to use 
  52. X         a fixed font since it is easier to align
  53. X         things in the menus.
  54. X        -Ws <x-size> <y-size> to specify the window
  55. X         size. What happens is that bam fits
  56. X         buttons in the window of the size specified
  57. X         and at the end resize the window to fit
  58. X         around the already placed menu buttons.
  59. X    <menufile>
  60. X        This is the file that contains the 
  61. X        description of an entire menu.
  62. X
  63. X
  64. XMenu File Format
  65. X----------------
  66. X
  67. XThe indentation and spacing is rather loose,
  68. Xsince the parser is built with lex and yacc.
  69. X
  70. XThe basic frame format for a menu is:
  71. X<menu file>: 
  72. XFRAME TITLE <title string> PANEL <lst_buttons> END END
  73. X
  74. X<lst_buttons>:
  75. XBUTTON <button name string> <action string> <menu>
  76. X
  77. X<menu>:
  78. XMENU <lst menu attributes>* <menu items>+ END
  79. X
  80. X<lst menu attributes>:
  81. XTITLE <string> (NO_PUSHPIN | PUSHPIN | nothing )
  82. X
  83. X<menu items>:
  84. XTEXT <menu item name string> <action string> |
  85. XTEXT <menu item name string> <action string> <menu> |
  86. XBITMAP <file name of bitmap string> <action string> |
  87. XBITMAP <file name of bitmap string> <action string> <menu>
  88. X
  89. X
  90. Xall type of strings must be delimited by "".  To
  91. Xhave a " or \ within a string you simply use \"
  92. Xand \\. You can't, however, use things like \n,
  93. X\t etc.
  94. X
  95. Xit is possible to write :
  96. X"this is a
  97. Xmulti-line string".
  98. X
  99. XNote that PANEL is there for future use. It is
  100. Xat the moment useless. It is however required.
  101. X
  102. XOnly one FRAME or PANEL is possible per file.
  103. X
  104. X<action string> is a lisp expression.
  105. X
  106. XThe bitmap file must be an X bitmap.
  107. END_OF_FILE
  108.   if test 2067 -ne `wc -c <'bam-1.0/DOC'`; then
  109.     echo shar: \"'bam-1.0/DOC'\" unpacked with wrong size!
  110.   fi
  111.   # end of 'bam-1.0/DOC'
  112. fi
  113. if test -f 'bam-1.0/args.c' -a "${1}" != "-c" ; then 
  114.   echo shar: Will not clobber existing file \"'bam-1.0/args.c'\"
  115. else
  116.   echo shar: Extracting \"'bam-1.0/args.c'\" \(1442 characters\)
  117.   sed "s/^X//" >'bam-1.0/args.c' <<'END_OF_FILE'
  118. X/*
  119. X    bam - the Born Again Menus for GNU Emacs.
  120. X    Copyright (C) 1991    Stephane Boucher
  121. X
  122. X    This program is free software; you can redistribute it and/or modify
  123. X    it under the terms of the GNU General Public License as published by
  124. X    the Free Software Foundation; either version 1, or (at your option)
  125. X    any later version.
  126. X
  127. X    This program is distributed in the hope that it will be useful,
  128. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  129. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  130. X    GNU General Public License for more details.
  131. X
  132. X    You should have received a copy of the GNU General Public License
  133. X    along with this program; if not, write to the Free Software
  134. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  135. X*/
  136. X/* @(#)args.c    1.4 91/11/12 */
  137. X
  138. X#include "bam.h"
  139. X
  140. Xextern char *optarg;
  141. Xextern int optind, opterr;
  142. X
  143. XprocessArgs(argc, argv)
  144. X     int argc;
  145. X     char **argv;
  146. X{
  147. X  char c;
  148. X  int errflg=0;
  149. X
  150. X  while ((c = getopt(argc, argv, "e")) != -1)
  151. X    switch (c) {
  152. X    case 'e':
  153. X      /* -e <error_format> 
  154. X     Specify the error format where <error_format>
  155. X     is a format string like printf format with
  156. X     one %s */
  157. X
  158. X      errorFormat=optarg;
  159. X      break;
  160. X
  161. X    case '?':
  162. X    default:
  163. X      errflg++;
  164. X      break;
  165. X    }
  166. X
  167. X  if (errflg || optind+1!=argc) {
  168. X    sendErrorToEmacs("usage: \n\
  169. X\t%s [-e <error_format>] menu_file\n", argv[0]);
  170. X    exit (2);
  171. X  }
  172. X
  173. X  menuFile=argv[optind];
  174. X}
  175. END_OF_FILE
  176.   if test 1442 -ne `wc -c <'bam-1.0/args.c'`; then
  177.     echo shar: \"'bam-1.0/args.c'\" unpacked with wrong size!
  178.   fi
  179.   # end of 'bam-1.0/args.c'
  180. fi
  181. if test -f 'bam-1.0/bam.c' -a "${1}" != "-c" ; then 
  182.   echo shar: Will not clobber existing file \"'bam-1.0/bam.c'\"
  183. else
  184.   echo shar: Extracting \"'bam-1.0/bam.c'\" \(1826 characters\)
  185.   sed "s/^X//" >'bam-1.0/bam.c' <<'END_OF_FILE'
  186. X/*
  187. X    bam - the Born Again Menus for GNU Emacs.
  188. X    Copyright (C) 1991    Stephane Boucher
  189. X
  190. X    This program is free software; you can redistribute it and/or modify
  191. X    it under the terms of the GNU General Public License as published by
  192. X    the Free Software Foundation; either version 1, or (at your option)
  193. X    any later version.
  194. X
  195. X    This program is distributed in the hope that it will be useful,
  196. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  197. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  198. X    GNU General Public License for more details.
  199. X
  200. X    You should have received a copy of the GNU General Public License
  201. X    along with this program; if not, write to the Free Software
  202. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  203. X*/
  204. X/* @(#)bam.c    1.5 91/11/12 */
  205. X
  206. X#include <unistd.h>
  207. X
  208. X#include "bam.h"
  209. X
  210. Xchar *menuFile=NULL;
  211. Xchar *errorFormat="(command-process-error \"%s\")";
  212. XFrame baseFrame;
  213. X
  214. X
  215. Xmain(argc, argv)
  216. X     int argc;
  217. X     char **argv; 
  218. X{
  219. X  int exitVal=0;
  220. X  
  221. X  xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  222. X
  223. X  processArgs(argc, argv);
  224. X
  225. X  if (access(menuFile, R_OK) == 0 ) {
  226. X    /* Menu File accessible */
  227. X
  228. X    yyin=fopen(menuFile, "r");
  229. X
  230. X    if (!yyparse()) {
  231. X      window_main_loop(baseFrame);
  232. X    }
  233. X    else {
  234. X      /* A parse error has occured */
  235. X      exitVal=1;
  236. X    }
  237. X
  238. X    fclose(yyin);
  239. X  }
  240. X  else {
  241. X    /* Menu File not accessible */
  242. X    sendErrorToEmacs("Unaccessable File: %s\n", menuFile);
  243. X    exitVal=1;
  244. X  }
  245. X
  246. X  return(exitVal);
  247. X} 
  248. X
  249. X
  250. X
  251. Xvoid 
  252. XmenuProc (menu, menuItem)
  253. X     Menu menu;
  254. X     Menu_item menuItem;
  255. X{
  256. X  sendToEmacs( (char *)xv_get(menuItem, 
  257. X                  XV_KEY_DATA, M_COMMAND_STRING));
  258. X}
  259. Xint
  260. Xselected(item, event)
  261. XPanel_item item;
  262. XEvent *event;
  263. X{
  264. X  sendToEmacs((char *)xv_get(item, 
  265. X                 XV_KEY_DATA, M_COMMAND_STRING));
  266. X  return XV_OK;
  267. X}
  268. X
  269. X
  270. END_OF_FILE
  271.   if test 1826 -ne `wc -c <'bam-1.0/bam.c'`; then
  272.     echo shar: \"'bam-1.0/bam.c'\" unpacked with wrong size!
  273.   fi
  274.   # end of 'bam-1.0/bam.c'
  275. fi
  276. if test -f 'bam-1.0/bam.el' -a "${1}" != "-c" ; then 
  277.   echo shar: Will not clobber existing file \"'bam-1.0/bam.el'\"
  278. else
  279.   echo shar: Extracting \"'bam-1.0/bam.el'\" \(316 characters\)
  280.   sed "s/^X//" >'bam-1.0/bam.el' <<'END_OF_FILE'
  281. X(require 'command-process)
  282. X(load-library "bytecomp")
  283. X
  284. X(defun strings-to-buffer (string1 string2)
  285. X  "*Inserts STRING1 and STRING2 in current buffer, puts point after STRING1."
  286. X  (insert string1)
  287. X  (let ((newpoint (point)))
  288. X    (insert string2)
  289. X    (goto-char newpoint)))
  290. X
  291. X(byte-compile (function strings-to-buffer))
  292. X
  293. END_OF_FILE
  294.   if test 316 -ne `wc -c <'bam-1.0/bam.el'`; then
  295.     echo shar: \"'bam-1.0/bam.el'\" unpacked with wrong size!
  296.   fi
  297.   # end of 'bam-1.0/bam.el'
  298. fi
  299. if test -f 'bam-1.0/bam.h' -a "${1}" != "-c" ; then 
  300.   echo shar: Will not clobber existing file \"'bam-1.0/bam.h'\"
  301. else
  302.   echo shar: Extracting \"'bam-1.0/bam.h'\" \(1683 characters\)
  303.   sed "s/^X//" >'bam-1.0/bam.h' <<'END_OF_FILE'
  304. X/*
  305. X    bam - the Born Again Menus for GNU Emacs.
  306. X    Copyright (C) 1991    Stephane Boucher
  307. X
  308. X    This program is free software; you can redistribute it and/or modify
  309. X    it under the terms of the GNU General Public License as published by
  310. X    the Free Software Foundation; either version 1, or (at your option)
  311. X    any later version.
  312. X
  313. X    This program is distributed in the hope that it will be useful,
  314. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  315. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  316. X    GNU General Public License for more details.
  317. X
  318. X    You should have received a copy of the GNU General Public License
  319. X    along with this program; if not, write to the Free Software
  320. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  321. X*/
  322. X/* @(#)bam.h    1.5 91/11/12 */
  323. X
  324. X#ifndef _EMENU_H_
  325. X#define _EMENU_H_
  326. X
  327. X#include <xview/xview.h>
  328. X#include <xview/frame.h>
  329. X#include <xview/panel.h>
  330. X#include <xview/openmenu.h>
  331. X
  332. X#include <stdio.h>
  333. X
  334. X/* ---------------------------------- */
  335. X
  336. Xtypedef struct {
  337. X  struct {
  338. X    int pushpin;
  339. X    char *title;
  340. X  } attr;
  341. X  Menu id;
  342. X  Menu prevCur; /* Previous current menu */
  343. X} MenuData;
  344. X
  345. X
  346. X/* ---------------------------------- */
  347. X/* Fonction Prototypes              */
  348. X
  349. Xvoid sendToEmacs();
  350. Xvoid sendErrorToEmacs();
  351. X
  352. Xvoid menuProc();
  353. Xint selected();
  354. X
  355. Xint processArgs();
  356. X
  357. Xvoid initMenuData();
  358. Xint setMenu();
  359. X
  360. X/* ---------------------------------- */
  361. X
  362. X#define TRUE             1
  363. X#define FALSE             0
  364. X
  365. X#define M_COMMAND_STRING     100
  366. X
  367. X#define M_NO_PUSHPIN        0
  368. X#define M_PUSHPIN        1
  369. X
  370. X/* ---------------------------------- */
  371. X/* Global variables                   */
  372. Xextern FILE *yyin;
  373. Xextern char *menuFile;
  374. Xextern char *errorFormat;
  375. X
  376. X#endif
  377. END_OF_FILE
  378.   if test 1683 -ne `wc -c <'bam-1.0/bam.h'`; then
  379.     echo shar: \"'bam-1.0/bam.h'\" unpacked with wrong size!
  380.   fi
  381.   # end of 'bam-1.0/bam.h'
  382. fi
  383. if test -f 'bam-1.0/emacs_init_addin' -a "${1}" != "-c" ; then 
  384.   echo shar: Will not clobber existing file \"'bam-1.0/emacs_init_addin'\"
  385. else
  386.   echo shar: Extracting \"'bam-1.0/emacs_init_addin'\" \(788 characters\)
  387.   sed "s/^X//" >'bam-1.0/emacs_init_addin' <<'END_OF_FILE'
  388. X(if (eq window-system 'x)
  389. X    (progn
  390. X      ;; get ready to load various menus
  391. X      (load-library "bam")
  392. X
  393. X      ;; Change those 2 (*bam-..-dir*) variables to reflect your setup
  394. X      (setq *bam-exec-dir* "/usr/users/sboucher/gegi/emenu")
  395. X
  396. X      ;; The *bam-menu-dir* variable is only necessary when you
  397. X      ;; load a menu. Therefore you can change it between each
  398. X      ;; load-file call to load menus from different directories.
  399. X      (setq *bam-menu-dir* "/usr/users/sboucher/gegi/emenu/menus")
  400. X
  401. X      ;; Load various menus
  402. X      (load-file (concat *bam-menu-dir* "/emacs-base-ol.el"))
  403. X      (load-file (concat *bam-menu-dir* "/ex1.el"))
  404. X      (load-file (concat *bam-menu-dir* "/latex.el"))
  405. X
  406. X      ;; Pop various menus
  407. X      (emacs-menu)
  408. X      (ex1-menu)
  409. X      (latex-menu)))
  410. X      
  411. END_OF_FILE
  412.   if test 788 -ne `wc -c <'bam-1.0/emacs_init_addin'`; then
  413.     echo shar: \"'bam-1.0/emacs_init_addin'\" unpacked with wrong size!
  414.   fi
  415.   # end of 'bam-1.0/emacs_init_addin'
  416. fi
  417. if test -f 'bam-1.0/menus/emacs-base-ol.el' -a "${1}" != "-c" ; then 
  418.   echo shar: Will not clobber existing file \"'bam-1.0/menus/emacs-base-ol.el'\"
  419. else
  420.   echo shar: Extracting \"'bam-1.0/menus/emacs-base-ol.el'\" \(358 characters\)
  421.   sed "s/^X//" >'bam-1.0/menus/emacs-base-ol.el' <<'END_OF_FILE'
  422. X(setq *bam-emacs-menu-dir* *bam-menu-dir*)
  423. X(defun emacs-menu ()
  424. X  (interactive)
  425. X  (process-kill-without-query
  426. X   (command-process (concat *bam-exec-dir* "/bam")
  427. X            "-Wp" "0" "0"      ; position of window
  428. X            "-Wt" "7x14"       ; font
  429. X            "-Ws" "1000" "300" ;window size
  430. X            (concat *bam-emacs-menu-dir* "/emacs-base-ol")    ;Menu filename
  431. X            )))
  432. END_OF_FILE
  433.   if test 358 -ne `wc -c <'bam-1.0/menus/emacs-base-ol.el'`; then
  434.     echo shar: \"'bam-1.0/menus/emacs-base-ol.el'\" unpacked with wrong size!
  435.   fi
  436.   # end of 'bam-1.0/menus/emacs-base-ol.el'
  437. fi
  438. if test -f 'bam-1.0/menus/ex1' -a "${1}" != "-c" ; then 
  439.   echo shar: Will not clobber existing file \"'bam-1.0/menus/ex1'\"
  440. else
  441.   echo shar: Extracting \"'bam-1.0/menus/ex1'\" \(866 characters\)
  442.   sed "s/^X//" >'bam-1.0/menus/ex1' <<'END_OF_FILE'
  443. XFRAME
  444. XTITLE "Emacs Menu example 1"
  445. X    PANEL
  446. X        BUTTON "Menu button 1" "(message \"button action 1\")"
  447. X        MENU
  448. X        TITLE "Menu 1"    
  449. X            BITMAP "/usr/openwin/lib/bitmaps/c10pinin" "(message \"This is a bitmap item\")"
  450. X            TEXT "Text item" "(message \"This is a text item\")"
  451. X            BITMAP "/usr/openwin/lib/bitmaps/stones" "(message \"action bitmap\")"
  452. X        END
  453. X        BUTTON "Menu Button 2" "(message \"button action 2\")"
  454. X        MENU
  455. X        TITLE "Menu 2"
  456. X            TEXT "text item 2" "(message \"text item action\")"
  457. X            MENU
  458. X                TEXT "item 3" "(message \"action\")"
  459. X                TEXT "item 4" "(message \"action\")"
  460. X            END
  461. X            BITMAP "/usr/openwin/lib/bitmaps/grune" "(message \"action bitmap\")"
  462. X            MENU NO_PUSHPIN
  463. X            TITLE "Menu 3"
  464. X                TEXT "item 5" "(message \"action\")"
  465. X                TEXT "item 6" "(message \"action\")"
  466. X            END
  467. X            BITMAP "/usr/openwin/lib/bitmaps/nights" "(message \"action bitmap\")"
  468. X         END
  469. X    END
  470. XEND
  471. END_OF_FILE
  472.   if test 866 -ne `wc -c <'bam-1.0/menus/ex1'`; then
  473.     echo shar: \"'bam-1.0/menus/ex1'\" unpacked with wrong size!
  474.   fi
  475.   # end of 'bam-1.0/menus/ex1'
  476. fi
  477. if test -f 'bam-1.0/menus/ex1.el' -a "${1}" != "-c" ; then 
  478.   echo shar: Will not clobber existing file \"'bam-1.0/menus/ex1.el'\"
  479. else
  480.   echo shar: Extracting \"'bam-1.0/menus/ex1.el'\" \(328 characters\)
  481.   sed "s/^X//" >'bam-1.0/menus/ex1.el' <<'END_OF_FILE'
  482. X(setq *bam-ex1-menu-dir* *bam-menu-dir*)
  483. X(defun ex1-menu ()
  484. X  (interactive)
  485. X  (process-kill-without-query
  486. X   (command-process (concat *bam-exec-dir* "/bam")
  487. X            "-Wp" "0" "0"    ; position of window
  488. X            "-Wt" "7x14"    ; font
  489. X            "-Ws" "1000" "300"    ;window size
  490. X            (concat *bam-ex1-menu-dir* "/ex1") ;Menu filename
  491. X            )))
  492. END_OF_FILE
  493.   if test 328 -ne `wc -c <'bam-1.0/menus/ex1.el'`; then
  494.     echo shar: \"'bam-1.0/menus/ex1.el'\" unpacked with wrong size!
  495.   fi
  496.   # end of 'bam-1.0/menus/ex1.el'
  497. fi
  498. if test -f 'bam-1.0/menus/latex.el' -a "${1}" != "-c" ; then 
  499.   echo shar: Will not clobber existing file \"'bam-1.0/menus/latex.el'\"
  500. else
  501.   echo shar: Extracting \"'bam-1.0/menus/latex.el'\" \(336 characters\)
  502.   sed "s/^X//" >'bam-1.0/menus/latex.el' <<'END_OF_FILE'
  503. X(setq *bam-latex-menu-dir* *bam-menu-dir*)
  504. X(defun latex-menu ()
  505. X  (interactive)
  506. X  (process-kill-without-query
  507. X   (command-process (concat *bam-exec-dir* "/bam")
  508. X            "-Wp" "0" "0"    ; position of window
  509. X            "-Wt" "7x14"    ; font
  510. X            "-Ws" "1000" "300"    ;window size
  511. X            (concat *bam-latex-menu-dir* "/latex") ;Menu filename
  512. X            )))
  513. END_OF_FILE
  514.   if test 336 -ne `wc -c <'bam-1.0/menus/latex.el'`; then
  515.     echo shar: \"'bam-1.0/menus/latex.el'\" unpacked with wrong size!
  516.   fi
  517.   # end of 'bam-1.0/menus/latex.el'
  518. fi
  519. if test -f 'bam-1.0/send.c' -a "${1}" != "-c" ; then 
  520.   echo shar: Will not clobber existing file \"'bam-1.0/send.c'\"
  521. else
  522.   echo shar: Extracting \"'bam-1.0/send.c'\" \(1328 characters\)
  523.   sed "s/^X//" >'bam-1.0/send.c' <<'END_OF_FILE'
  524. X/*
  525. X    bam - the Born Again Menus for GNU Emacs.
  526. X    Copyright (C) 1991    Stephane Boucher
  527. X
  528. X    This program is free software; you can redistribute it and/or modify
  529. X    it under the terms of the GNU General Public License as published by
  530. X    the Free Software Foundation; either version 1, or (at your option)
  531. X    any later version.
  532. X
  533. X    This program is distributed in the hope that it will be useful,
  534. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  535. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  536. X    GNU General Public License for more details.
  537. X
  538. X    You should have received a copy of the GNU General Public License
  539. X    along with this program; if not, write to the Free Software
  540. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  541. X*/
  542. X/* @(#)send.c    1.5 91/11/12 */
  543. X
  544. X#include <stdio.h>
  545. X#include <varargs.h>
  546. X
  547. X#include "bam.h"
  548. X
  549. X
  550. Xvoid sendToEmacs(command) 
  551. X     char *command;
  552. X{
  553. X  fprintf(stdout, "%s", command);
  554. X  fflush(stdout);
  555. X}
  556. X
  557. Xvoid sendErrorToEmacs(va_alist)
  558. Xva_dcl
  559. X{
  560. X  char tmpStr[4096+1];     /* Temporary string to 
  561. X                  construct the error
  562. X                  string to send to emacs */
  563. X  va_list pvar;
  564. X  char *format;
  565. X
  566. X  va_start(pvar);
  567. X  format=va_arg(pvar, char *);
  568. X  vsprintf(tmpStr, format, pvar);
  569. X  va_end(pvar);
  570. X
  571. X  fprintf(stdout, errorFormat, tmpStr);
  572. X
  573. X  fflush(stdout);
  574. X}
  575. END_OF_FILE
  576.   if test 1328 -ne `wc -c <'bam-1.0/send.c'`; then
  577.     echo shar: \"'bam-1.0/send.c'\" unpacked with wrong size!
  578.   fi
  579.   # end of 'bam-1.0/send.c'
  580. fi
  581. echo shar: End of archive 2 \(of 2\).
  582. cp /dev/null ark2isdone
  583. MISSING=""
  584. for I in 1 2 ; do
  585.     if test ! -f ark${I}isdone ; then
  586.     MISSING="${MISSING} ${I}"
  587.     fi
  588. done
  589. if test "${MISSING}" = "" ; then
  590.     echo You have unpacked both archives.
  591.     rm -f ark[1-9]isdone
  592. else
  593.     echo You still must unpack the following archives:
  594.     echo "        " ${MISSING}
  595. fi
  596. exit 0
  597. exit 0 # Just in case...
  598.