[Pkg-wmaker-commits] [wmcube] 53/67: Imported Upstream version 1.0.1

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Aug 25 03:22:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmcube.

commit 742e6792a0b1a296e5335278be4c87d80620449f
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Thu Feb 19 19:42:56 2015 -0600

    Imported Upstream version 1.0.1
---
 3D-objects/CONTRIBUTE    |   8 ++-
 3D-objects/X-lines.wmc   |  65 +++++++++++++++++++++++
 3D-objects/X-planes.wmc  |  68 ++++++++++++++++++++++++
 3D-objects/beryllium.wmc |  89 ++++++++++++++++++++++++++++++++
 CHANGES                  |  21 ++++++--
 INSTALL                  |  14 +++--
 README                   |  28 +++++-----
 THANKS                   |  28 ++++++++++
 wmcube/Makefile          |  15 ++++--
 wmcube/Makefile.FREEBSD  |   9 +++-
 wmcube/Makefile.LINUX    |  15 ++++--
 wmcube/Makefile.NETBSD   |   9 +++-
 wmcube/Makefile.OPENBSD  |   9 +++-
 wmcube/Makefile.SOLARIS  |   9 +++-
 wmcube/wmcube.1          |  85 ++++++++++++++++++++++++++++++
 wmcube/wmcube.c          | 132 +++++++++++++++++++++++++++--------------------
 16 files changed, 508 insertions(+), 96 deletions(-)

diff --git a/3D-objects/CONTRIBUTE b/3D-objects/CONTRIBUTE
index 1636ed2..9945ee8 100644
--- a/3D-objects/CONTRIBUTE
+++ b/3D-objects/CONTRIBUTE
@@ -29,7 +29,7 @@ Aaron Benner <benner at mcn.net>
 	- 8star.wmc
 	- 8star-small.wmc
 
-Per �kergren <akeper-8 at student.luth.se>
+Per Akergren <akeper-8 at student.luth.se>
 
 	- e.wmc
 	- e2.wmc
@@ -58,3 +58,9 @@ Cezary M. Kruk <c.kruk at bigfoot.com>
 	- slackware2.wmc
 	- slackware3.wmc
 
