UNIX and Database Resources on the Internet
Want hands-on experience with such heavy-duty items as operating systems and database managers? The Internet supplies all the source code you could wish for.
This month I share some ftp and web sites where you can find UNIX and database resources on the Internet. If a site doesnt have exactly what youre looking for, it probably has a link to one that does. Happy surfing!
Web pages that document a library or tool and include hot links to its C/C++ source code
Detailed documentation concerning an important API or protocol
Web pages that organize, categorize, or rank the best freeware and shareware libraries and tools for use with C/C++
Focus on UNIX
In the preface to The UNIX Programming Environment (1984), Kernighan and Pike provide a brief history of UNIX and C. They recount that Ritchie and Thompson rewrote the existing UNIX kernel with C in 1973, breaking the tradition that all major OSs were written in assembly language. Kernighan and Pike explain the success of UNIX at the time as follows:
"We can discern several reasons. First, because it is written in C, it is portable UNIX systems run on a range of computers from microprocessors to the largest mainframes. Second, the source code is available and written in a high-level language... Finally, and most important, it is a good operating system, especially for programmers"Now, more than twelve years since their analysis, these reasons still hold true and perhaps even more true today. Thanks to the efforts of the developers of GNU, Linux, and FreeBSD, the source code for UNIX-derived operating systems is in fact freely available and not just limited to a mere handful of licensees.
GNU
The GNU project has been the primary project of the Free Software Foundation (FSF) since its founding in 1984. GNU, a recursive acronymn which stands for "GNUs Not UNIX," focuses primarily on providing enhanced versions of UNIX-compatible programs and libraries. All GNU programs include complete C/C++ source and a special license for redistribution of it. The hallmark of GNU software is its portability, with most packages supporting ten or more different CPUs or OSs. The cornerstone of the GNU project is the GNU C/C++ compiler and library (better known as g++ and libg++). The entire list of GNU freeware would fill several installments of this column. Ill simply list ten of the most interesting (to me) packages and the pointers to get you started:
- Apache: web server (HTTP daemon)
- BASH: UNIX super-shell hybrid of Bourne and Korn shells
- GAS: GNU Assembler supports many different CPUs
- BISON: more robust and powerful YACC clone
- Chess: a chess program you can play against (graphics optional)
- Common LISP: compatible with ANSI LISP
- HURD: a UNIX MACH-based kernel in early stages of development
- DJGPP: a 32-bit C/C++ compiler and MS-DOS extender
- EMACS: perhaps the most flexible text editor invented yet
- g77: FORTRAN 77, now in beta testing
http://www.gnu.ai.mit.edu/software/software.htm
ftp://prep.ai.mit.edu/pub/gnu/GNUinfoLinux
Linux is a freely-distributable implementation of UNIX for Intel, Motorola 68K, DEC Alpha, and Motorola PowerPC machines. It supports a wide range of software, including X Windows, Emacs, TCP/IP networking (including Ethernet and PPP), and much more. Linux was originally written by Linus Torvalds (Helsinki, Finland). In the three years since, Linux has become one of the most popular free UNIX systems available, and is continually being developed by Linus and teams of people all around the world. Ports for many other CPUs are in progress, including SUN Sparc and MIPS chips.
The Linux kernel is covered by the GNU Public License (GPL), and is usually bundled with various binaries that comprise a working UNIX operating system. One of the most confusing things about Linux for the novice is choosing which among the various pre-bundled available "distributions" to install. To make Linux practical to use, distributors always bundle it with many GNU utilities (see previous section). Heres the best place to start:
http://www.linux.org
FreeBSD
FreeBSD is an advanced BSD UNIX operating system for PCs with excellent support for TCP/IP networking, advanced technical features, and the ability to run a wide variety of applications. It also offers easy installation, and of course, full source code availability. FreeBSD can run on Intel compatible CPUs with just 4MB RAM and 60MB disk space available. TCP/IP support includes Network File Systems (NFS), Network Information Service (NIS), DNS, BIND, remote login (rlogin), FTP server, packet routing including PPP/SLIP, and IP Multicast. Some of the heaviest trafficked sites on the Internet are built using FreeBSD and the GNU Apache web server. FreeBSD compatibility modules allow you to run programs designed for Linux, SCO UNIX, NetBSD, and BSDI UNIX.
http://www.freebsd.org
ftp://ftp.freebsd.org/pub/FreeBSD
Focus on Databases
We live in an era where the organization and retrieval of information can be the most critical part of doing business. Relational databases have emerged in the 1990s as the best choice for nearly all applications of information organization and retrieval. In this focus segment, Ill highlight some of the freeware DBMSs that feature C/C++ interfaces.
The Beagle Freeware Database home page, maintained by software author Robert Klein <robk@pulse-sys.com> organizes source code, documentation, and support for this new relational DBMS. Beagles features are accessible primarily through its C-callable API. Currently, Beagle supports a wide variety of UNIX platforms including: Linux 1.2.13, SCO Openserver, FreeBSD 2.1R, SGI IRIX v5.3, Solaris v2.x, and HP/UX. Porting projects are underway for Windows 95, NT, and other platforms. A support mailing list is available too. For code and docs, see:
http://tiny.iapnet.com/rob/beagle.html
MetalBase, by Richid Jernigan (Norris, TN), is a small but complete relational database. It has all the pieces a relational database should have: C interface, Curses interface for forms, report writer, and more. MetalBase uses AVL-trees for efficient data access. It has been ported to a wide variety of platforms, including Linux, MS-DOS, Amiga, NeXT, Coherent, Macintosh MPW, SGI, and Xenix. MetalBase does not take advantage of shared memory. None of the interfaces are standard, but all of them are easy to use. Join the discussion mailing list at mbase-request@internode.com.au. For code, download:
ftp://ftp.uu.net/systems/unix/linux/sources/usr.bin/mbase.tar.z
The Lqtext text retrieval package, by Liam R.E. Quinn <lee@sq.com>, can answer simple queries about what files contain a particular word or phrase of interest. Lqtext has been designed to be reasonably fast: it uses an inverted index with hashing (a simple kind of database). This type of index requires about 30 to 50% as much space as the original data (which you still need to keep). Lqtext requires dbm (Berkeley db or sdbm) to store its indexes. A discussion list is available at lq-text-beta-request@sq.com. Lqtext supports most versions of UNIX (except SCO). Permission required for commercial use.
ftp://relay.cs.toronto.edu/pub/lq-text1.13.tar.Z
The Free Database List, maintained by David Muir Sharnoff <muir@idiom.com>, is an attempt to enumerate all known free databases. Sharnoff defines free databases as those for which source code is available and for which no payment is required to use. The Free Database List provides a simple query-based interface through which you can enter keyword searches. For example, a quick search on "PERL" yielded 15 database listings.
p://www.physics.swin.oz.au:70/info/freeDB/
If you cant find what you want via the query mechanism, you can browse the entire list:
ftp://ftp.idiom.com/pub/free-databases
C/C++ MAILBAG
If you would like to share some of your favorite C/C++ sources, please e-mail me at sysop@HAL9K.com. Heres a sampling of queries which have come to me recently via e-mail.
Mike Kreikemeier <cirrus@avicom.net> writes:
Nice Net-Site. What a life saver!!!!
Im looking for libraries that can facilitate the development of a piece of software that will display data in a graphical representation. The functions would automatically scale the X-Y graph to the data range and hopefully generate a moveable cursor that displays data values at each point as the cursor moves across the graph. Are there functions on the CUG CD-ROM? If not where would you suggest I look?
C/C++ Answer Man:
Your best bet is to see if GNUPlot will fit your needs:
http://www.cs.dartmouth.edu/gnuplot_info.html
wilsond@engg.dnet.dupont.com <DAVID R WILSON> writes:
I am an old fashioned FORTRAN programmer who is in the process of inheriting a client/server program written in C++ (Borland Version 4.5.3). A few calls are also made using SQL to Sybase.
My questions include:
- What would be the best way for a FORTRAN programmer to learn C++?
- Is there a side-by-side comparison (maybe on the Internet somewhere?) between the languages such as:
Fortran C++ CHARACTER*10 VALUE ????? REAL VALUE1 ????? IF (I .EQ. 1) THEN ... ????? DO 20 I=1, 10 etc. ?????C/C++ Answer Man:
You're not going to like it... but I recommend first learning at least the basics of C. There are several books which can give you a fair start:
C for Fortran Programmers by T.D. Brown (1990); Paperback; $22.95, ISBN 0929306015
C for Pascal and Fortran Programmers by Gerald J. Lemay (1993); Paperback; $15.00, ISBN 1883496004
From Fortran to C by James F. Kerrigan (1991); Paperback; $24.95 ISBN 0830676619
All of these are available at Amazon Bookstore (http://www.amazon.com)
I have not seen the sort of line-item comparison youre hoping for. I suggest you take your question first to the comp.lang.fortran newsgroup (where youll probably find the most people who know both languages) or to comp.lang.c++
John A. Wasser <wasser@ranger.ENET.dec.com> writes:
I tend to use the AltaVista "Advanced" query page. If I were looking for "C++ library source code" I would try a query like:
C near library near (sources or "source code")The term "near" means "within eight words of." The "or" is inclusive. With that query I got about 2,000 hits rather than 14 or 1,000,000.
C/C++ Answer Man:
As you point out, many search engines can be improved through the use of advanced query options such as the proximity ("near") search. I have verified your results and found yet another set of interesting links which youll hear about in an upcoming issue. Meanwhile, other readers are invited to send their favorite search engine tips and tweaks to me <sysop@HAL9K.com>.
Fred J. Tydeman <tydeman@tybor.com> writes:
In your November 1996 CUJ column, you mentioned that no SNOBOL compilers could be found. I believe that Ralph Griswald (who I believe was one of the authors of the green book on SNOBOL4) made the language ICON after SNOBOL4. I believe he is at the University of Arizona and that the ICON project is still alive. You might send e-mail to icon-project@cs.arizona.edu and ask about SNOBOL4.
For those who remember, care about, or still use the SNOBOL4 programming language, a mail listserver has been established. To join the list, send a mail message to listserv@mercury.dsu.edu with the line "subscribe SNOBOL4 Your Name" as the message body. "Your Name" should be your real name (your e-mail address will be used automatically for the subscription).
Submissions to the list may be sent to SNOBOL4@mercury.dsu.edu.
To be removed from the list, send the message "unsubscribe SNOBOL4" to listserv@mercury.dsu.edu
More information about ICON is available at:
web: http://www.cs.arizona.edu/icon/www/
ftp: ftp.cs.arizona.edu (cd /icon)
e-mail: ftpmail@cs.arizona.edu
Send a message consisting of the word "help".
C/C++ Answer Man:
Ill share your detailed information with the other readers. In fact, I dimly recall ICON being named as the successor to SNOBOL4. I encourage anyone with an interest in pattern matching and string manipulation to give it a look. o
Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to the C/C++ Users Journal since 1987. He is the author of the book Windows Programming with Shareware Tools. He can be reached at the HAL 9000 BBS (313)663-4173, URL http://www.HAL9K.com/home.htm, or email to sysop@hal9k.com.