File: version.c

package info (click to toggle)
ng 1.5~beta1-14
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,164 kB
  • sloc: ansic: 44,018; asm: 3,150; sh: 2,539; cpp: 1,234; makefile: 578
file content (622 lines) | stat: -rw-r--r-- 14,467 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
/* $Id: version.c,v 1.12.2.1 2003/03/08 01:22:35 amura Exp $ */
/*
 * This file contains the string that get written
 * out by the emacs-version command.
 */

/*
 * $Log: version.c,v $
 * Revision 1.12.2.1  2003/03/08 01:22:35  amura
 * NOTAB is always enabled
 *
 * Revision 1.12  2001/05/28 19:02:02  amura
 * edit to 1.5alpha3
 *
 * Revision 1.11  2001/03/09 16:17:22  amura
 * edit to 1.5alpha2
 *
 * Revision 1.10  2001/01/20 18:17:13  amura
 * edit to 1.5alpha1
 *
 * Revision 1.9  2001/01/05 14:07:05  amura
 * first implementation of Hojo Kanji support
 *
 * Revision 1.8  2000/11/16 14:27:00  amura
 * edit to 1.4.2 release
 *
 * Revision 1.7  2000/10/02 16:29:55  amura
 * can display some Amiga configuration
 *
 *  -- snip --
 *
 * Revision 1.1  1999/05/19  04:17:24  amura
 * Initial revision
 *
 */
/* 90.01.29	Modified for Ng 1.0 by S.Yoshida */

#include	"config.h"	/* 90.12.20  by S.Yoshida */

#ifdef	ADDFUNC	/* 90.12.28  by S.Yoshida */
#include	"def.h"
#else	/* NOT ADDFUNC */
#define TRUE	1	/* include "def.h" when things get more complicated */
#endif	/* ADDFUNC */

#define	VERSION		"1.5beta1"

#ifdef	KANJI
# define PROGNAME	"Ng"
# define FORMERLY	"[Nihongo Mg]"
#else
# define PROGNAME	"Mg++"
# define FORMERLY	"(formerly MicroGnuEmacs Adv.)"
#endif

#if defined(MSDOS)
# if defined(IBMPC)
#  ifdef TCCONIO
#   define TARGET	"for IBM PC/TCCONIO"
#  else
#   define TARGET	"for IBM PC"
#  endif
# elif defined(PC9801)
#  ifdef TCCONIO
#   define TARGET	"for PC-9801/TCCONIO"
#  else
#   define TARGET	"for PC-9801"
#  endif
# else
#  define TARGET	"for MS-DOS"
# endif
#elif defined(AMIGA)
# ifdef	V2
#  define TARGET	"for AmigaDOS 2+"
# else
#  define TARGET	"for AmigaDOS 1+"
# endif
#elif defined(WIN)
# define TARGET		"for Win32 Ver.0.5.24"
#endif

#ifdef	TARGET
char version[] = PROGNAME " " VERSION " " TARGET " " FORMERLY ;
#else
char version[] = PROGNAME " " VERSION " " FORMERLY ;
#endif

/*
 * Display the version. All this does
 * is copy the version string onto the echo line.
 */
/*ARGSUSED*/
int
showversion(f, n)
int f, n;
{
	ewprintf(version);
	return TRUE;
}