+Three objects recommended by Doug Torrance <dtorrance at monmouthcollege.edu>
+
+	- X-lines.wmc
+	- X-planes.wmc
+	- beryllium.wmc
+
diff --git a/3D-objects/X-lines.wmc b/3D-objects/X-lines.wmc
new file mode 100644
index 0000000..8c1600f
--- /dev/null
+++ b/3D-objects/X-lines.wmc
@@ -0,0 +1,65 @@
+WMCUBE_COORDINATES
+1	30	-30	-10
+2	10	-30	-10
+3	-3	-10	-10
+4	-20	-30	-10
+5	-30	-30	-10
+6	-8	-3	-10
+7	-30	30	-10
+8	-10	30	-10
+9	3	10	-10
+10	20	30	-10
+11	30	30	-10
+12	8	3	-10
+13      30      -30     10
+14      10      -30     10
+15      -3      -10     10
+16      -20     -30     10
+17      -30     -30     10
+18      -8      -3      10
+19      -30     30      10
+20      -10     30      10
+21      3       10      10
+22      20      30      10
+23      30      30      10
+24      8       3       10
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 1
+
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+24 13
+
+1 13
+2 14
+3 15
+4 16
+5 17
+6 18
+7 19
+8 20
+9 21
+10 22
+11 23
+12 24
diff --git a/3D-objects/X-planes.wmc b/3D-objects/X-planes.wmc
new file mode 100644
index 0000000..a4d6769
--- /dev/null
+++ b/3D-objects/X-planes.wmc
@@ -0,0 +1,68 @@
+WMCUBE_COORDINATES
+1	30	-30	-10
+2	10	-30	-10
+3	-3	-10	-10
+4	-20	-30	-10
+5	-30	-30	-10
+6	-8	-3	-10
+7	-30	30	-10
+8	-10	30	-10
+9	3	10	-10
+10	20	30	-10
+11	30	30	-10
+12	8	3	-10
+13      30      -30     10
+14      10      -30     10
+15      -3      -10     10
+16      -20     -30     10
+17      -30     -30     10
+18      -8      -3      10
+19      -30     30      10
+20      -10     30      10
+21      3       10      10
+22      20      30      10
+23      30      30      10
+24      8       3       10
+
+WMCUBE_PLANES
+1 2 7
+7 8 1
+4 5 10
+10 11 4
+
+13 20 19
+19 14 13
+23 22 17
+17 16 23
+
+1 12 24
+24 13 1
+12 11 23
+23 24 12
+
+3 2 14
+14 15 3
+4 3 15
+15 16 4
+
+7 6 18
+18 19 7
+6 5 17
+17 18 6
+
+8 20 21
+21 9 8
+9 21 22
+22 10 9
+
+1 13 14
+14 2 1
+
+4 16 17
+17 5 4
+
+10 22 23
+23 11 10
+
+7 19 20
+20 8 7
diff --git a/3D-objects/beryllium.wmc b/3D-objects/beryllium.wmc
new file mode 100644
index 0000000..b8fc499
--- /dev/null
+++ b/3D-objects/beryllium.wmc
@@ -0,0 +1,89 @@
+WMCUBE_COORDINATES
+1   200 -200  000
+2   200  200  400
+3   600 -200  400
+4   600  200  000
+5   530  130  330
+6   530 -130  070
+7   270  130  070
+8   270 -130  330 
+9     0    0    0
+10    0    0    0 
+11 -600 -200  000
+12 -600  200  400
+13 -200 -200  400
+14 -200  200  000
+15 -270  130  330
+16 -270 -130  070
+17 -530  130  070
+18 -530 -130  330
+19    0    0    0
+20    0    0    0 
+21 -200  200 -400
+22 -200  600  000
+23  200  200  000
+24  200  600 -400
+25  130  530 -070
+26  130  270 -330
+27 -130  530 -330
+28 -130  270 -070
+29    0    0    0
+30    0    0    0 
+31 -200 -600 -400
+32 -200 -200  000
+33  200 -600  000
+34  200 -200 -400
+35  130 -270 -070
+36  130 -530 -330
+37 -130 -270 -330
+38 -130 -530 -070
+
+WMCUBE_PLANES
+2 5 3
+5 4 3
+2 4 5
+6 1 3
+6 4 1
+6 3 4
+7 2 1
+7 4 2
+7 1 4
+8 1 2
+8 2 3
+8 3 1
+12 15 13
+15 14 13
+12 14 15
+16 11 13
+16 14 11
+16 13 14
+17 12 11
+17 14 12
+17 11 14
+18 11 12
+18 12 13
+18 13 11
+22 25 23
+25 24 23
+22 24 25
+26 21 23
+26 24 21
+26 23 24
+27 22 21
+27 24 22
+27 21 24
+28 21 22
+28 22 23
+28 23 21
+32 35 33
+35 34 33
+32 34 35
+36 31 33
+36 34 31
+36 33 34
+37 32 31
+37 34 32
+37 31 34
+38 31 32
+38 32 33
+38 33 31
diff --git a/CHANGES b/CHANGES
index 63d172a..855a4db 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,15 @@
-wmcube 1.0.0:
+wmcube 1.0.1 (February 19, 2015):
+	* Applied a few patches written by Doug Torrance (see: THANKS
+	  file).
+	* Updated Makefile (Makefile.LINUX) file according to the
+	  modifications by Doug Torrance.
+	* Added three new objects -- X-lines.wmc, X-planes.wmc, and
+	  beryllium.wmc -- all of them recommended by Doug Torrance.
+	* Added updated version of wmcube.1 manual page borrowed from
+	  Debian.
+	* Added THANKS file.
+
+wmcube 1.0.0 (November 26, 2014):
 	* Default color scheme changed to the gray one.
 	* Added red, green, and blue color schemes (you may combine them
 	  in order to get cyan, magenta, and yellow ones).
@@ -12,7 +23,7 @@ wmcube 1.0.0:
 	* Licence changed to GNU GPL v. 3.
 	* The program since this version is maintained by Cezary M. Kruk.
 
-wmcube 0.98:
+wmCube 0.98:
 	* Added solid flat-shading to 3d-engine.
 	* New tag in object-files (WMCUBE_PLANES) for solid objects.
 
@@ -32,17 +43,17 @@ wmCube 0.96:
 	* FreeBSD support.
 	* More bundled objects.
 	* Possibility to change object at run-time by clicking the app
-	  (Scans the specified directory for objects).
+	  (scans the specified directory for objects).
 
 wmCube 0.95:
 	* You can now design and use other objects than the default cube.
 	* SMP-support: Commandline option to choose which cpu to monitor.
 	* Commandline option to leave out "nice" processes when calculating
-	  cpu-load (Thanks Thorsten Jens).
+	  cpu-load (thanks to Thorsten Jens).
 	* Commandline option to invert the relationship between rotation-
 	  speed and cpu-load.
 	* Commandline option not to display cpu-load.
-	* Improvements in the cpu-load calculation (Thanks Jakob Borg).
+	* Improvements in the cpu-load calculation (thanks to Jakob Borg).
 
 wmCube 0.90:
 	* Initial release.
diff --git a/INSTALL b/INSTALL
index cef21b9..f5750ea 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,5 @@
 Requirements
 --------------------------------------------------------------
-
 - Linux (glibc at least 2.1) tested on various distributions
   or Solaris 8 Sparc/x86 (should work on Solaris 2.x and 7),
   or OpenBSD,
@@ -12,13 +11,22 @@ Requirements
   To be able to install the application system-wide you need
   the root access.
 
