1 /* $Id: version.c,v 1.12.2.1 2003/03/08 01:22:35 amura Exp $ */
2 /*
3  * This file contains the string that get written
4  * out by the emacs-version command.
5  */
6 
7 /*
8  * $Log: version.c,v $
9  * Revision 1.12.2.1  2003/03/08 01:22:35  amura
10  * NOTAB is always enabled
11  *
12  * Revision 1.12  2001/05/28 19:02:02  amura
13  * edit to 1.5alpha3
14  *
15  * Revision 1.11  2001/03/09 16:17:22  amura
16  * edit to 1.5alpha2
17  *
18  * Revision 1.10  2001/01/20 18:17:13  amura
19  * edit to 1.5alpha1
20  *
21  * Revision 1.9  2001/01/05 14:07:05  amura
22  * first implementation of Hojo Kanji support
23  *
24  * Revision 1.8  2000/11/16 14:27:00  amura
25  * edit to 1.4.2 release
26  *
27  * Revision 1.7  2000/10/02 16:29:55  amura
28  * can display some Amiga configuration
29  *
30  *  -- snip --
31  *
32  * Revision 1.1  1999/05/19  04:17:24  amura
33  * Initial revision
34  *
35  */
36 /* 90.01.29	Modified for Ng 1.0 by S.Yoshida */
37 
38 #include	"config.h"	/* 90.12.20  by S.Yoshida */
39 
40 #ifdef	ADDFUNC	/* 90.12.28  by S.Yoshida */
41 #include	"def.h"
42 #else	/* NOT ADDFUNC */
43 #define TRUE	1	/* include "def.h" when things get more complicated */
44 #endif	/* ADDFUNC */
45 
46 #define	VERSION		"1.5beta1"
47 
48 #ifdef	KANJI
49 # define PROGNAME	"Ng"
50 # define FORMERLY	"[Nihongo Mg]"
51 #else
52 # define PROGNAME	"Mg++"
53 # define FORMERLY	"(formerly MicroGnuEmacs Adv.)"
54 #endif
55 
56 #if defined(MSDOS)
57 # if defined(IBMPC)
58 #  ifdef TCCONIO
59 #   define TARGET	"for IBM PC/TCCONIO"
60 #  else
61 #   define TARGET	"for IBM PC"
62 #  endif
63 # elif defined(PC9801)
64 #  ifdef TCCONIO
65 #   define TARGET	"for PC-9801/TCCONIO"
66 #  else
67 #   define TARGET	"for PC-9801"
68 #  endif
69 # else
70 #  define TARGET	"for MS-DOS"
71 # endif
72 #elif defined(AMIGA)
73 # ifdef	V2
74 #  define TARGET	"for AmigaDOS 2+"
75 # else
76 #  define TARGET	"for AmigaDOS 1+"
77 # endif
78 #elif defined(WIN)
79 # define TARGET		"for Win32 Ver.0.5.24"
80 #endif
81 
82 #ifdef	TARGET
83 char version[] = PROGNAME " " VERSION " " TARGET " " FORMERLY ;
84 #else
85 char version[] = PROGNAME " " VERSION " " FORMERLY ;
86 #endif
87 
88 /*
89  * Display the version. All this does
90  * is copy the version string onto the echo line.
91  */
92 /*ARGSUSED*/
showversion(f,n)93 showversion(f, n)
94 int f, n;
95 {
96 	ewprintf(version);
97 	return TRUE;
98 }
99 
100 #ifdef	ADDFUNC	/* 90.12.28  by S.Yoshida */
101 #ifndef	NO_BACKUP
102 static	char *backup_msg = "\tBACKUP\t\t(Enable backup files)";
103 #endif
104 #ifdef	CURSOR_POS
105 static	char *cursor_pos_msg = "\tCURSOR_POS\t(Cursor locates on next CHR after POINT)";
106 #endif
107 #ifdef	C_MODE
108 static	char *c_mode_msg = "\tC_MODE\t\t(Enable \"c-mode\" functions)";
109 #endif
110 #ifdef	BUFFER_MODE
111 static	char *buffer_mode_msg = "\tBUFFER_MODE\t(Enable \"Buffer Menu\" mode)";
112 #endif
113 #ifdef	NEW_COMPLETE
114 static	char *complete_msg = "\tCOMPLETE\t(Enable new version completion)";
115 #endif
116 #ifndef	NO_DIR
117 # ifdef EXTD_DIR
118 static	char *dir_msg = "\tDIR\t\t(Enable buffer local directory change)";
119 # else
120 static	char *dir_msg = "\tDIR\t\t(Enable directory change functions)";
121 # endif
122 #endif
123 #endif	/* ADD_FUNC */
124 #ifndef	NO_DIRED
125 static	char *dired_msg = "\tDIRED\t\t(Enable \"dired\" mode functions)";
126 #endif
127 #ifndef	NO_DPROMPT
128 static	char *prompt_msg = "\tDPROMPT\t\t(Enable delayed prompt)";
129 #endif
130 #ifdef	FEPCTRL
131 static	char *fepctrl_msg = "\tFEPCTRL\t\t(Enable FEP auto control)";
132 #endif
133 #ifndef	NO_FILECOMP
134 static	char *filecomp_msg = "\tFILECOMP\t(Enable file name completion)";
135 #endif
136 #ifdef	FILLPREFIX
137 static	char *fillprefix_msg = "\tFILLPREFIX\t(Enable fill prefix function)";
138 #endif
139 #ifdef	HANKANA
140 static	char *hankana_msg = "\tHANKANA\t\t(Enable Hankaku KANA handling)";
141 #endif
142 #ifndef	NO_HELP
143 static	char *help_msg = "\tHELP\t\t(Enable help)";
144 #endif
145 #ifdef	KANJI
146 static	char *kanji_msg = "\tKANJI\t\t(Enable KANJI handling)";
147 #endif
148 #ifdef	KINSOKU
149 static	char *kinsoku_msg = "\tKINSOKU\t\t(Enable KINSOKU handling)";
150 #endif
151 #ifndef	NO_MACRO
152 static	char *macro_msg = "\tMACRO\t\t(Enable keyboard macros)";
153 #endif
154 #ifdef	DO_METAKEY
155 static	char *metakey_msg = "\tMETAKEY\t\t(Enable META key input)";
156 #endif
157 #ifdef	PREFIXREGION
158 static	char *prefixregion_msg = "\tPREFIXREGION\t(Enable \"prefix-region\")";
159 #endif
160 #ifdef	READONLY
161 static	char *readonly_msg = "\tREADONLY\t(Enable read-only buffer mode)";
162 #endif
163 #ifdef	REGEX
164 # ifdef  REGEX_JAPANESE
165 static	char *regex_msg = "\tREGEX\t\t(Enable Japanese regular expression)";
166 # else
167 static	char *regex_msg = "\tREGEX\t\t(Enable regular expression functions)";
168 # endif
169 #endif
170 
171 #ifndef	NO_SHELL
172 static	char *shell_msg = "\tSHELL\t\t(Enable shell-command function)";
173 #endif
174 #ifndef	NO_STARTUP
175 static	char *startup_msg = "\tSTARTUP\t\t(Enable startup files)";
176 #endif
177 #ifdef	ADDFUNC
178 static	char *addfunc_msg = "\tADDFUNC\t\t(Enable misc functions)";
179 #endif
180 #ifdef	VARIABLE_TAB
181 static	char *vartab_msg = "\tVARIABLE_TAB\t(Enable buffer-local tabwidth)";
182 #endif
183 #ifdef	ADDOPT
184 static	char *addopt_msg = "\tADDOPT\t\t(Enable additional startup option)";
185 #endif
186 #ifdef	CLIPBOARD
187 static	char *clipboard_msg = "\tCLIPBOARD\t(Enable yank-buffer to/from clipboard)";
188 #endif
189 #ifdef  MINIBUF_EDIT
190 static  char *minibuf_msg = "\tMINIBUF_EDIT\t(Enable minibuffer edit)";
191 #endif
192 #ifdef  CANNA
193 static  char *canna_msg = "\tCANNA\t\t(Enable CANNA)";
194 #endif
195 #ifdef	NEXTLINE
196 static	char *nextline_msg = "\tNEXTLINE\t(Enable \"next-line-add-newlines\")";
197 #endif
198 #ifdef	UNDO
199 static	char *undo_msg = "\tUNDO\t\t(Enable undo)";
200 #endif
201 #ifdef	DROPFILES
202 static	char *dropfiles_msg = "\tDROPFILES\t(Enable Drag&Drop)";
203 #endif
204 #ifdef	HOJO_KANJI
205 static	char *hojokan_msg = "\tHOJO_KANJI\t(Enable Hojo KANJI handling)";
206 #endif
207 
208 /* Dec.20,1992 Add by H.Ohkubo */
209 #ifdef	AMIGA
210 #ifndef V2
211 # ifdef	V11
212 static	char *v1_msg = "\tV11\t\t(Enable AmigaDOS Ver.1.1)";
213 # else
214 static	char *v1_msg = "\tV1\t\t(Enable AmigaDOS Ver.1.x)";
215 # endif
216 #endif
217 #ifdef	DO_MENU
218 static	char *menu_msg = "\tDO_MENU\t\t(Enable menu selection)";
219 #endif
220 #ifdef	BROWSER
221 static	char *browser_msg = "\tBROWSER\t\t(Enable to present a menu of file)";
222 #endif
223 #ifdef	MOUSE
224 static	char *mouse_msg = "\tMOUSE\t\t(Enable to use mouse)";
225 #endif
226 #ifdef	FKEYS
227 static	char *fkeys_msg = "\tFKEYS\t\t(Enable to use function keys)";
228 #endif
229 #ifdef	DO_ICONIFY
230 static	char *iconify_msg = "\tDO_ICONIFY\t(Enable iconify)";
231 #endif
232 #ifdef	CHANGE_COLOR
233 static	char *color_msg = "\tCOLOR\t\t(Enable to color setting)";
234 #endif
235 #ifdef	CHANGE_FONT
236 static	char *font_msg = "\tFONT\t\t(Enable to font setting)";
237 #endif
238 #ifdef	USE_ARP
239 static	char *arp_msg = "\tARP\t\t(using ARP.Library)";
240 #endif
241 #ifdef	REXX
242 static	char *rexx_msg = "\tREXX\t\t(Enable to use AREXX)";
243 #endif
244 #ifdef	ASL
245 static	char *asl_msg = "\tASL\t\t(Enable to use ASL Filerequester)";
246 #endif
247 #endif	/* AMIGA */
248 
249 /*
250  * Display the Ng version, compile time options.
251  */
252 /*ARGSUSED*/
showngversion(f,n)253 showngversion(f, n)
254 int f, n;
255 {
256 	register BUFFER	*bp;
257 	register WINDOW	*wp;
258 	char	 line[80];
259 
260 	if ((bp = bfind("*" PROGNAME " Version*", TRUE)) == NULL) return FALSE;
261 	if (bclear(bp) != TRUE) return FALSE;
262 	bp->b_flag &= ~BFCHG;		/* Blow away old.	*/
263 #ifdef READONLY
264 	bp->b_flag |= BFRONLY;
265 #endif
266 	if (bclear(bp) != TRUE) return FALSE;
267 
268 	strcpy(line, PROGNAME " version:");
269 	if (addline(bp, line) == FALSE) return FALSE;
270 	sprintf(line, "\t%s", version);
271 	if (addline(bp, line) == FALSE) return FALSE;
272 	strcpy(line, "Compile time options:");
273 	if (addline(bp, line) == FALSE) return FALSE;
274 #ifndef	NO_BACKUP
275 	strcpy(line, backup_msg);
276 	if (addline(bp, line) == FALSE) return FALSE;
277 #endif
278 #ifdef	CURSOR_POS
279 	strcpy(line, cursor_pos_msg);
280 	if (addline(bp, line) == FALSE) return FALSE;
281 #endif
282 #ifdef	C_MODE
283 	strcpy(line, c_mode_msg);
284 	if (addline(bp, line) == FALSE) return FALSE;
285 #endif
286 #ifdef	BUFFER_MODE
287 	strcpy(line, buffer_mode_msg);
288 	if (addline(bp, line) == FALSE) return FALSE;
289 #endif
290 #ifdef	NEW_COMPLETE
291 	strcpy(line, complete_msg);
292 	if (addline(bp, line) == FALSE) return FALSE;
293 #endif
294 #ifndef	NO_DIR
295 	strcpy(line, dir_msg);
296 	if (addline(bp, line) == FALSE) return FALSE;
297 #endif
298 #ifndef	NO_DIRED
299 	strcpy(line, dired_msg);
300 	if (addline(bp, line) == FALSE) return FALSE;
301 #endif
302 #ifndef	NO_DPROMPT
303 	strcpy(line, prompt_msg);
304 	if (addline(bp, line) == FALSE) return FALSE;
305 #endif
306 #ifdef	FEPCTRL
307 	strcpy(line, fepctrl_msg);
308 	if (addline(bp, line) == FALSE) return FALSE;
309 #endif
310 #ifndef	NO_FILECOMP
311 	strcpy(line, filecomp_msg);
312 	if (addline(bp, line) == FALSE) return FALSE;
313 #endif
314 #ifdef	FILLPREFIX
315 	strcpy(line, fillprefix_msg);
316 	if (addline(bp, line) == FALSE) return FALSE;
317 #endif
318 #ifdef	HANKANA
319 	strcpy(line, hankana_msg);
320 	if (addline(bp, line) == FALSE) return FALSE;
321 #endif
322 #ifndef	NO_HELP
323 	strcpy(line, help_msg);
324 	if (addline(bp, line) == FALSE) return FALSE;
325 #endif
326 #ifdef	KANJI
327 	strcpy(line, kanji_msg);
328 	if (addline(bp, line) == FALSE) return FALSE;
329 #endif
330 #ifdef	KINSOKU
331 	strcpy(line, kinsoku_msg);
332 	if (addline(bp, line) == FALSE) return FALSE;
333 #endif
334 #ifndef	NO_MACRO
335 	strcpy(line, macro_msg);
336 	if (addline(bp, line) == FALSE) return FALSE;
337 #endif
338 #ifdef	DO_METAKEY
339 	strcpy(line, metakey_msg);
340 	if (addline(bp, line) == FALSE) return FALSE;
341 #endif
342 #ifdef	PREFIXREGION
343 	strcpy(line, prefixregion_msg);
344 	if (addline(bp, line) == FALSE) return FALSE;
345 #endif
346 #ifdef	READONLY
347 	strcpy(line, readonly_msg);
348 	if (addline(bp, line) == FALSE) return FALSE;
349 #endif
350 #ifdef	REGEX
351 	strcpy(line, regex_msg);
352 	if (addline(bp, line) == FALSE) return FALSE;
353 #endif
354 #ifndef	NO_SHELL
355 	strcpy(line, shell_msg);
356 	if (addline(bp, line) == FALSE) return FALSE;
357 #endif
358 #ifndef	NO_STARTUP
359 	strcpy(line, startup_msg);
360 	if (addline(bp, line) == FALSE) return FALSE;
361 #endif
362 #ifdef	ADDFUNC
363 	strcpy(line, addfunc_msg);
364 	if (addline(bp, line) == FALSE) return FALSE;
365 #endif
366 #ifdef	VARIABLE_TAB
367 	strcpy(line, vartab_msg);
368 	if (addline(bp, line) == FALSE) return FALSE;
369 #endif
370 #ifdef	ADDOPT
371 	strcpy(line, addopt_msg);
372 	if (addline(bp, line) == FALSE) return FALSE;
373 #endif
374 #ifdef	CLIPBOARD
375 	strcpy(line, clipboard_msg);
376 	if (addline(bp, line) == FALSE) return FALSE;
377 #endif
378 #ifdef	MINIBUF_EDIT
379 	strcpy(line, minibuf_msg);
380 	if (addline(bp, line) == FALSE) return FALSE;
381 #endif
382 #ifdef	CANNA
383 	strcpy(line, canna_msg);
384 	if (addline(bp, line) == FALSE) return FALSE;
385 #endif
386 #ifdef	NEXTLINE
387 	strcpy(line, nextline_msg);
388 	if (addline(bp, line) == FALSE) return FALSE;
389 #endif
390 #ifdef	UNDO
391 	strcpy(line, undo_msg);
392 	if (addline(bp, line) == FALSE) return FALSE;
393 #endif
394 #ifdef	DROPFILES
395 	strcpy(line, dropfiles_msg);
396 	if (addline(bp, line) == FALSE) return FALSE;
397 #endif
398 #ifdef	HOJO_KANJI
399 	strcpy(line, hojokan_msg);
400 	if (addline(bp, line) == FALSE) return FALSE;
401 #endif
402 
403 #ifdef	AMIGA	/* Dec.20,1992 By H.Ohkubo */
404 #ifndef	V2
405 	strcpy(line, v1_msg);
406 	if (addline(bp, line) == FALSE) return FALSE;
407 #endif
408 #ifdef	DO_MENU
409 	strcpy(line, menu_msg);
410 	if (addline(bp, line) == FALSE) return FALSE;
411 #endif
412 #ifdef	BROWSER
413 	strcpy(line, browser_msg);
414 	if (addline(bp, line) == FALSE) return FALSE;
415 #endif
416 #ifdef	MOUSE
417 	strcpy(line, mouse_msg);
418 	if (addline(bp, line) == FALSE) return FALSE;
419 #endif
420 #ifdef	FKEYS
421 	strcpy(line, fkeys_msg);
422 	if (addline(bp, line) == FALSE) return FALSE;
423 #endif
424 #ifdef	DO_ICONIFY
425 	strcpy(line, iconify_msg);
426 	if (addline(bp, line) == FALSE) return FALSE;
427 #endif
428 #ifdef	CHANGE_COLOR
429 	strcpy(line, color_msg);
430 	if (addline(bp, line) == FALSE) return FALSE;
431 #endif
432 #ifdef	CHANGE_FONT
433 	strcpy(line, font_msg);
434 	if (addline(bp, line) == FALSE) return FALSE;
435 #endif
436 #ifdef	USE_ARP
437 	strcpy(line, arp_msg);
438 	if (addline(bp, line) == FALSE) return FALSE;
439 #endif
440 #ifdef	REXX
441 	strcpy(line, rexx_msg);
442 	if (addline(bp, line) == FALSE) return FALSE;
443 #endif
444 #ifdef	ASL
445 	strcpy(line, asl_msg);
446 	if (addline(bp, line) == FALSE) return FALSE;
447 #endif
448 #endif	/* AMIGA */
449 
450 	if ((wp = popbuf(bp)) == NULL)	return FALSE;
451 	bp->b_dotp = lforw(bp->b_linep); /* put dot at beginning of buffer */
452 	bp->b_doto = 0;
453 	wp->w_dotp = bp->b_dotp;	/* fix up if window already on screen */
454 	wp->w_doto = bp->b_doto;
455 	return TRUE;
456 }
457 
458 /*
459  * Print the Ng version to the stdout.
460  */
printversion()461 printversion()
462 {
463 #ifdef	WIN32
464 	char	buf[ 128 ], *ptr = buf ;
465 	extern	void	MessageOut( const char * ) ;
466 
467 	sprintf(ptr, PROGNAME " version:\n");
468 	ptr += strlen( ptr ) ;
469 	sprintf(ptr, "\t%s\n", version);
470 	MessageOut( buf ) ;
471 #else	/* WIN32 */
472 	printf(PROGNAME " version:\n");
473 	printf("\t%s\n", version);
474 #endif	/* WIN32 */
475 	return TRUE;
476 }
477 
478 /*
479  * Print the Ng compile time options.
480  */
printoptions()481 printoptions()
482 {
483 #ifndef	WIN32
484 	printf("Compile time options:\n");
485 #ifndef	NO_BACKUP
486 	printf("%s\n", backup_msg);
487 #endif
488 #ifdef	CURSOR_POS
489 	printf("%s\n", cursor_pos_msg);
490 #endif
491 #ifdef	C_MODE
492 	printf("%s\n", c_mode_msg);
493 #endif
494 #ifdef	BUFFER_MODE
495 	printf("%s\n", buffer_mode_msg);
496 #endif
497 #ifdef	NEW_COMPLETE
498 	printf("%s\n", complete_msg);
499 #endif
500 #ifndef	NO_DIR
501 	printf("%s\n", dir_msg);
502 #endif
503 #ifndef	NO_DIRED
504 	printf("%s\n", dired_msg);
505 #endif
506 #ifndef	NO_DPROMPT
507 	printf("%s\n", prompt_msg);
508 #endif
509 #ifdef	FEPCTRL
510 	printf("%s\n", fepctrl_msg);
511 #endif
512 #ifndef	NO_FILECOMP
513 	printf("%s\n", filecomp_msg);
514 #endif
515 #ifdef	FILLPREFIX
516 	printf("%s\n", fillprefix_msg);
517 #endif
518 #ifdef	HANKANA
519 	printf("%s\n", hankana_msg);
520 #endif
521 #ifndef	NO_HELP
522 	printf("%s\n", help_msg);
523 #endif
524 #ifdef	KANJI
525 	printf("%s\n", kanji_msg);
526 #endif
527 #ifdef	KINSOKU
528 	printf("%s\n", kinsoku_msg);
529 #endif
530 #ifndef	NO_MACRO
531 	printf("%s\n", macro_msg);
532 #endif
533 #ifdef	DO_METAKEY
534 	printf("%s\n", metakey_msg);
535 #endif
536 #ifdef	PREFIXREGION
537 	printf("%s\n", prefixregion_msg);
538 #endif
539 #ifdef	READONLY
540 	printf("%s\n", readonly_msg);
541 #endif
542 #ifdef	REGEX
543 	printf("%s\n", regex_msg);
544 #endif
545 #ifndef	NO_SHELL
546 	printf("%s\n", shell_msg);
547 #endif
548 #ifndef	NO_STARTUP
549 	printf("%s\n", startup_msg);
550 #endif
551 #ifdef	VARIABLE_TAB
552 	printf("%s\n", vartab_msg);
553 #endif
554 #ifdef	ADDOPT
555 	printf("%s\n", addopt_msg);
556 #endif
557 #ifdef	CLIPBOARD
558 	printf("%s\n", clipboard_msg);
559 #endif
560 #ifdef	MINIBUF_EDIT
561 	printf("%s\n", minibuf_msg);
562 #endif
563 #ifdef	CANNA
564 	printf("%s\n", canna_msg);
565 #endif
566 #ifdef	NEXTLINE
567 	printf("%s\n", nextline_msg);
568 #endif
569 #ifdef	UNDO
570 	printf("%s\n", undo_msg);
571 #endif
572 #ifdef	DROPFILES
573 	printf("%s\n", dropfiles_msg);
574 #endif
575 #ifdef	HOJO_KANJI
576 	printf("%s\n", hojokan_msg);
577 #endif
578 
579 #ifdef	AMIGA	/* Dec.20,1992 By H.Ohkubo */
580 #ifndef	V2
581 	printf("%s\n", v1_msg);
582 #endif
583 #ifdef	DO_MENU
584 	printf("%s\n", menu_msg);
585 #endif
586 #ifdef	BROWSER
587 	printf("%s\n", browser_msg);
588 #endif
589 #ifdef	MOUSE
590 	printf("%s\n", mouse_msg);
591 #endif
592 #ifdef	FKEYS
593 	printf("%s\n", fkeys_msg);
594 #endif
595 #ifdef	DO_ICONIFY
596 	printf("%s\n", iconify_msg);
597 #endif
598 #ifdef	CHANGE_COLOR
599 	printf("%s\n", color_msg);
600 #endif
601 #ifdef	CHANGE_FONT
602 	printf("%s\n", font_msg);
603 #endif
604 #ifdef	USE_ARP
605 	printf("%s\n", arp_msg);
606 #endif
607 #ifdef	REXX
608 	printf("%s\n", rexx_msg);
609 #endif
610 #ifdef	ASL
611 	printf("%s\n", asl_msg);
612 #endif
613 #endif	/* AMIGA */
614 #endif	/* WIN32 */
615 
616 	return TRUE;
617 }
618 
619