Group :: System/Configuration/Boot and Init
RPM: welcome2l
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: Welcome2L-3.04-alt-fixes.patch
Download
Download
diff -ur Welcome2L-3.04~/Makefile Welcome2L-3.04/Makefile
--- Welcome2L-3.04~/Makefile Tue Jun 29 00:56:27 1999
+++ Welcome2L-3.04/Makefile Sat Dec 1 13:30:23 2001
@@ -1,9 +1,10 @@
SHELL=/bin/sh
CC = gcc
-CFLAGS = -Wall -O2 -fno-strength-reduce #-pedantic
+CFLAGS = $(RPM_OPT_FLAGS)
DESTDIR = /usr/local
-INSTALL_BINPATH = $(DESTDIR)/bin
-INSTALL_MANPATH = $(DESTDIR)/man
+INSTALL = install
+bindir = $(DESTDIR)/bin
+mandir = $(DESTDIR)/man
PROGNAME = Welcome2L
PROGNAME_LNK = welcome2l
VERSION = 3.04
@@ -12,16 +13,16 @@
RPM_BUILDPATH = /usr/src/redhat
#RPM_ICONNAME =
+all: $(PROGNAME) doc
$(PROGNAME): main.o ansi.o
- $(CC) $(CFLAGS) -v *.o -o $(PROGNAME)
- strip ./$(PROGNAME)
+ $(CC) $(CFLAGS) *.o -o $(PROGNAME)
install :
- /usr/bin/install -s -m 755 $(PROGNAME) $(INSTALL_BINPATH)
- /usr/bin/install -m 644 $(PROGNAME).1 $(INSTALL_MANPATH)/man1
- ln -fs $(PROGNAME) $(INSTALL_BINPATH)/$(PROGNAME_LNK)
- ln -fs $(PROGNAME).1 $(INSTALL_MANPATH)/man1/$(PROGNAME_LNK).1
+ $(INSTALL) -D -m755 $(PROGNAME) $(bindir)/$(PROGNAME)
+ $(INSTALL) -D -m644 $(PROGNAME).1 $(mandir)/man1/$(PROGNAME).1
+ ln -s $(PROGNAME) $(bindir)/$(PROGNAME_LNK)
+ ln -s $(PROGNAME).1 $(mandir)/man1/$(PROGNAME_LNK).1
uninstall :
rm -f $(INSTALL_BINPATH)/$(PROGNAME)
diff -ur Welcome2L-3.04~/ansi/welcome1.h Welcome2L-3.04/ansi/welcome1.h
--- Welcome2L-3.04~/ansi/welcome1.h Tue Jun 29 00:56:27 1999
+++ Welcome2L-3.04/ansi/welcome1.h Sun Dec 2 22:18:53 2001
@@ -160,12 +160,12 @@
' ', 0x0F, 'þ', 0x0F, 'ß', 0x07, ' ', 0x07, 'Þ', 0x7F, 'Û', 0x0F,
'Þ', 0x78, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
' ', 0x0F, ' ', 0x0F, ' ', 0x18, 'Û', 0x08, ' ', 0x08, ':', 0x08,
- ' ', 0x08, ' ', 0x08, 'W', 0x08, 'e', 0x08, 'l', 0x08, 'c', 0x08,
- 'o', 0x08, 'm', 0x08, 'e', 0x08, ' ', 0x08, 'T', 0x08, 'o', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, 'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10,
+ ' ', 0x08, ' ', 0x08, 'H', 0x0F, 'o', 0x07, 's', 0x07, 't', 0x07,
+ ' ', 0x07, ':', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, 'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x0F,
' ', 0x0F, ' ', 0x0F, 'Û', 0x78, 'Þ', 0x7F, 'Ü', 0x08, ' ', 0x08,
' ', 0x08, 'Û', 0x60, 'Ü', 0x06, 'ß', 0x67, 'Ü', 0x76, 'ß', 0x68,
@@ -173,12 +173,12 @@
'Ü', 0x06, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
'Þ', 0x7F, 'Û', 0x0F, 'Þ', 0x78, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x18, 'Û', 0x08,
- ' ', 0x08, 'ú', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, 'Û', 0x18, 'Û', 0x10,
+ ' ', 0x08, 'ú', 0x08, ' ', 0x07, ' ', 0x07, 'D', 0x0F, 'a', 0x07,
+ 't', 0x07, 'e', 0x07, ' ', 0x07, ':', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 'Û', 0x18, 'Û', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, 'Þ', 0x10, ' ', 0x0F, ' ', 0x0F, '±', 0x08, 'Ü', 0x78,
'ß', 0x7F, 'ß', 0x68, 'ß', 0x68, 'Ü', 0x6E, 'Û', 0x6E, 'ß', 0x6E,
@@ -186,12 +186,12 @@
'ß', 0x6E, 'Û', 0x0E, 'Û', 0x6E, 'Ü', 0x6E, 'Ü', 0x6E, 'ß', 0x68,
'ß', 0x68, 'Û', 0x67, 'Û', 0x0F, 'ß', 0x7F, 'ß', 0x08, ' ', 0x0F,
' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
- ' ', 0x18, 'Û', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
+ ' ', 0x18, 'Û', 0x08, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ 'L', 0x0F, 'i', 0x07, 'n', 0x07, 'e', 0x07, ' ', 0x07, ':', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, 'Þ', 0x10, ' ', 0x0F, ' ', 0x0F,
' ', 0x0F, 'ß', 0x68, 'Ü', 0x6E, 'Û', 0x6E, 'Û', 0x6E, 'Û', 0x0E,
@@ -199,13 +199,13 @@
'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E,
'Û', 0x0E, 'Û', 0x0E, 'Û', 0x6E, 'Ü', 0x6E, 'Ü', 0x6E, 'Ü', 0x6E,
'ß', 0x60, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
- ' ', 0x0F, ' ', 0x0F, ' ', 0x10, 'Û', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, 'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10,
+ ' ', 0x0F, ' ', 0x0F, ' ', 0x10, 'Û', 0x08, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, 'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, 'Þ', 0x10,
' ', 0x0F, ' ', 0x0F, 'Û', 0x06, 'ß', 0x6E, 'Û', 0x6E, 'Û', 0x6E,
'Û', 0x7E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E,
@@ -213,12 +213,12 @@
'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E, 'ß', 0x6E,
'ß', 0x6E, 'ß', 0x6E, 'Û', 0x06, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x16, 'Û', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, 'Û', 0x18, 'Û', 0x10,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 'Û', 0x18, 'Û', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, 'Þ', 0x10, ' ', 0x0F, ' ', 0x0F, 'Þ', 0x06, 'Û', 0x06,
'Û', 0x06, 'ß', 0x6E, 'Û', 0x7E, 'Û', 0x0E, 'Û', 0x0E, 'Û', 0x0E,
@@ -226,12 +226,12 @@
'Û', 0x0E, 'Û', 0x0E, 'ß', 0x6E, 'ß', 0x6E, 'Û', 0x06, 'Û', 0x06,
'Û', 0x06, 'Û', 0x06, 'Û', 0x06, 'Û', 0x06, 'Þ', 0x60, ' ', 0x0F,
' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F,
- ' ', 0x10, 'Û', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- 'K', 0x08, 'e', 0x08, 'r', 0x08, 'n', 0x08, 'e', 0x08, 'l', 0x08,
- ' ', 0x08, ':', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
+ ' ', 0x10, 'Û', 0x08, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ 'R', 0x0F, 'A', 0x07, 'M', 0x07, ' ', 0x07, ':', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, 'Þ', 0x10, ' ', 0x0F, ' ', 0x0F,
'Ü', 0x08, 'Ü', 0x67, 'Û', 0x06, 'Û', 0x06, 'Û', 0x76, 'Û', 0x66,
@@ -240,11 +240,11 @@
'Û', 0x06, 'Û', 0x06, 'Û', 0x06, 'Û', 0x06, 'Ü', 0x67, 'ß', 0x76,
'Þ', 0x78, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, 'Þ', 0x08, 'Û', 0x08,
'ß', 0x78, 'Ü', 0x08, ' ', 0x18, 'Û', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, 'C', 0x08, 'P', 0x08, 'U', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ':', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
+ ' ', 0x08, ' ', 0x08, 'C', 0x0F, 'P', 0x07, 'U', 0x07, ' ', 0x07,
+ ':', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
'ú', 0x01, ' ', 0x08, 'Û', 0x18, 'Û', 0x10, ' ', 0x10, ' ', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, 'Û', 0x01,
' ', 0x01, ' ', 0x01, 'Ý', 0x78, 'Û', 0x07, 'Û', 0x07, 'ß', 0x76,
@@ -253,12 +253,12 @@
'Û', 0x06, 'Û', 0x06, 'ß', 0x76, 'ß', 0x76, 'Û', 0x07, 'Û', 0x07,
'Û', 0x07, 'Û', 0x07, '°', 0x7F, 'Þ', 0x78, ' ', 0x0F, ' ', 0x0F,
' ', 0x0F, 'ß', 0x08, 'Ü', 0x78, '°', 0x78, ' ', 0x18, 'Û', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, 'M', 0x08, 'e', 0x08,
- 'm', 0x08, 'o', 0x08, 'r', 0x08, 'y', 0x08, ' ', 0x08, ':', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, ':', 0x08, ' ', 0x08, 'Û', 0x18, 'Û', 0x10,
+ ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, 'M', 0x0F, 'h', 0x07,
+ 'z', 0x07, ' ', 0x07, ':', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ':', 0x08, ' ', 0x08, 'Û', 0x18, 'Û', 0x10,
' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, ' ', 0x10, 'Û', 0x01,
'Û', 0x01, 'ß', 0x01, ' ', 0x01, ' ', 0x01, 'Þ', 0x07, '°', 0x7F,
'Û', 0x07, 'Û', 0x07, 'Û', 0x07, 'ß', 0x76, 'ß', 0x76, 'Û', 0x06,
diff -ur Welcome2L-3.04~/ansi/welcome2.h Welcome2L-3.04/ansi/welcome2.h
--- Welcome2L-3.04~/ansi/welcome2.h Tue Jun 29 00:56:27 1999
+++ Welcome2L-3.04/ansi/welcome2.h Sun Dec 2 23:04:10 2001
@@ -162,11 +162,11 @@
'þ', 0x08, '±', 0x01, 'Û', 0x00, 'Û', 0x0F, 'Û', 0x0F, 'Û', 0x0F,
'Þ', 0x78, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
' ', 0x07, ' ', 0x00, ' ', 0x18, 'Û', 0x08, ' ', 0x08, ':', 0x08,
- ' ', 0x08, ' ', 0x08, 'W', 0x09, 'e', 0x09, 'l', 0x09, 'c', 0x09,
- 'o', 0x09, 'm', 0x09, 'e', 0x09, ' ', 0x09, 'T', 0x09, 'o', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x00, ' ', 0x00, ' ', 0x00,
+ ' ', 0x08, ' ', 0x08, 'H', 0x0f, 'o', 0x07, 's', 0x07, 't', 0x07,
+ ' ', 0x07, ':', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x00, ' ', 0x00, ' ', 0x00,
' ', 0x0F, ' ', 0x0F, ' ', 0x0F, 'Û', 0x08, 'Û', 0x10, ' ', 0x10,
'Û', 0x00, 'Ý', 0x78, 'Ý', 0x0F, 'Ý', 0x18, '±', 0x19, '°', 0x19,
'ß', 0x1F, 'ß', 0x08, ' ', 0x07, 'Ü', 0x06, 'Ü', 0x06, 'ß', 0x07,
@@ -175,11 +175,11 @@
' ', 0x00, 'ß', 0x08, 'ß', 0x01, 'Ü', 0x0F, 'Û', 0x0F, 'Û', 0x0F,
'Û', 0x0F, 'ß', 0x0F, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x00, ' ', 0x18, 'Û', 0x08,
- ' ', 0x08, '.', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
+ ' ', 0x08, '.', 0x08, ' ', 0x08, ' ', 0x08, 'D', 0x0F, 'a', 0x07,
+ 't', 0x07, 'e', 0x07, ' ', 0x07, ':', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
' ', 0x01, ' ', 0x06, ' ', 0x06, ' ', 0x06, ' ', 0x06, 'Û', 0x08,
'Û', 0x10, ' ', 0x10, 'Û', 0x00, '²', 0x08, '±', 0x7F, 'Ü', 0x0F,
'ß', 0x01, 'Ü', 0x10, ' ', 0x07, 'ß', 0x60, 'Û', 0x06, 'Û', 0x06,
@@ -189,9 +189,9 @@
'ß', 0x0F, 'ß', 0x0F, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x00,
' ', 0x18, 'Û', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- 'L', 0x01, 'o', 0x01, 'g', 0x01, 'g', 0x01, 'i', 0x01, 'n', 0x01,
- 'g', 0x01, ' ', 0x01, 'o', 0x01, 'n', 0x01, ' ', 0x01, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x01, ' ', 0x07, ' ', 0x07,
+ 'L', 0x0F, 'i', 0x07, 'n', 0x07, 'e', 0x07, ' ', 0x07, ':', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
' ', 0x00, ' ', 0x00, ' ', 0x01, ' ', 0x01, ' ', 0x01, ' ', 0x00,
' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x06, ' ', 0x06, ' ', 0x06,
' ', 0x06, 'Û', 0x18, 'Û', 0x00, 'Û', 0x11, 'Û', 0x00, ' ', 0x07,
@@ -229,9 +229,9 @@
'Û', 0x06, 'Û', 0x66, 'Û', 0x06, 'ß', 0x06, 'Ü', 0x0F, 'ß', 0x78,
'Ý', 0x08, 'Û', 0x06, 'Þ', 0x68, ' ', 0x07, ' ', 0x07, ' ', 0x00,
' ', 0x10, 'Û', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08, ' ', 0x08,
- 'K', 0x09, 'e', 0x01, 'r', 0x01, 'n', 0x01, 'e', 0x01, 'l', 0x01,
- ' ', 0x01, ':', 0x01, ' ', 0x01, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
+ 'R', 0x0F, 'A', 0x07, 'M', 0x07, ' ', 0x07, ':', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00,
' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x06, ' ', 0x06, ' ', 0x06,
' ', 0x06, 'Ý', 0x08, '°', 0x60, 'Û', 0x16, 'Û', 0x06, 'Û', 0x06,
@@ -242,10 +242,10 @@
'Û', 0x06, 'Û', 0x06, 'Û', 0x06, 'ß', 0x06, 'Ü', 0x0F, 'ß', 0x78,
'Ü', 0x78, 'ß', 0x7F, 'Ý', 0x08, 'Û', 0x06, 'Ý', 0x08, ' ', 0x07,
' ', 0x07, ' ', 0x00, ' ', 0x18, 'Û', 0x08, ' ', 0x08, ' ', 0x08,
- ' ', 0x08, ' ', 0x08, 'C', 0x09, 'P', 0x01, 'U', 0x01, ' ', 0x01,
- ' ', 0x01, ' ', 0x01, ' ', 0x01, ':', 0x01, ' ', 0x01, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x0F,
+ ' ', 0x08, ' ', 0x08, 'C', 0x0F, 'P', 0x07, 'U', 0x07, ' ', 0x07,
+ ':', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x0F,
' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00,
' ', 0x00, ' ', 0x00, '°', 0x06, '°', 0x60, 'Û', 0x16, 'Û', 0x06,
'Û', 0x06, 'Û', 0x66, 'Û', 0x6E, 'Û', 0x6E, 'Û', 0x0E, '²', 0x6E,
@@ -255,10 +255,10 @@
'Û', 0x06, 'Û', 0x06, 'Û', 0x06, 'Ü', 0x60, 'Ü', 0x0F, 'Ü', 0x78,
'ß', 0x7F, 'ß', 0x7F, 'ß', 0x07, 'ß', 0x60, 'Û', 0x06, 'Ý', 0x08,
' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x00, ' ', 0x18, 'Û', 0x08,
- ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x08, 'M', 0x09, 'e', 0x01,
- 'm', 0x01, 'o', 0x01, 'r', 0x01, 'y', 0x01, ' ', 0x01, ':', 0x01,
- ' ', 0x01, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09,
- ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x09, ' ', 0x00, ' ', 0x00,
+ ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x08, 'M', 0x0F, 'h', 0x07,
+ 'z', 0x07, ' ', 0x07, ':', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07,
+ ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x00, ' ', 0x00,
' ', 0x00, ' ', 0x0F, ' ', 0x00, ' ', 0x00, ' ', 0x00, ' ', 0x00,
' ', 0x00, ' ', 0x00, ' ', 0x00, '°', 0x06, '°', 0x60, 'Û', 0x06,
'Û', 0x06, 'Û', 0x06, 'Û', 0x66, 'Û', 0x6E, 'Û', 0x6E, 'Û', 0x0E,
diff -ur Welcome2L-3.04~/ansi.c Welcome2L-3.04/ansi.c
--- Welcome2L-3.04~/ansi.c Tue Jun 29 00:56:27 1999
+++ Welcome2L-3.04/ansi.c Sat Dec 1 12:12:44 2001
@@ -24,7 +24,7 @@
#include <string.h>
-char WSCREEN[10000];
+char WSCREEN[16384];
static int old_bg, old_fg, old_attr;
@@ -71,7 +71,7 @@
ANSI_do_color (unsigned char col)
{
int this_bg, this_fg, this_attr;
- char buf[25];
+ char buf[128];
this_fg = ANSI_col_convert (col);
this_bg = ANSI_col_convert (col >> 4);
diff -ur Welcome2L-3.04~/main.c Welcome2L-3.04/main.c
--- Welcome2L-3.04~/main.c Tue Jun 29 00:56:27 1999
+++ Welcome2L-3.04/main.c Sun Dec 2 23:10:50 2001
@@ -18,7 +18,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -27,7 +27,9 @@
#include <sys/stat.h>
#include <locale.h>
#include <time.h>
+#include <sys/time.h>
#include <ctype.h>
+#include <argp.h>
#include "version.h"
#include "ansi.h"
@@ -42,21 +44,17 @@
#ifndef TRUE
#define TRUE (!FALSE)
#endif
-#define NOTSEEN 2
#define NODENAME uname_buf.nodename
-#define RELEASE uname_buf.release
#define MACHINE uname_buf.machine
-#define TTY ttyname(0)+5
-
static struct utsname uname_buf;
-static char MEMORY[15];
+static char *MEMORY;
static char TIME[30];
-static char WMESG[25];
-static char CPUID[15];
-static char CPU_INFO = FALSE;
+static char *WMESG;
+static char *CPUID;
+static char *Mhz;
static char want_getty_infos = FALSE;
static char THIS_SCREEN = 1;
static char last_color = FALSE;
@@ -62,9 +62,8 @@ static char WANT_NEWLINE = TRUE;
static int NEW_YEAR = FALSE;
static char XMAS_AUTO = FALSE;
static char IS_WELCOME = TRUE;
-char WSCREEN[10000];
char XMAS_SCREEN = 3;
-#define MAX_RAND_SCREEN 2.0
+#define MAX_RAND_SCREEN 2
static void
@@ -89,7 +87,7 @@
static void
draw_welcome_screen (unsigned char *screen, int screen_length, int screen_width,
- char color1, char color2, char color3,
+ char color1, char color2, char color3, char color4,
char xnode, char ynode, char xtime, char ytime,
char xtty, char ytty,
char xwmsg, char ywmsg, char xrel, char yrel,
@@ -103,7 +101,7 @@
ANSI_do_color (color1);
- ANSI_printxy (xnode, ynode, want_getty_infos == 2 ? "@S" : NODENAME);
+ ANSI_printxy (xnode, ynode, want_getty_infos ? (want_getty_infos == 1 ? "\\n" : "@S") : NODENAME);
ANSI_do_color (color2);
@@ -111,61 +109,41 @@
{
if (isatty (0))
{
- ANSI_printxy (xtty, ytty, "Login on ");
-
+ ANSI_pos(xtty, ytty);
if (want_getty_infos)
ANSI_print (want_getty_infos == 1 ? "\\l" : "@L");
else
- ANSI_print (TTY);
+ ANSI_print (ttyname(0) + 5);
}
}
- ANSI_do_color (color3);
- if (xwmsg + ywmsg)
+ ANSI_do_color (color4);
+ if ( WMESG && (xwmsg + ywmsg) )
{
ANSI_printxy (xwmsg, ywmsg, WMESG);
}
- if (want_getty_infos)
+ if (xtime + ytime)
{
- if (xtime + ytime)
- {
- ANSI_do_color (color2);
- ANSI_printxy (xtime, ytime, want_getty_infos == 1 ? "\\d - \\t" : "@D - @T");
- }
- if (xrel + yrel)
- {
- ANSI_do_color (color3);
- ANSI_printxy (xrel, yrel, want_getty_infos == 1 ? "\\r" : "@V");
- }
- if (xmach + ymach)
- {
- ANSI_do_color (color3);
- ANSI_printxy (xmach, ymach, CPU_INFO ? CPUID : (want_getty_infos == 1) ? "\\m" : MACHINE);
- }
+ ANSI_do_color (color2);
+ ANSI_printxy (xtime, ytime, want_getty_infos ? (want_getty_infos == 1 ? "\\d" : "@D") : TIME);
}
- else
+
+ if (MEMORY && (xmem + ymem))
+ ANSI_printxy (xmem, ymem, MEMORY);
+
+ if (CPUID && (xmach + ymach))
{
- if (xtime + ytime)
- {
- ANSI_do_color (color2);
- ANSI_printxy (xtime, ytime, TIME);
- }
- if (xrel + yrel)
- {
- ANSI_do_color (color3);
- ANSI_printxy (xrel, yrel, RELEASE);
- }
- if (xmach + ymach)
- {
- ANSI_do_color (color3);
- ANSI_printxy (xmach, ymach, CPU_INFO ? CPUID : MACHINE);
- }
+ ANSI_do_color (color3);
+ ANSI_printxy (xmach, ymach, CPUID);
}
- if (xmem + ymem)
- ANSI_printxy (xmem, ymem, MEMORY);
+ if (Mhz && (xrel + yrel))
+ {
+ ANSI_do_color (color3);
+ ANSI_printxy (xrel, yrel, Mhz);
+ }
}
@@ -174,41 +152,49 @@
static void
draw_this_screen (void)
{
- int last_line;
+ int last_line = 1;
switch (THIS_SCREEN)
{
default:
case 1:
{
+#if 0
char buf[80];
+#endif
draw_welcome_screen (WELCOME1, WELCOME1_LENGTH, WELCOME1_WIDTH,
- 0x08, 0x08, 0x08,
- 18, 11, 7, 12, 7, 13,
- 7, 15, 16, 16, 16, 17, 16, 18);
+ 0x07, 0x07, 0x07, 0x0b,
+ 14, 11, 14, 12, 14, 13,
+ 7, 15, 13, 18, 13, 17, 13, 16);
+#if 0
ANSI_do_color (0x19);
sprintf (buf, "%s V%s (c)LittleIgloo.Org", PROG_NAME, PROG_VERSION);
ANSI_printxy (0, last_line = 22, buf);
+#endif
}
break;
case 2:
{
+#if 0
char buf[80];
+#endif
draw_welcome_screen (WELCOME2, WELCOME2_LENGTH, WELCOME2_WIDTH,
- 0x09, 0x01, 0x09,
- 18, 11, 7, 12, 7, 13,
- 7, 15, 16, 16, 16, 17, 16, 18);
+ 0x07, 0x07, 0x07, 0x0b,
+ 14, 11, 14, 12, 14, 13,
+ 7, 15, 13, 18, 13, 17, 13, 16);
+#if 0
ANSI_do_color (0x19);
sprintf (buf, "%s %s (c)LittleIgloo.Org", PROG_NAME, PROG_VERSION);
ANSI_printxy (0, last_line = 22, buf);
+#endif
}
break;
case 3:
draw_welcome_screen (XMAS, XMAS_LENGTH, XMAS_WIDTH,
- 0x04, 0x04, 0x04,
+ 0x04, 0x04, 0x04, 0x0b,
15, 12, 0, 0, 0, 0,
0, 0, 24, 14, 22, 15, 23, 16);
ANSI_do_color (0x04);
@@ -245,162 +231,217 @@
printf (WSCREEN);
}
+/* Name and version of program. */
+static void print_version (FILE *stream, struct argp_state *state);
+void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
-
-static void
-prog_infos ()
+/* Definitions of arguments for argp functions. */
+static const struct argp_option options[] =
{
- printf ("\033[H\033[J");
- printf ("%s%s V%s By %s\n%sCopyright (c)%s %s\n%sCompiled on %s %s by %s@%s (%s)\n%s\n",
- "\033[1;33m", PROG_NAME, PROG_VERSION, PROG_AUTHOR,
- "\033[36m", VERSION_DATE, LITTLEIGLOO,
- "\033[0;36m", COMPILE_DATE, COMPILE_TIME, COMPILE_BY, COMPILE_HOST, CC_VERSION,
- "\033[0;37mDistributed under the terms of the GNU General Public License.\033[m\n");
-}
+ { NULL, 0, NULL, 0, "Output control:" },
+ { "getty", 'g', NULL, 0, "display more accurate information for mingetty" },
+ { "gettyps", 'G', NULL, 0, "display more accurate information for gettyps" },
+ { "nolf", 'n', NULL, 0, "don't add an empty line to the ANSI screen produced" },
+ { "msg", 't', "TEXT", 0, "show the TEXT given as the distribution info" },
+ { "cpu", 'c', "NAME", 0, "show the NAME given as the CPU name" },
+ { "memory", 'm', "SIZE", 0, "show the SIZE given as the memory size" },
+ { "src", 's', "XX", 0, "display screen number XX" },
+ { "random", 'r', NULL, 0, "display a random screen" },
+ { "lcol", 'l', "XX", 0, "change the prompt color to the color number XX" },
+ { "private", 'p', NULL, 0, "display an \"Unauthorized access is prohibited\" line at the bottom of the ANSI screen" },
+ { NULL, 0, NULL, 0, "Color numbers: \033[0;34m1 \033[32m2 \033[36m3 \033[31m4 \033[35m5 \033[33m6 \033[37m7 \033[1;30m8 \033[34m9 \033[32m10 \033[36m11 \033[31m12 \033[35m13 \033[33m14 \033[37m15\033[m" },
+ { NULL, 0, NULL, 0, "Example: " PROG_NAME " --getty --msg=\"ALT Linux\" --lcol=14" },
+ { NULL, 0, NULL, 0, NULL }
+};
+
+/* Short description of program. */
+static const char doc[] = "Produce a BBS like ANSI login logo.";
+
+/* Strings for arguments in help texts. */
+static const char args_doc[] = "";
+/* Prototype for option handler. */
+static error_t parse_opt (int key, char *arg, struct argp_state *state);
+/* Function to print some extra text in the help message. */
+static char *more_help (int key, const char *text, void *input);
-static void
-help_usage (void)
+/* Data structure to communicate with argp functions. */
+static struct argp argp =
{
- prog_infos ();
- printf ("ERROR: Unrecognized Argument.\nType : %s -help for usage information.\n\n", PROG_NAME);
- exit (1);
-}
+ options, parse_opt, args_doc, doc, NULL, more_help
+};
+/* Handle program arguments. */
+static error_t
+parse_opt (int key, char *arg, struct argp_state *state)
+{
+ switch (key)
+ {
+ case 'g':
+ want_getty_infos = 1;
+ break;
+ case 'G':
+ want_getty_infos = 2;
+ break;
+ case 'n':
+ WANT_NEWLINE = FALSE;
+ break;
+ case 't':
+ WMESG = arg;
+ break;
+ case 'c':
+ CPUID = arg;
+ break;
+ case 'm':
+ MEMORY = arg;
+ break;
+ case 's':
+ THIS_SCREEN = atoi (arg);
+ if (THIS_SCREEN < 1 || THIS_SCREEN > MAX_RAND_SCREEN)
+ THIS_SCREEN = 1;
+ break;
+ case 'r':
+ {
+ struct timeval tv;
+ gettimeofday (&tv, 0);
+ srandom (getpid() + tv.tv_usec);
+ THIS_SCREEN = 1 + ((double)MAX_RAND_SCREEN * random())/RAND_MAX;
+ break;
+ }
+ case 'x':
+ THIS_SCREEN = 3;
+ break;
+ case 'X':
+ XMAS_AUTO = TRUE;
+ break;
+ case 'l':
+ last_color = atoi (arg);
+ if ((last_color < 1) || (last_color > 15))
+ last_color = 15;
+ break;
+ case 'p':
+ IS_WELCOME = FALSE;
+ break;
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+ return 0;
+}
-static void
-print_option (char *this_option, char *this_option_arg, char *this_message)
+static char *
+more_help (int key, const char *text, void *input)
{
- printf ("\033[0;36m \033[1m-%s\033[1;37m%s\033[0;36m : %s\n",
- this_option, this_option_arg, this_message);
+ switch (key)
+ {
+ case ARGP_KEY_HELP_EXTRA:
+ /* We print some extra information. */
+ return strdup ("Report bugs to http://bugs.altlinux.ru/\n" );
+ default:
+ break;
+ }
+ return (char *) text;
}
+/* Print the version information. */
static void
-usage (void)
+print_version (FILE *stream, struct argp_state *state)
{
- prog_infos ();
- printf ("\033[1;36m");
-
- printf ("OPTIONS:\n\033[0;36m");
- print_option ("scr", "xx", "Display the screen number xx");
- print_option ("msg", "\"text of message\"", "Show the msg given as the distribution info");
- print_option ("getty", "", "Display more accurate information when launched at boot time\n (via an init script).");
- print_option ("nolf", "", "Do not add an empty line to the ansi screen produced.");
- print_option ("lcol", "xx", "Change the prompt color to the color number xx");
-
-
- printf ("\033[0;37m COLOR NUMBERS ARE: %s\n", "\033[0;34m1 \033[32m2 \033[36m3 \033[31m4 \033[35m5 \033[33m6 \033[37m7 \033[1;30m8 \033[34m9 \033[32m10 \033[36m11 \033[31m12 \033[35m13 \033[33m14 \033[37m15");
- print_option ("cpu", "\"string\"", "Specifies an alternate CPU description");
- print_option ("private", "", "Add an \"Unauthorized access is PROHIBITED\" line");
- printf ("\n\033[1;36mEXAMPLE:\n\033[0;36m");
- printf (" ./Welcome2L -getty -msg\"RedHat Linux\" -lcol14");
-
+ fprintf (stream, "%s V%s By %s\nCopyright (c)%s %s\nCompiled on %s by %s@%s (%s)\n%s\n",
+ PROG_NAME, PROG_VERSION, PROG_AUTHOR,
+ VERSION_DATE, LITTLEIGLOO,
+ COMPILE_DATE, COMPILE_BY, COMPILE_HOST, CC_VERSION,
+ "Distributed under the terms of the GNU General Public License.");
+}
- printf ("\033[m\n\n");
- exit (0);
+static int
+get_ram(void)
+{
+ struct stat stb;
+ if ( stat ("/proc/kcore", &stb) < 0)
+ return 0;
+ else
+ return ((stb.st_size >> 10) + 1023) >> 10;
}
+static char *
+get_cpu(void)
+{
+ char *cpu = 0;
+ FILE *fp = fopen ("/proc/cpuinfo", "r");
+ if (fp)
+ {
+ const char prefix[] = "model name";
+ char line[4096];
+ while (fgets(line, sizeof(line), fp))
+ {
+ if (!strncmp (line, prefix, sizeof(prefix) - 1))
+ {
+ const char *p = strchr (line + sizeof(prefix) - 1, ':');
+ if (p)
+ {
+ for (++p; *p; ++p)
+ if (!isspace(*p))
+ break;
+ cpu = strdup (p);
+ break;
+ }
+ }
+ }
+ fclose (fp);
+ }
+ return cpu;
+}
+static int
+get_mhz(void)
+{
+ int mhz = 0;
+ FILE *fp = fopen ("/proc/cpuinfo", "r");
+ if (fp)
+ {
+ const char prefix[] = "cpu MHz";
+ char line[4096];
+ while (fgets(line, sizeof(line), fp))
+ {
+ if (!strncmp (line, prefix, sizeof(prefix) - 1))
+ {
+ const char *p = strchr (line + sizeof(prefix) - 1, ':');
+ if (p)
+ {
+ for (++p; *p; ++p)
+ if (!isspace(*p))
+ break;
+ mhz = atoi (p);
+ break;
+ }
+ }
+ }
+ fclose (fp);
+ }
+ return mhz;
+}
int
main (int argc, char *argv[])
{
- struct stat stat_buf;
time_t timep;
struct tm *timeptr;
- char SEE_ARG = FALSE;
-
- WMESG[0] = 0;
-
- if (argc > 1)
- SEE_ARG = NOTSEEN;
- while (argc--)
- {
- if (strstr (argv[argc], "-help"))
- usage ();
-
- if (strstr (argv[argc], "-msg"))
- {
- strncpy (WMESG, argv[argc] + 4, sizeof (WMESG));
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-lcol"))
- {
- last_color = atoi (argv[argc] + 5);
- if (last_color > 15)
- last_color = 15;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-nolf"))
- {
- WANT_NEWLINE = FALSE;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-getty"))
- {
- want_getty_infos = 1;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-gettps"))
- {
- want_getty_infos = 2;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-scr"))
- {
- char *ptr = (char *) argv[argc] + 4;
- srand (time (0));
- THIS_SCREEN = isdigit (*ptr) ? atoi (ptr) : (1 + (int) (MAX_RAND_SCREEN * rand () / (RAND_MAX + 1.0)));
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-xmasauto"))
- {
- XMAS_AUTO = TRUE;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-xmas") && !XMAS_AUTO)
- {
- printf ("here\n");
- THIS_SCREEN = 3;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-cpu"))
- {
- strncpy (CPUID, argv[argc] + 4, sizeof (CPUID));
- CPU_INFO = TRUE;
- SEE_ARG = TRUE;
- }
-
- if (strstr (argv[argc], "-private"))
- {
- IS_WELCOME = FALSE;
- SEE_ARG = TRUE;
- }
-
- }
- if (SEE_ARG == NOTSEEN)
- help_usage ();
+ int remaining = 0;
+ printf ("\033[m");
+ /* Parse and process arguments. */
+ argp_parse (&argp, argc, argv, 0, &remaining, NULL);
+#if 0
setlocale (LC_ALL, "");
+#endif
uname (&uname_buf);
- if (strlen (NODENAME) > 15)
- *(strchr (NODENAME, '.')) = 0;
-
timep = time (NULL);
timeptr = localtime (&timep);
- strftime (TIME, sizeof (TIME), "%a %d %b %Y - %X", timeptr);
+ strftime (TIME, sizeof (TIME), "%a %d %b %Y", timeptr);
@@ -411,8 +452,17 @@
THIS_SCREEN = 3; /* Ross Younger's patch (revised) - no Xmas decorations outside of Jan/Dec. (enable it with -xmasauto) */
- stat ("/proc/kcore", &stat_buf);
- sprintf (MEMORY, "%ld Kb", stat_buf.st_size / 1024);
+ if ( !MEMORY )
+ asprintf (&MEMORY, "%d Mb", get_ram());
+
+ if ( !CPUID )
+ CPUID = get_cpu();
+
+ if ( !CPUID )
+ CPUID = MACHINE;
+
+ if ( !Mhz )
+ asprintf (&Mhz, "%d", get_mhz());
draw_this_screen ();