+Disclaimer
+--------------------------------------------------------------
+I tested the current version of wmcube just on Linux.  The
+Makefiles for FreeBSD, NetBDS, OpenBSD, and Solaris were
+prepared in 2000 by different contributors and I can not
+guarantee that they still work as they should.  So customizing
+them to your needs is up to you.
+
 Installation
 --------------------------------------------------------------
-1)  $ tar -zxf wmcube-1.0.0.tar.gz
+1)  $ tar -zxf wmcube-1.0.1.tar.gz
 
-2)  $ cd wmcube-1.0.0/wmcube
+2)  $ cd wmcube-1.0.1/wmcube
 
 3)  $ make                    # if you run Linux
+    or:
     $ make -f Makefile.XXX    # for XXX OS running
 
 Optional:
diff --git a/README b/README
index 44ddcf0..5757609 100644
--- a/README
+++ b/README
@@ -1,9 +1,12 @@
-wmcube 1.0.0
+wmcube 1.0.1
 ---------------------------------------------------------------
 Author: Cezary M. Kruk
         c.kruk at bigfoot.com
         http://linux-bsd-unix.strefa.pl
 
+Contributors:
+        Doug Torrance <dtorrance at monmouthcollege.edu>
+
 wmCube 0.98
 ---------------------------------------------------------------
 Author: Robert Kling
@@ -11,12 +14,12 @@ Author: Robert Kling
         http://boombox.campus.luth.se
 
 Contributors:
-        Thorsten Jens (thodi at et-inf.fho-emden.de)
-        Jakob Borg (email-adress goes here)
-        Dan Price (dp at rampant.org)
-        Brian Joseph Czapiga (rys at godsey.net)
-        Tai-hwa Liang (avatar at mmlab.cse.yzu.edu.tw)
-        Jared Smolens (jsmolens+ at andrew.cmu.edu)
+        Thorsten Jens <thodi at et-inf.fho-emden.de>
+        Jakob Borg <email-adress goes here>
+        Dan Price <dp at rampant.org>
+        Brian Joseph Czapiga <rys at godsey.net>
+        Tai-hwa Liang <avatar at mmlab.cse.yzu.edu.tw>
+        Jared Smolens <jsmolens+ at andrew.cmu.edu>
 
 Description
 ---------------------------------------------------------------
@@ -46,7 +49,7 @@ Run sample.wmc plugin from the selected directory:
 
     $ wmcube -o ~/myplugins/sample.wmc &
 
-(The default directory is set to /usr/share/wmcube).
+(The default directory is set to /usr/share/wmcube.)
 
 Mouse actions
 ---------------------------------------------------------------
@@ -67,9 +70,10 @@ Files
 ---------------------------------------------------------------
 3D-objects  3D object files (plugins)
 COPYING     GNU General Public License Version 3
-CHANGES     Description of the changes
-INSTALL     Installation instructions
-README      This file
+CHANGES     description of the changes
+INSTALL     installation instructions
+README      this file
+THANKS      my thanks to other people
 
 Bugs
 ---------------------------------------------------------------
@@ -79,6 +83,6 @@ detailed as you can.
 
 Copyright
 ---------------------------------------------------------------
-wmcube (C) 2014 by Cezary M. Kruk, Wrocław, Poland
+wmcube (C) 2014-2015 by Cezary M. Kruk, Wrocław, Poland
 wmCube (C) 2000-2001 by Robert Kling, Lulea, Sweden
 
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..d96d208
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,28 @@
+
+I would like to thank to Doug Torrance for his contribution to
+wmcube including:
+
+* a set of patches:
+
+  - 30_bts-386850_fix_smp.patch -- fixes smp support, reading
+      all the fields in /proc/stat;
+  - 40_bts-357072_long_uptime_fix.patch -- fixes execution on
+      machine with long uptime;
+  - fix_-Wunused-result_v2.patch -- fixes -Wunused-result
+      compiler warnings;
+  - fix_cppcheck_warnings.patch -- fixes warnings found by
+      cppcheck;
+  - fix_grammar.patch -- fixes grammar in error message;
+  - freebsd_sysctl.patch -- uses sysctl instead of kvm to get
+      cpu stats on kfreebsd;
+
+* a few updates in Makefile (Makefile.LINUX) file;
+
+* three new objects:
+
+  - X-lines.wmc,
+  - X-planes.wmc,
+  - beryllium.wmc;
+
+* wmcube.1 manual page.
+
diff --git a/wmcube/Makefile b/wmcube/Makefile
index f0b3d17..2a66a33 100644
--- a/wmcube/Makefile
+++ b/wmcube/Makefile
@@ -1,20 +1,23 @@
 CC = gcc
 OS = -DLINUX
 
+VERSION = 1.0.1
+
 LIBDIR = -L/usr/X11R6/lib
 LIBDIR = -L/usr/X11R6/lib
 INCDIR = -I/usr/X11R6/share/include
 
 PREFIX = /usr
 BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
 OBJDIR = $(PREFIX)/share/wmcube
 
 # Edit OSLIBS as appropriate to include OS specific libraries.
 
 OSLIBS =
 LIBS   = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