#ifdef	ADDFUNC	/* 90.12.28  by S.Yoshida */
#ifndef	NO_BACKUP
static	char *backup_msg = "\tBACKUP\t\t(Enable backup files)";
#endif
#ifdef	CURSOR_POS
static	char *cursor_pos_msg = "\tCURSOR_POS\t(Cursor locates on next CHR after POINT)";
#endif
#ifdef	C_MODE
static	char *c_mode_msg = "\tC_MODE\t\t(Enable \"c-mode\" functions)";
#endif
#ifdef	BUFFER_MODE
static	char *buffer_mode_msg = "\tBUFFER_MODE\t(Enable \"Buffer Menu\" mode)";
#endif
#ifdef	NEW_COMPLETE
static	char *complete_msg = "\tCOMPLETE\t(Enable new version completion)";
#endif
#ifndef	NO_DIR
# ifdef EXTD_DIR
static	char *dir_msg = "\tDIR\t\t(Enable buffer local directory change)";
# else
static	char *dir_msg = "\tDIR\t\t(Enable directory change functions)";
# endif
#endif
#endif	/* ADD_FUNC */
#ifndef	NO_DIRED
static	char *dired_msg = "\tDIRED\t\t(Enable \"dired\" mode functions)";
#endif
#ifndef	NO_DPROMPT
static	char *prompt_msg = "\tDPROMPT\t\t(Enable delayed prompt)";
#endif
#ifdef	FEPCTRL
static	char *fepctrl_msg = "\tFEPCTRL\t\t(Enable FEP auto control)";
#endif
#ifndef	NO_FILECOMP
static	char *filecomp_msg = "\tFILECOMP\t(Enable file name completion)";
#endif
#ifdef	FILLPREFIX
static	char *fillprefix_msg = "\tFILLPREFIX\t(Enable fill prefix function)";
#endif
#ifdef	HANKANA
static	char *hankana_msg = "\tHANKANA\t\t(Enable Hankaku KANA handling)";
#endif
#ifndef	NO_HELP
static	char *help_msg = "\tHELP\t\t(Enable help)";
#endif
#ifdef	KANJI
static	char *kanji_msg = "\tKANJI\t\t(Enable KANJI handling)";
#endif
#ifdef	KINSOKU
static	char *kinsoku_msg = "\tKINSOKU\t\t(Enable KINSOKU handling)";
#endif
#ifndef	NO_MACRO
static	char *macro_msg = "\tMACRO\t\t(Enable keyboard macros)";
#endif
#ifdef	DO_METAKEY
static	char *metakey_msg = "\tMETAKEY\t\t(Enable META key input)";
#endif
#ifdef	PREFIXREGION
static	char *prefixregion_msg = "\tPREFIXREGION\t(Enable \"prefix-region\")";
#endif
#ifdef	READONLY
static	char *readonly_msg = "\tREADONLY\t(Enable read-only buffer mode)";
#endif
#ifdef	REGEX
# ifdef  REGEX_JAPANESE
static	char *regex_msg = "\tREGEX\t\t(Enable Japanese regular expression)";
# else
static	char *regex_msg = "\tREGEX\t\t(Enable regular expression functions)";
# endif
#endif

#ifndef	NO_SHELL
static	char *shell_msg = "\tSHELL\t\t(Enable shell-command function)";
#endif
#ifndef	NO_STARTUP
static	char *startup_msg = "\tSTARTUP\t\t(Enable startup files)";
#endif
#ifdef	ADDFUNC
static	char *addfunc_msg = "\tADDFUNC\t\t(Enable misc functions)";
#endif
#ifdef	VARIABLE_TAB
static	char *vartab_msg = "\tVARIABLE_TAB\t(Enable buffer-local tabwidth)";
#endif
#ifdef	ADDOPT
static	char *addopt_msg = "\tADDOPT\t\t(Enable additional startup option)";
#endif
#ifdef	CLIPBOARD
static	char *clipboard_msg = "\tCLIPBOARD\t(Enable yank-buffer to/from clipboard)";
#endif
#ifdef  MINIBUF_EDIT
static  char *minibuf_msg = "\tMINIBUF_EDIT\t(Enable minibuffer edit)";
#endif
#ifdef  CANNA
static  char *canna_msg = "\tCANNA\t\t(Enable CANNA)";
#endif
#ifdef	NEXTLINE
static	char *nextline_msg = "\tNEXTLINE\t(Enable \"next-line-add-newlines\")";
#endif
#ifdef	UNDO
static	char *undo_msg = "\tUNDO\t\t(Enable undo)";
#endif
#ifdef	DROPFILES
static	char *dropfiles_msg = "\tDROPFILES\t(Enable Drag&Drop)";
#endif
#ifdef	HOJO_KANJI
static	char *hojokan_msg = "\tHOJO_KANJI\t(Enable Hojo KANJI handling)";
#endif

/* Dec.20,1992 Add by H.Ohkubo */
#ifdef	AMIGA
#ifndef V2
# ifdef	V11
static	char *v1_msg = "\tV11\t\t(Enable AmigaDOS Ver.1.1)";
# else
static	char *v1_msg = "\tV1\t\t(Enable AmigaDOS Ver.1.x)";
# endif
#endif
#ifdef	DO_MENU
static	char *menu_msg = "\tDO_MENU\t\t(Enable menu selection)";
#endif
#ifdef	BROWSER
static	char *browser_msg = "\tBROWSER\t\t(Enable to present a menu of file)";
#endif
#ifdef	MOUSE
static	char *mouse_msg = "\tMOUSE\t\t(Enable to use mouse)";
#endif
#ifdef	FKEYS
static	char *fkeys_msg = "\tFKEYS\t\t(Enable to use function keys)";
#endif
#ifdef	DO_ICONIFY
static	char *iconify_msg = "\tDO_ICONIFY\t(Enable iconify)";
#endif
#ifdef	CHANGE_COLOR
static	char *color_msg = "\tCOLOR\t\t(Enable to color setting)";
#endif
#ifdef	CHANGE_FONT
static	char *font_msg = "\tFONT\t\t(Enable to font setting)";
#endif
#ifdef	USE_ARP
static	char *arp_msg = "\tARP\t\t(using ARP.Library)";
#endif
#ifdef	REXX
static	char *rexx_msg = "\tREXX\t\t(Enable to use AREXX)";
#endif
#ifdef	ASL
static	char *asl_msg = "\tASL\t\t(Enable to use ASL Filerequester)";
#endif
#endif	/* AMIGA */

