People are talking about Genitor...
Visit Genitor Corporation Online Now!

C/C++ Sources

By Victor R. Volkman
May 1996 (No. 3)

AUTHOR BACKGROUND

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 recently wrote the book "Windows Programming with Shareware Tools". He can be reached at the HAL 9000 BBS (313)663-4173, on the web at http://www.hal9k.com, or email to sysop@hal9k.com.

INTRODUCTION

In the first half of this installment, I'll focus on some new and interesting programs and libraries with C/C++ source that are available by FTP. Next, I'll turn to the focus of this issue -- Client/Server. Since Client/Server issues include a whole lot more than just source code, I've also supplied pointers to Usenet newsgroups and management information. First, a word on the Universal Resource Langauge (URL) conventions.

I'll be presenting sources in URL format wherever possible. An URL can be pasted directly into your Mosaic, Netscape, or other web browser. An "http://" URL designates WWW and a "ftp://" is of course FTP file transfer. To access an FTP URL from a Unix shell prompt, simply strip off the "://". For example,

        ftp://abc.def.com/pub/user/myfile.zip
becomes the equivalent:
        ftp abc.def.com
        cd /pub/user
        get myfile.zip

POINTER TO "A POINTER TUTORIAL"

PTRTUT v0.1, by Ted Jensen , is a text tutorial on pointers and arrays as they are used in the C programming language. It is aimed at newcomers to C who often have problems in understanding pointers. It includes material on structures, strings, multi-dimensional arrays, dynamic memory allocation of any of these, and function pointers. PTRTUT contains tested source code as examples. Everything in the text and examples comply with ANSI standard C. It is available on the SimTel server and its mirrors (see Fig. 1):

ftp://ftp.coast.net/SimTel/msdos/c/ptrtut01.zip

Available on C/C++ Users Group CD-ROM

READ THE WEB OFFLINE WITH "NULLSOCK"

Netscape, Mosaic, and other web browsers are great for reading hypertext documents. However, they require that you maintain a continuous Internet connection -- even when you're reading documents local to your hard drive. If you have dial-up Internet connection, its both expensive and time consuming to dial-up just to read a document you already have. NULLSOCK, by Jean-Michel Mercier <100101.1152@CompuServe.COM> includes C source code for a program that can fool any WINSOCK.DLL driver into thinking that an Internet connection is in place. The source code is written for use with Borland Turbo C. Though NULLSOCK doesn't include the WINSOCK.DLL driver itself, it does supply instructions on how to get one if you don't already have one. NULLSOCK is available on the SimTel server and its mirrors:

ftp://ftp.coast.net/SimTel/win3/winsock/nulsck10.zip

Available on C/C++ Users Group CD-ROM

PASSWORD.SYS GIVES BOOT-UP PROTECTION

PASSWORD.SYS, by Joe Gruessing , is a freeware program providing boot-up password protection for PCs. PASSWORD.SYS is loaded as a device driver in CONFIG.SYS and requires the user to enter the correct password to continue the boot process. Failure to enter the correct password after a predefined number of tries results in a cold reboot. A timeout counter requires entering the password in a given time period or else the system will be rebooted. PASSWORD.SYS is designed to work in conjunction with the multiple config capabilities of MSDOS 6.xx, or DataLight ROM-DOS 6.22. Passwords are not case-sensitive in this program. The source code is provided for use with Borland C and Turbo Assembler, though other environments might work too. PASSWORD.SYS is available on the SimTel server and its mirrors:

ftp://ftp.coast.net/SimTel/msdos/security/passw203.zip {CODE}

MILLISECOND RESOLUTION TIMER FOR PC

PCTIMER v1.3, by Chih-Hao Tsai is a freeware library of millisecond resolution timing routines written in C. As you may recall, the IBM PC architecture specifies a built-in timer which "ticks" 18.2 times/second which implies a resolution of 1/18.2 = 55 milliseconds. PCTIMER can be used in programs requiring where millisecond (or higher) resolution timing. PCTIMER provides two different timing routines. One is based on System Timer Interrupt IRQ0 (int 8h), and another is based on CMOS Real Time Clock Interrupt IRQ8 (int 70h). These two timing routines are completely different, but both are good for millisecond resolution timing.