+CFLAGS = -Wall -O2
 
 OBJS =	wmcube.o \
 	../wmgeneral/wmgeneral.o \
@@ -22,10 +25,10 @@ OBJS =	wmcube.o \
 	../wmgeneral/list.o
 
 .c.o:
-	$(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+	$(CC) $(OS) $(CPPFLAGS) $(CFLAGS) $(INCDIR) -c $< -o $*.o
 
 wmcube: $(OBJS)
-	$(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+	$(CC) $(LDFLAGS) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
 
 all:: wmcube
 
@@ -41,8 +44,9 @@ install:: wmcube
 	chmod 755 $(BINDIR)/wmcube
 	chown root:root $(BINDIR)/wmcube
 	mkdir -p $(DOCDIR)
-	cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+	cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
 	cp -pr ../3D-objects $(DOCDIR)
+	cp -p wmcube.1 $(MANDIR)
 	mkdir -p $(OBJDIR)
 	cp -p ../3D-objects/* $(OBJDIR)
 	@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
 	if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
 	rm -f $(DOCDIR)/*
 	if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+	rm -f $(MANDIR)/wmcube.1
 	rm -f $(OBJDIR)/*
 	if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/Makefile.FREEBSD b/wmcube/Makefile.FREEBSD
index 9bc78bc..98c589b 100644
--- a/wmcube/Makefile.FREEBSD
+++ b/wmcube/Makefile.FREEBSD
@@ -1,13 +1,16 @@
 CC = gcc
 OS = -DFREEBSD
 
+VERSION = 1.0.1
+
 LIBDIR = -L/usr/X11R6/lib
 LIBDIR = -L/usr/X11R6/lib
 INCDIR = -I/usr/X11R6/include
 
 PREFIX = /usr
 BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
 OBJDIR = $(PREFIX)/share/wmcube
 
 # Edit OSLIBS as appropriate to include OS specific libraries.
@@ -41,8 +44,9 @@ install:: wmcube
 	chmod 755 $(BINDIR)/wmcube
 	chown root:root $(BINDIR)/wmcube
 	mkdir -p $(DOCDIR)
-	cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+	cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
 	cp -pr ../3D-objects $(DOCDIR)
+	cp -p wmcube.1 $(MANDIR)
 	mkdir -p $(OBJDIR)
 	cp -p ../3D-objects/* $(OBJDIR)
 	@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
 	if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
 	rm -f $(DOCDIR)/*
 	if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+	rm -f $(MANDIR)/wmcube.1
 	rm -f $(OBJDIR)/*
 	if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/Makefile.LINUX b/wmcube/Makefile.LINUX
index f0b3d17..2a66a33 100644
--- a/wmcube/Makefile.LINUX
+++ b/wmcube/Makefile.LINUX
@@ -1,20 +1,23 @@
 CC = gcc
 OS = -DLINUX
 
+VERSION = 1.0.1
+
 LIBDIR = -L/usr/X11R6/lib
 LIBDIR = -L/usr/X11R6/lib
 INCDIR = -I/usr/X11R6/share/include
 
 PREFIX = /usr
 BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
 OBJDIR = $(PREFIX)/share/wmcube
 
 # Edit OSLIBS as appropriate to include OS specific libraries.
 
 OSLIBS =
 LIBS   = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
+CFLAGS = -Wall -O2
 
 OBJS =	wmcube.o \
 	../wmgeneral/wmgeneral.o \
@@ -22,10 +25,10 @@ OBJS =	wmcube.o \
 	../wmgeneral/list.o
 
 .c.o:
-	$(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+	$(CC) $(OS) $(CPPFLAGS) $(CFLAGS) $(INCDIR) -c $< -o $*.o
 
 wmcube: $(OBJS)
-	$(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+	$(CC) $(LDFLAGS) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
 
 all:: wmcube
 
@@ -41,8 +44,9 @@ install:: wmcube
 	chmod 755 $(BINDIR)/wmcube
 	chown root:root $(BINDIR)/wmcube
 	mkdir -p $(DOCDIR)
-	cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+	cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
 	cp -pr ../3D-objects $(DOCDIR)
+	cp -p wmcube.1 $(MANDIR)
 	mkdir -p $(OBJDIR)
 	cp -p ../3D-objects/* $(OBJDIR)
 	@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
 	if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
 	rm -f $(DOCDIR)/*
 	if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+	rm -f $(MANDIR)/wmcube.1
 	rm -f $(OBJDIR)/*
 	if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/Makefile.NETBSD b/wmcube/Makefile.NETBSD
index 874553b..aa3a5aa 100644
--- a/wmcube/Makefile.NETBSD
+++ b/wmcube/Makefile.NETBSD
@@ -1,6 +1,8 @@
 CC = gcc
 OS = -DNETBSD
 
+VERSION = 1.0.1
+
 LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
 
 # Edit OSLIBS as appropriate to include OS specific libraries.
@@ -11,7 +13,8 @@ CFLAGS = -Wall -I/usr/X11R6/include -O2 $(OS)
 
 PREFIX = /usr
 BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
 OBJDIR = $(PREFIX)/share/wmcube
 
 OBJS =	wmcube.o \
@@ -39,8 +42,9 @@ install:: wmcube
 	chmod 755 $(BINDIR)/wmcube
 	chown root:root $(BINDIR)/wmcube
 	mkdir -p $(DOCDIR)
-	cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+	cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
 	cp -pr ../3D-objects $(DOCDIR)
+	cp -p wmcube.1 $(MANDIR)
 	mkdir -p $(OBJDIR)
 	cp -p ../3D-objects/* $(OBJDIR)
 	@echo "wmcube installation finished..."
@@ -51,5 +55,6 @@ uninstall::
 	if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
 	rm -f $(DOCDIR)/*
 	if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+	rm -f $(MANDIR)/wmcube.1
 	rm -f $(OBJDIR)/*
 	if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/Makefile.OPENBSD b/wmcube/Makefile.OPENBSD
index 7313e9b..adfd8a0 100644
--- a/wmcube/Makefile.OPENBSD
+++ b/wmcube/Makefile.OPENBSD
@@ -1,6 +1,8 @@
 CC = gcc
 OS = -DOPENBSD
 
+VERSION = 1.0.1
+
 LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
 
 # Edit OSLIBS as appropriate to include OS specific libraries.
@@ -12,7 +14,8 @@ CFLAGS = -Wall -O2 $(OS) $(INCLUDES)
 
 PREFIX = /usr
 BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
 OBJDIR = $(PREFIX)/share/wmcube
 
 OBJS =	wmcube.o \
@@ -40,8 +43,9 @@ install:: wmcube
 	chmod 755 $(BINDIR)/wmcube
 	chown root:root $(BINDIR)/wmcube
 	mkdir -p $(DOCDIR)
-	cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+	cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
 	cp -pr ../3D-objects $(DOCDIR)
+	cp -p wmcube.1 $(MANDIR)
 	mkdir -p $(OBJDIR)
 	cp -p ../3D-objects/* $(OBJDIR)
 	@echo "wmcube installation finished..."
@@ -52,5 +56,6 @@ uninstall::
 	if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
 	rm -f $(DOCDIR)/*
 	if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+	rm -f $(MANDIR)/wmcube.1
 	rm -f $(OBJDIR)/*
 	if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/Makefile.SOLARIS b/wmcube/Makefile.SOLARIS
index f0c4c14..eed97b4 100644
--- a/wmcube/Makefile.SOLARIS
+++ b/wmcube/Makefile.SOLARIS
@@ -1,13 +1,16 @@
 CC = gcc
 OS = -DSOLARIS
 
+VERSION = 1.0.1
+
 LIBDIR = -L/usr/X11R6/lib
 LIBDIR = -L/usr/openwin/lib -L/opt/sfw/lib -L/usr/local/lib -R/usr/openwin/lib -R/opt/sfw/lib -R/usr/local/lib
 INCDIR = -I/usr/openwin/include -I/opt/sfw/include -I/usr/local/include
 
 PREFIX = /usr
 BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
 OBJDIR = $(PREFIX)/share/wmcube
 
 # Edit OSLIBS as appropriate to include OS specific libraries.
@@ -41,8 +44,9 @@ install:: wmcube
 	chmod 755 $(BINDIR)/wmcube
 	chown root:root $(BINDIR)/wmcube
 	mkdir -p $(DOCDIR)
-	cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+	cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
 	cp -pr ../3D-objects $(DOCDIR)
+	cp -p wmcube.1 $(MANDIR)
 	mkdir -p $(OBJDIR)
 	cp -p ../3D-objects/* $(OBJDIR)
 	@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
 	if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
 	rm -f $(DOCDIR)/*
 	if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+	rm -f $(MANDIR)/wmcube.1
 	rm -f $(OBJDIR)/*
 	if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube.1 b/wmcube/wmcube.1
new file mode 100644
index 0000000..f69d93e
--- /dev/null
+++ b/wmcube/wmcube.1
@@ -0,0 +1,85 @@
+.\" -*- nroff -*-
+.TH WMCUBE 1 "February 19, 2015" "Version 1.0.1" "3D object CPU Load display applet"
+
+.SH NAME
+wmcube \-\- spinning 3D object that shows the current CPU load
+
+.SH SYNOPSIS
+wmcube
+[\fI\,OPTIONS\/\fR]
+
+.SH DESCRIPTION
+.I wmcube
+is a dockapp that displays a realtime rotating 3D-object which indicates
+current CPU load.  The higher the load, the faster the object spins.
+
+.SH OPTIONS
+.TP
+\fB\-o\fR <filename>
+load external 3D object (plugin).
+.TP
+\fB\-d\fR x
+rotate x degrees/step when the CPU is idle (default 1).
+.TP
+\fB\-r\fR x
+rotate 1 degree faster every x percent of the CPU usage (default 25).
+.TP
+\fB\-c\fR x
+which CPU (0, 1, 2...) to monitor (default average over all).
+.TP
+\fB\-f\fR
+use smooth font (default OFF).
+.TP
+\fB\-n\fR
+exclude "nice" processes (default OFF).
+.TP
+\fB\-b\fR
+draw the cube in a brighter color (default OFF).
+.TP
+\fB\-i\fR
+invert cube speed (default OFF).
+.TP
+\fB\-p\fR
+do not display the CPU load (default OFF).
+.TP
+\fB\-R\fR
+use red image.
+.TP
+\fB\-G\fR
+use green image.
+.TP
+\fB\-B\fR
+use blue image.
+.TP
+\fB\-h\fR
+display this help.
+
+.SH TIPS & TRICKS
+By combining together -RG, -RB, or -GB switches you get yellow, magenta, or cyan
+images.  Combining -RGB switches produces the gray image \-\- the same as without
+any swiches.
+
+.SH PROGRAM AUTHORS
+wmcube 1.0.1:
+.IP
+(C) 2014-2015 Cezary M. Kruk  <\fIc.kruk at bigfoot.com\fP>
+.IP
+(C)      2015 Doug Torrance
+.LP
+wmCube 0.98:
+.IP
+(C)      2000 Robert Kling
+
+.SH MANPAGE AUTHORS
+Evelyn Mitchell <efm at tummy.com> \-\- manpage for the Debian prepackaged version of wmcube.
+.LP
+Filip Van Raemdonck <mechanix at digibel.org> \-\- manpage for version 0.98 of wmcube.
+.LP
+Sandro Tosi <matrixhasu at gmail.com> \-\- manpage for version 0.99-pre1 of wmcube.
+.LP
+Doug Torrance <dtorrance at monmouthcollege.edu> \-\- manpage for version 1.0.0.
+.LP
+Cezary M. Kruk <c.kruk at bigfoot.com> \-\- manpage for version 1.0.1.
+
+.SH SEE ALSO
+.BR fvwm (1), wmaker (1)
diff --git a/wmcube/wmcube.c b/wmcube/wmcube.c
index 28ceb1e..516e971 100644
--- a/wmcube/wmcube.c
+++ b/wmcube/wmcube.c
@@ -2,37 +2,42 @@
 
  wmcube.c
 
- Version 1.0.0  (2014-11-26)
+ Version 1.0.1  (2015-02-19)
  Cezary M. Kruk <c.kruk at bigfoot.com>
  http://linux-bsd-unix.strefa.pl
 
+ Contributions:
+	A few patches, three new objects, and other updates by Doug Torrance
+	<dtorrance at monmouthcollege.edu> (2015-02-19)
+
  Versions 0.98  (2000-10-23)
  Robert Kling   <robkli-8 at student.luth.se>
  http://boombox.campus.luth.se/projects.php
 
  Contributions:
-	-n option patch by Thorsten Jens (thodi at et-inf.fho-emden.de) (2000-05-12)
+	-n option patch by Thorsten Jens <thodi at et-inf.fho-emden.de> (2000-05-12)
 	Various bugfixes and optimizations by Jakob Borg (2000-05-13)
-	Solaris Port by Dan Price (dp at rampant.org) (2000-07-16)
-	OpenBSD Port by Brian Joseph Czapiga (rys at godsey.net) (2000-07-19)
-	FreeBSD Port by Tai-hwa Liang (avatar at mmlab.cse.yzu.edu.tw) (2000-07-20)
+	Solaris Port by Dan Price <dp at rampant.org> (2000-07-16)
+	OpenBSD Port by Brian Joseph Czapiga <rys at godsey.net> (2000-07-19)
+	FreeBSD Port by Tai-hwa Liang <avatar at mmlab.cse.yzu.edu.tw> (2000-07-20)
 	NetBSD Port by Jared Smolens <jsmolens+ at andrew.cmu.edu> (2000-09-23)
 
  This software is licensed through the GNU General Public Licence.
 
- See http://www.BenSinclair.com/dockapp/ for more wm dock apps.
+ See http://www.BenSinclair.com/dockapp/ for more Window Maker dockapps.
 
  If you want to port wmcube to another OS the system specific code is
  sectioned the bottom of this file. See instructions there.
 
 */
 
-#define WMCUBE_VERSION "1.0.0"
-#define REV_YEAR "2014"
-#define REV_DATE "2014-11-26"
-#define WMCUBE_OLDVERSION "0.98"
-#define OLDREV_YEAR "2000"
-#define OLDREV_DATE "2000-10-23"
+#define CK_WMCUBE_VERSION "1.0.1"
+#define CK_REV_YEAR "2014-2015"
+#define CK_REV_DATE "2015-02-19"
+#define DT_REV_YEAR "2015"
+#define RK_WMCUBE_VERSION "0.98"
+#define RK_REV_YEAR "2000"
+#define RK_REV_DATE "2000-10-23"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -58,7 +63,9 @@
 #include <X11/extensions/shape.h>
 
 #ifdef FREEBSD
-#include <kvm.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <errno.h>
 #endif
 
 #include "../wmgeneral/wmgeneral.h"
@@ -143,11 +150,6 @@ int		but_stat = -1;
 
 float	lum_vector[3] = { 0, 0, 100 };  // Lightsource vector
 
-#ifdef FREEBSD
-static kvm_t            *kd;
-static struct nlist     nlst[] = { {"_cp_time"}, {0} };
-#endif
-
 	char	obj_filename[256];
 	char	*plugin = {""};
 
@@ -414,7 +416,7 @@ void startup_seq()
 	char *tmp = malloc(32);
 	int oldzoff = 3600;
 
-	sprintf(tmp,"%s",WMCUBE_VERSION);
+	sprintf(tmp,"%s",CK_WMCUBE_VERSION);
 	
 	RedrawWindow();
 	BlitString("WMCUBE",13,22);
@@ -437,6 +439,7 @@ void startup_seq()
 		usleep(9000);
 	}
 
+	free(tmp);
 	zoff = 3600;
 }	
 
