Netmar User's Guide Netmar.com
Contact Netmar
Order Webhosting

Linux control panel

   

libnetmar - The Netmar C Library

PURPOSE
WELCOME! The functions documented below and on the attached pages represent the bulk of the programming work that we've saved over our years of operation here at Netmar. As any good C programmer is taught to do, we have saved the more flexible functions from all the software we've written so that future programs we write could be implemented more quickly and easily and without reinventing the wheel every time.

As these functions have helped us tremendously in writing new programs over the years, we hope they will help you too. So, we've taken the unprecedented step of making these functions available to you, our customers, for use in your own programs, as a complete C library. And while we can't release the full source code of the library, we have created a standard C archive library to which you can link your C programs upon compilation to use any of these functions.

USAGE

To use libnetmar, you need to do only two things:
  1. Insert an include for the netmar.h header file in each of your C source files that references one of the libnetmar functions
    (e.g. "#include <netmar.h>"), and
  2. Link your program with -lnetmar upon compilation
    (e.g. gcc -o myprogram myprogram.c -lnetmar)
That's it! You can then use any of the functions in libnetmar in your C programs and CGI scripts.

TESTING & SUPPORT

All of the functions in libnetmar have been independently tested (outside of the program for which they were designed) and then used successfully in a program. So, while we can't guarantee the entire library is bug free, we do know that all of these functions work because they have all been tested and used ina real life environment.

If, however, you find something that you think is a bug, we would be appreciative if you would point it out to us, and tell us in as much detail as possible, how you came upon it. If ths situation caused your program to crash, we would appreciate you saving a core file for us. You can do this by typing "limit coredumpsize unlimited" at the command prompt before running the program. Please note that if your program is a CGI script, you can still run it from the command line to debug it by using the cgi_assign or getcgidata functions from the library.

As these function were written by us and are being made available to our customers as part of the webhosting service we offer, Netmar provides full technical support for users of the library. However, please note that Netmar technical support does not offer tutoring or support for the C programming language itself. If you don't understand how to write or compile your program, please consult your reference materials.


CGI Section
This section contains functions for use in writing CGI scripts. If you're writing a script, you want to use assign (with getcgidata) or cgi_assign as these fully automate the input task while also including a debugging interface. These function calls, together with fsend or tfsend, reduce the I/O portions of code in a CGI program to as little as two lines (one function call to read input, and one to send all output).

Other functions allow you to do some more advanced tasks, like sending your data to another CGI script via a POST request and encoding/decoding HTML and URL encoded strings.

If you're writing a CGI script, you'll also want to see the tfsend function in the next section.


Data Handling Section
The functions in this section provide various methods for reading, writing, and manipulating data. Mostly, these functions serve as shortcuts for what would otherwise be oft-typed repetitive code in a program. With the exception of the fsend, tfsend, and pgp_enc functions, these functions are mostly just shortcuts.
Miniature Tools Section
This section consists of functions that do various sundry tasks that could just be made easier and reusable by creating a separate function. So we did. Nothing here is earth-shattering. The things accomplished by these functions could be done by most programmers, regardless of level, but would just take time to code. So these functions are mainly just for convenience. You'll notice that some are for some very specific tasks. These are tasks that we needed to accomplish in writing certain program. The usefulness of some of these functions outside of the programs for which they were written is probably questionable. But the functions were already written, so we're including them in this secion.
Miscellaneous Tools Section
This section also contains functions that are mostly for convenience (providing simple functionality). But these functions are more likely to be of interest to programmers for use in more programs as the functionality provided is more commonly needed in CGI and Unix programming.
Network Section
Network programming traditionally has required a platform specific level of understanding that is often beyond most novice programmers and even many intermediate and advanced programmers. It is almost always well beyond a programmers that is new to the platform. So, we have saved as separate functions, the code we have used in the past to communicate over TCP/IP sockets.

There are two sets of functions here. One is a medium level interface, which provides direct interaction with the TCP/IP socket with no buffering, while the other, a high level interfare, provides a buffered, error-controlled, and timed interface almost exactly identical to the file I/O interface provided by the stdio functions fgets and fputs.


String Tools Section
It has often been said that one of the main advantages of Perl over C is the ease of string manipulation built into the Perl language. The functions in this section provide a higher level of control over strings than that provided by the ANSI C string.h functions.

Quick Start Guide :: Visit the old Guide :: Dedicated Server Guide

All content © 2002,2003 NetMar, Inc.