/*
 * Display the Ng version, compile time options.
 */
/*ARGSUSED*/
int
showngversion(f, n)
int f, n;
{
	register BUFFER	*bp;
	register WINDOW	*wp;
	char	 line[80];

	if ((bp = bfind("*" PROGNAME " Version*", TRUE)) == NULL) return FALSE;
	if (bclear(bp) != TRUE) return FALSE;
	bp->b_flag &= ~BFCHG;		/* Blow away old.	*/
#ifdef READONLY
	bp->b_flag |= BFRONLY;
#endif
	if (bclear(bp) != TRUE) return FALSE;

	strcpy(line, PROGNAME " version:");
	if (addline(bp, line) == FALSE) return FALSE;
	sprintf(line, "\t%s", version);
	if (addline(bp, line) == FALSE) return FALSE;
	strcpy(line, "Compile time options:");
	if (addline(bp, line) == FALSE) return FALSE;
#ifndef	NO_BACKUP
	strcpy(line, backup_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	CURSOR_POS
	strcpy(line, cursor_pos_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	C_MODE
	strcpy(line, c_mode_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	BUFFER_MODE
	strcpy(line, buffer_mode_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	NEW_COMPLETE
	strcpy(line, complete_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_DIR
	strcpy(line, dir_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_DIRED
	strcpy(line, dired_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_DPROMPT
	strcpy(line, prompt_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	FEPCTRL
	strcpy(line, fepctrl_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_FILECOMP
	strcpy(line, filecomp_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	FILLPREFIX
	strcpy(line, fillprefix_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	HANKANA
	strcpy(line, hankana_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_HELP
	strcpy(line, help_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	KANJI
	strcpy(line, kanji_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	KINSOKU
	strcpy(line, kinsoku_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_MACRO
	strcpy(line, macro_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	DO_METAKEY
	strcpy(line, metakey_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	PREFIXREGION
	strcpy(line, prefixregion_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	READONLY
	strcpy(line, readonly_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	REGEX
	strcpy(line, regex_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_SHELL
	strcpy(line, shell_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifndef	NO_STARTUP
	strcpy(line, startup_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	ADDFUNC
	strcpy(line, addfunc_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	VARIABLE_TAB
	strcpy(line, vartab_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	ADDOPT
	strcpy(line, addopt_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	CLIPBOARD
	strcpy(line, clipboard_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	MINIBUF_EDIT
	strcpy(line, minibuf_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	CANNA
	strcpy(line, canna_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	NEXTLINE
	strcpy(line, nextline_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	UNDO
	strcpy(line, undo_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	DROPFILES
	strcpy(line, dropfiles_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	HOJO_KANJI
	strcpy(line, hojokan_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif

#ifdef	AMIGA	/* Dec.20,1992 By H.Ohkubo */
#ifndef	V2
	strcpy(line, v1_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	DO_MENU
	strcpy(line, menu_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	BROWSER
	strcpy(line, browser_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	MOUSE
	strcpy(line, mouse_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	FKEYS
	strcpy(line, fkeys_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	DO_ICONIFY
	strcpy(line, iconify_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	CHANGE_COLOR
	strcpy(line, color_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	CHANGE_FONT
	strcpy(line, font_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	USE_ARP
	strcpy(line, arp_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	REXX
	strcpy(line, rexx_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#ifdef	ASL
	strcpy(line, asl_msg);
	if (addline(bp, line) == FALSE) return FALSE;
#endif
#endif	/* AMIGA */

	if ((wp = popbuf(bp)) == NULL)	return FALSE;
	bp->b_dotp = lforw(bp->b_linep); /* put dot at beginning of buffer */
	bp->b_doto = 0;
	wp->w_dotp = bp->b_dotp;	/* fix up if window already on screen */
	wp->w_doto = bp->b_doto;
	return TRUE;
}

/*
 * Print the Ng version to the stdout.
 */
int
printversion()
{
#ifdef	WIN32
	char	buf[ 128 ], *ptr = buf ;
	extern	void	MessageOut( const char * ) ;

	sprintf(ptr, PROGNAME " version:\n");
	ptr += strlen( ptr ) ;
	sprintf(ptr, "\t%s\n", version);
	MessageOut( buf ) ;
#else	/* WIN32 */
	printf(PROGNAME " version:\n");
	printf("\t%s\n", version);
#endif	/* WIN32 */
	return TRUE;
}

/*
 * Print the Ng compile time options.
 */
int
printoptions()
{
#ifndef	WIN32
	printf("Compile time options:\n");
#ifndef	NO_BACKUP
	printf("%s\n", backup_msg);
#endif
#ifdef	CURSOR_POS
	printf("%s\n", cursor_pos_msg);
#endif
#ifdef	C_MODE
	printf("%s\n", c_mode_msg);
#endif
#ifdef	BUFFER_MODE
	printf("%s\n", buffer_mode_msg);
#endif
#ifdef	NEW_COMPLETE
	printf("%s\n", complete_msg);
#endif
#ifndef	NO_DIR
	printf("%s\n", dir_msg);
#endif
#ifndef	NO_DIRED
	printf("%s\n", dired_msg);
#endif
#ifndef	NO_DPROMPT
	printf("%s\n", prompt_msg);
#endif
#ifdef	FEPCTRL
	printf("%s\n", fepctrl_msg);
#endif
#ifndef	NO_FILECOMP
	printf("%s\n", filecomp_msg);
#endif
#ifdef	FILLPREFIX
	printf("%s\n", fillprefix_msg);
#endif
#ifdef	HANKANA
	printf("%s\n", hankana_msg);
#endif
#ifndef	NO_HELP
	printf("%s\n", help_msg);
#endif
#ifdef	KANJI
	printf("%s\n", kanji_msg);
#endif
#ifdef	KINSOKU
	printf("%s\n", kinsoku_msg);
#endif
#ifndef	NO_MACRO
	printf("%s\n", macro_msg);
#endif
#ifdef	DO_METAKEY
	printf("%s\n", metakey_msg);
#endif
#ifdef	PREFIXREGION
	printf("%s\n", prefixregion_msg);
#endif
#ifdef	READONLY
	printf("%s\n", readonly_msg);
#endif
#ifdef	REGEX
	printf("%s\n", regex_msg);
#endif
#ifndef	NO_SHELL
	printf("%s\n", shell_msg);
#endif
#ifndef	NO_STARTUP
	printf("%s\n", startup_msg);
#endif
#ifdef	VARIABLE_TAB
	printf("%s\n", vartab_msg);
#endif
#ifdef	ADDOPT
	printf("%s\n", addopt_msg);
#endif
#ifdef	CLIPBOARD
	printf("%s\n", clipboard_msg);
#endif
#ifdef	MINIBUF_EDIT
	printf("%s\n", minibuf_msg);
#endif
#ifdef	CANNA
	printf("%s\n", canna_msg);
#endif
#ifdef	NEXTLINE
	printf("%s\n", nextline_msg);
#endif
#ifdef	UNDO
	printf("%s\n", undo_msg);
#endif
#ifdef	DROPFILES
	printf("%s\n", dropfiles_msg);
#endif
#ifdef	HOJO_KANJI
	printf("%s\n", hojokan_msg);
#endif

#ifdef	AMIGA	/* Dec.20,1992 By H.Ohkubo */
#ifndef	V2
	printf("%s\n", v1_msg);
#endif
#ifdef	DO_MENU
	printf("%s\n", menu_msg);
#endif
#ifdef	BROWSER
	printf("%s\n", browser_msg);
#endif
#ifdef	MOUSE
	printf("%s\n", mouse_msg);
#endif
#ifdef	FKEYS
	printf("%s\n", fkeys_msg);
#endif
#ifdef	DO_ICONIFY
	printf("%s\n", iconify_msg);
#endif
#ifdef	CHANGE_COLOR
	printf("%s\n", color_msg);
#endif
#ifdef	CHANGE_FONT
	printf("%s\n", font_msg);
#endif
#ifdef	USE_ARP
	printf("%s\n", arp_msg);
#endif
#ifdef	REXX
	printf("%s\n", rexx_msg);
#endif
#ifdef	ASL
	printf("%s\n", asl_msg);
#endif
#endif	/* AMIGA */
#endif	/* WIN32 */

	return TRUE;
}