@@ -904,8 +907,9 @@ void setupobj(char *filename)
 //*************************************************
 
 void print_help() {
-	printf("\nwmcube %s  (C) %s Cezary M. Kruk (%s)\n", WMCUBE_VERSION, REV_YEAR, REV_DATE);
-	printf("wmCube %s   (C) %s Robert Kling   (%s)\n\n", WMCUBE_OLDVERSION, OLDREV_YEAR, OLDREV_DATE);
+	printf("\nwmcube %s  (C) %s Cezary M. Kruk (%s)\n", CK_WMCUBE_VERSION, CK_REV_YEAR, CK_REV_DATE);
+	printf("              (C)      %s Doug Torrance\n", DT_REV_YEAR);
+	printf("wmCube %s   (C)      %s Robert Kling   (%s)\n\n", RK_WMCUBE_VERSION, RK_REV_YEAR, RK_REV_DATE);
 	
 	printf("  Usage: wmcube [-o <filename>] [-drcfnbipRGBh]\n\n");
 	
@@ -992,7 +996,8 @@ int loadobj(char *filename) {
 		exit(0);
 	}
 
-	fscanf(fp,"%s",tmp);
+	if (fscanf(fp,"%s",tmp) < 1)
+		printf("WARNING: Could not read first line of object-file (%s).\n",filename);
 	
 	if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) {
 		printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n");
@@ -1000,13 +1005,15 @@ int loadobj(char *filename) {
 		exit(0);
 	}
 
-	fscanf(fp,"%s",tmp);
+	if (fscanf(fp,"%s",tmp) < 1)
+		printf("WARNING: Could not read second line of object-file (%s).\n",filename);
 
 	while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) {		
 
 	 	matrix = (float **)realloc(matrix,(i+1)*sizeof(float *)); mem_alloc_error(matrix);
 		matrix[i] = (float *)malloc(3*sizeof(float)); mem_alloc_error(matrix[i]);
-		fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]);
+		if (fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]) < 3 )
+			printf("WARNING: Could not read coordinates in object-file (%s).\n",filename);
 		//printf("\n%d: %f %f %f",atoi(tmp), matrix[i][0],matrix[i][1],matrix[i][2]);
 
 		if (atoi(tmp) != (++i)) { 
@@ -1016,7 +1023,8 @@ int loadobj(char *filename) {
 			fclose(fp);
 			exit(0);
 		}
-		fscanf(fp,"%s",tmp);
+		if (fscanf(fp,"%s",tmp) < 1)
+			printf("WARNING: Could not read next line of object-file (%s).\n",filename);
 
 		if (feof(fp)) {
 			printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
@@ -1034,14 +1042,18 @@ int loadobj(char *filename) {
 		while (1) {
 		
 			cline = (int *)realloc(cline,(i+2)*sizeof(int)); mem_alloc_error(cline);
-			fscanf(fp,"%d %d",&cline[i],&cline[i+1]);
+			if (fscanf(fp,"%d %d",&cline[i],&cline[i+1]) < 2) {
+				if (feof(fp))
+					break;
+				else
+					printf("WARNING: Could not read line coordinates in object-file (%s).\n",filename);
+			}
 			i += 2;
 			//printf("\n%d %d",cline[i-2],cline[i-1]);
-			if (feof(fp)) break;
 		
 			if (cline[i-2] > nofcoords || cline[i-1] > nofcoords) { 
 				printf("\nError in objectfile (WMCUBE_LINES section):\n"
-					   "coordinates %d or/and %d doesnt exist\n\n",cline[i-2],cline[i-1]);
+					   "coordinates %d and/or %d don't exist\n\n",cline[i-2],cline[i-1]);
 				fclose(fp);
 				exit(0);
 			}
@@ -1054,17 +1066,20 @@ int loadobj(char *filename) {
 		while (1) {	
 			planes = (int **)realloc(planes,(i+1)*sizeof(int *)); mem_alloc_error(planes);
 			planes[i] = (int *)malloc(3*sizeof(int)); mem_alloc_error(planes[i]);
-			fscanf(fp,"%d %d %d",&planes[i][0],&planes[i][1],&planes[i][2]);
+			if (fscanf(fp,"%d %d %d",&planes[i][0],&planes[i][1],&planes[i][2]) < 3) {
+				if (feof(fp))
+					break;
+				else
+					printf("WARNING: Could not read plane coordinates in object-file (%s).\n",filename);
+			}
 			//printf("\n%d: %d %d %d",i,planes[i][0],planes[i][1],planes[i][2]);
 
 			planes[i][0]--; planes[i][1]--; planes[i][2]--;
 			//printf("\n%d: %d %d %d\n",i,planes[i][0],planes[i][1],planes[i][2]);
 			
-			if (feof(fp)) break;
-		
 			if (planes[i][0] > nofcoords || planes[i][1] > nofcoords || planes[i][2] > nofcoords) { 
 				printf("\nError in objectfile (WMCUBE_PLANES section):\n"
-				 	   "coordinates %d or/and %d or/and %d doesnt exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
+				 	   "coordinates %d and/or %d and/or %d don't exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
 				fclose(fp);
 				exit(0);
 			}
@@ -1118,6 +1133,7 @@ int init_calc_cpu()
 	int i;
 	char cpuid[6];
 	char check_cpu[6];
+	char tmp[32];
 
 	sprintf(check_cpu, "cpu%d", which_cpu);
 
@@ -1130,7 +1146,8 @@ int init_calc_cpu()
 		return 0;
 
 	for (i = -2; i < which_cpu; i++) {
-                fscanf(fp, "%s", cpuid);
+		if (fscanf(fp, "%5s %31s %31s %31s %31s %31s %31s %31s %31s", cpuid, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp) < 1)
+			fprintf(stderr, "WARNING: could not read cpuid from /proc/stat\n");
         }
 
 	if (strcmp(check_cpu,cpuid) != 0) {
@@ -1138,20 +1155,24 @@ int init_calc_cpu()
 		    "sure you have an SMP system?\n",check_cpu);
                 return -1;
         }
+	fclose(fp);
 	return (0); 
 }
 
 int calc_cpu_total() {
-	int total, used, t=0, i;
+	unsigned int total, used;
+	int t=0, i;
 	static int previous_total = 0, previous_used = 0;
 	char cpuid[6];
-	int cpu,nice,system,idle;
+	unsigned int cpu,nice,system,idle;
+	char tmp[32];
 	FILE *fp;
 	
 	fp = fopen("/proc/stat","rt");
 
 	for (i = -2; i < which_cpu; i++) {
-		fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle);
+		if (fscanf(fp,"%5s %u %u %u %u %31s %31s %31s %31s", cpuid, &cpu, &nice, &system, &idle, tmp, tmp, tmp, tmp) < 5)
+			fprintf(stderr, "WARNING: could not read statistics from /proc/stat\n");
 	}
 
 	fclose(fp);
@@ -1300,26 +1321,28 @@ int calc_cpu_total()
 }
 
 #elif defined FREEBSD
-#include <nlist.h>
-#include <fcntl.h>
-#include <sys/dkstat.h>
 
 int init_calc_cpu()
 {
+        return 0;
+}
 
-        if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
-        {
-                printf("\nError: unable to open kvm\n\n");
-                exit(0);
-        }
-        kvm_nlist(kd, nlst);
-        if (nlst[0].n_type == 0) 
-        {
-                printf("\nError: unable to get nlist\n\n");
-                exit(1);
-        }
+#define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var))
 
-        return 0;
+static void getsysctl(const char *name, void *ptr, size_t len)
+{
+	size_t nlen = len;
+
+	if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) {
+		fprintf(stderr, "sysctl(%s...) failed: %s\n", name,
+			strerror(errno));
+		exit(1);
+	}
+	if (nlen != len) {
+		fprintf(stderr, "sysctl(%s...) expected %lu, got %lu\n",
+			name, (unsigned long)len, (unsigned long)nlen);
+		exit(1);
+	}
 }
 
 int calc_cpu_total() {
@@ -1328,12 +1351,7 @@ int calc_cpu_total() {
         int cpu,nice,system,idle;
         unsigned long int cpu_time[CPUSTATES];
 
-        if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
-                != sizeof(cpu_time))
-        {
-                printf("\nError reading kvm\n\n");
-                exit(0);
-        }
+        GETSYSCTL("kern.cp_time", cpu_time);
 
         cpu = cpu_time[CP_USER];
         nice = cpu_time[CP_NICE];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcube.git



More information about the Pkg-wmaker-commits mailing list