PCTIMER supports both the DJGPP (D.J. Delorie's GNU G++ system) and Borland Turbo C. (Send email to djgpp-request@sun.soe.clarkson.edu for information on how to get DJGPP.) Former versions supported Microsoft C, but Chih-Hao Tsai no longer test for MSC compatability. PCTIMER remains portable since it is written entirely in C and uses no assembly language.

Although PCTIMER alters the parameters of the Intel 8254 Programmable Interrupt TImer, it remains stable by emulating the regular 18.2 times/second interrupt service routines. Additionally, the IRQ0 model timer can provide less (1/100th sec) or more (1/10,000th sec) resolution depending on your requirements. PCTIMER is available on the SimTel server and its mirrors:

http://oak.oakland.edu/pub/simtelnet/msdos/c/pctime14.zip

CFGOPTS READS AND WRITES .INI FILES

CFGOPTS, by Jeffry J. Brickley, provides a small library with C source for reading and writing .INI files. MS Windows has popularized the ".INI" file for configuration information. The structure of an .INI file is deceptively simple: sections are delimited by square backets (e.g. "

Ports

") and each section contains one or more tokens delimited with "=" (e.g. "COM1=IRQ4").

Although MS Windows provides the poorly named GetPrivateProfileString() API to read these files, that doesn't help MS-DOS drivers or installation programs that have to read or write these same files. Furthermore, if a program has a Unix implementation then you also have a use for these functions. Last, it should be noted that CFGOPTS provides automatic data conversion from various radix types (Hex, decimal, octal, etc.) as well. CFGOPT is available on the SimTel server and its mirrors:

ftp://ftp.coast.net/SimTel/msdos/c/cfgop110.zip

FOCUS ON CLIENT/SERVER

The Client/Server model, as popularized in the late 1980's, describes a relationship between two processes. A client is a process which requests an action from a server. A server is a process which accepts requests from one or more clients and returns information. In the networked environment, clients and servers may reside on different machines. Commonly, a given machine will run both client and server processes of differing types. In the last two years, Client/Server has become almost completely identified with SQL based systems by the trade-press. In this segment, I'll look at a variety of Client/Server programming systems.

C/S INTERFACE TO MOSAIC

Of course, Internet applications are based on a Client/Server architecture by their very nature. The API for the "NCSA Mosaic Common Client Interface (CCI)" (http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/CCI/cci-api.html) is a new and experimental feature for Mosaic. As you may remember, Mosaic is the granddadyy of all WWW browsers. Although the CCI specification and API will very likely change in the near future, you can track its progress and download the latest version from this site. The purpose of this specification is to standardize the methods by which external programs can make contact with a running Mosaic session in the XWindows environment. In this case the Mosaic client itself becomes a server to other applications. You might use this to implement some kind of web crawler or other automated Internet utility.

C/S BASED SOFTWARE CONFIGURATION MANAGEMENT

P3 Software (http://www.p3.com/p3.html) produces "P3", the FAST software configuration management (SCM) system. SCM is all about keeping control of large projects involving multiple releases and branches thereof. If you've ever tried to do this using a bare Revision Control System (RCS), you know that comprehensive tracking requires automated assistance. You can download your own copy of "P3" from this page, which is free for noncommerical users. P3 currently supports Unix, Windows NT, and Windows clients.

P3 provides all the features of leading-edge SCM, geared for high performance. From initial deployment through to active use and administration, P3 works quickly. Built upon a true client/server architecture that doesn't rely on network file access, every piece of P3 is engineered for speed. More importantly, P3 stores and presents information about the user's workspace in ways that streamline the user interface. P3's speed is not at the expense of its function: with atomic change transactions, flexible client views, and a powerful branching model, the P3 system provides a comprehensive SCM environment.

P3 does not impose any particular engineering process. P3's mechanism can be used to implement a wide spectrum of source management policies -- or no policies. P3 does not require special file system support or extensive administration. It doesn't impose its own build system either. Best of all, P3 uses a fast implementation of RCS for the repository, so your source code is never hostage to a proprietary format.

C/S REMOTE PROCEDURE CALLS (RPC) TOOL

The German Research Network (DFN) has developed the DFN-RPC, a Remote Procedure Call Tool, distribute and parallelize scientific application programs between a workstation and a compute server or a cluster. The interface is optimized for applications written in FORTRAN, but the DFN-RPC can also be used in a C environment. You can download the tool and all documentation directly from the web (http://info2.rus.uni-stuttgart.de:81/rus/dfn_rpc/README_dfnrpc.html). You'll 20MB free disk space to install the entire package.

In the RPC model, a client process makes requests of a server by a simulated procedure call. An RPC compiler provides the mechanism for passing the parameters over the network between the client and server. The idea of RPC is to make the division between client and server as transparent as possible to the application programmer.

The latest version, 1.0.60 (beta), has undergone considerable improvements. Some highlights of the DFN-RPC include the following:

If you want to be informed about new releases, etc., you can subscribe to the dfnrpc-l@rus.uni-stuttgart.de mailing list by emailing to dfnrpc-l-request@rus.uni-stuttgart.de

C/S USENET NEWS RESOURCES

Usenet provides several newsgroups that will be of interest to Client/Server developers including:

Of these newsgroups, comp.client-server is likely to contain the most interesting information for mainstream applications. A recent scan of news headers included job postings, information about ODBC drivers, questions from newbies, and the predictable debate on which development environment is "the greatest". Of course, you should first read the FAQ (http://www.cis.ohio-state.edu/hypertext/faq/usenet/client-server-faq/faq.html),

If you're interest is purely centered SQL Client/Server, there are newsgroups for specific vendors such as INFORMIX (e.g. comp.databases.informix).

C/S MANAGEMENT INFORMATION RESOURCES

Although there's many fascinating technologies to explore in the world of Client/Server, you must remember to consider the management aspects of organizing and maintaining the project. The "Client/Server Management HandiGuide" by Positive Support Review, Inc. is a book describing the policies and procedures required to make a successful transition for a mission-critical Client/Server project. The emphasis is on making an efficient operation while respecting security and disaster recovery needs. You can preview parts of this book on the Internet (http://www.psrinc.com/clisrv.htm).

The "Client/Server Exchange" (http://dcewww.citi.umich.edu:8080/cse.html) is a joint venture between the University of Michigan and IBM. This center is staffed by researchers at the Center for Information Technology Integration (CITI). Their purpose is to provide guidance in development, evaluate tools, supply a testbed environment, and assist in developing proof-of-concept implementations. The current focus of the Client/Server Exchange is the Distributed Computing Environment (DCE) from the Open Software Foundation (OSF). CITI is an OSF business partner, offering the OSF DCE courses and providing customized briefings for companies interested in learning more about client/server computing. Their current DCE projects focus on issues of security, location transparency of data, and synchronization. To find out how you can take advantage of the "Client/Server Exchange" contact Bob Riddle .

The "Client/Server Coffeehouse" (http://dgoats.onr.com/clients.html) claims to be the first Internet homepage dedicated to discussing the real issues of implementing Client/Server in your organization. The page is run by Randy Lagel and is in many ways an unabashed plug for his book "Client Server -- The 10% You Need to Know". However, the page does include a web-based bulletin board where you can read questions and answers submitted by other coffeehouse denizens or post your own. Anyone posting to the bulletin board will receive a free copy of Lagels' "55 Rules of Thumb" for implementing Client/Server solutions.

For more management information resources on Client/Server, check the "Client/Server Resources" page (http://www.athos.com/client_server.html)

====================================================================
                      SimTel Mirror Sites (Fig. 1)

Please use an alternate mirror site to save bandwidth, if it is closer
to you.  Here's an abbreviated list of SimTel mirror sites to get you
started:

  Location      Server
  --------      -------------------------------
  Switzerland   nic.switch.ch:/mirror/simtel/msdos/c
  Japan         ftp.iij.ad.jp:/pub/msdos/c
  U.K.          micros.hensa.ac.uk:/mirrors/simtel/msdos/c
  Brazil        ftp.unicamp.br:/pub/simtel/msdos/c

====================================================================

[Up] [Prev Doc] [Next Doc]
This page maintained by Victor R. Volkman
Last updated on 10/29/96