Coding Templates and C Libraries

Authored by Brian Alan Sroufek, Computer Scientist

bsroufek1968@codetemplates.net

 

**************************************************************************************

* This summary describes the enclosed software for distribution

* and use online (the internet), as is, without warranty or guarantee.

* The software I have written mostly in the C, partly in the C++ languages

* is meant to provide a common foundation for most computing and should

* save you and your teams much time and debugging.

*

* There are a number of modules, each of which has a header file describing

* it in more detail than herein. However, this document provides a list of

* them and an overall description for each. Note that each module has an

* "InitLib()" and "DestroyLib()" at its beginning for setting up initial

* use of the library or releasing it from use.

*

* Some sets of modules have test drivers associated with them for testing

* and development by you or your team(s) and show how to use the basic

* API’s by example to start with.

*

* Please refer to the Makefiles in the ../src directory for the build information.

* "Makefile" refers to the entire downloaded library, whereas "Makefile.ini"

* refers to the INI file build only, for example.

*

* The enclosed software is targeted for a Unix/Linux/C/C++ distribution or OS

* which has the “make”, “gcc”, “g++”, “cp” and “rm” programs. You will need

* “gunzip” and “tar” or “WinZip” to unpack your software.

*

* Should you have any questions or suggestions, feel free to email me at:

*

* bsroufek1968@codetemplates.net

 

 

MMEM

—————–

This module wraps the standard memory calls and manages the memory

chunks obtained from virtual (or other) memory calls in "malloc()", "free()",

and "realloc()", which can be changed to fit your own operating system in

the module. The following two functions in "mmem.c" are where to look for

these calls to the operating system and may easily be changed to some-

thing like "alloc()" or whatever your OS uses.

 

void *MMEMgetVirt(int blockSize);

int MMEMfreeVirt(void *chunkPtr);

 

MSTR

—————–

This module provides basic string functions with hash values and

lengths, including comparison functions which take the hash and length

into consideration for testing equality, thus speeding up the comparisons.

 

MTHREAD

—————–

This module provides an interface to threads, with mutex and semaphore

management used for thread synchronization. Precompiler definitions are used

for selecting thread related semaphore and mutex structures in the header

file.

 

MSTRUCTS

—————–

This module provides basic data structures used throughout the

library, including lists, stacks, queues, sort trees and hash trees. Each

has "getFirstNode()", "getLastNode()", "getPrevNode()" and "getNextNode()"

functions for traversal. The "split()" and "join()" string functions are

also available herein.

 

MLOG

—————–

This module is an basic interface for logging lines of text into

a log file. The openAndAppend() or openAndRestart() functions are useful.

 

MIO

—————–

This module provides just two functions, "MIOreadLineFromInput()"

and "MIOwriteToOutput()". These two functions have an option, "inputType"

or "outputType", which basically wrap all IO into them as:

enum {

MIO_BUFFER,

MIO_FILE,

/* general file descriptor */

MIO_FD,

/* socket: using "MSOCKT *" for the object — in library */

MIO_SOCK,

/* pipe: using "MPIPET *" for the object — in library */

MIO_PIPE

};

 

MDIRTREE

—————–

This module allows for the creation, management and deletion of

N-ary tree directory structures in memory (data structures), including

symlinks. The objects can be read and written to the filesystem.

 

MDG

—————–

This module provides for the creation, management and deletion of

datagrams and their fragments with an appropriate API.

 

MEXPR

—————–

This module is an interface for assisting in regular expression parsing.

 

MINIFILE

—————–

This module is for reading, manipulation and writing of INI files, which

are standard file formats. The "test_ini.exe" driver is available for example

and use.

 

MPIPE and MSOCK

—————–

These two modules provide an interface to pipes and sockets for use in

interprocess communication or network communication. The two drivers,

"test_pipe.exe" and "test_sock.exe" are available for use and example.

 

MTEMPLATES

—————–

Please see the header file and sample template file(s) on the template

format. This module is for instantiation of text templates which have expressions

evaluated and variables replaced to produce anything in text which is governed

by logic and form-filled with variables. The flags and variables can be dynam

ically changed in code to produce different instances of templates. It’s great

for SQL templates, for example.

 

MGRAMMAR

—————–

This module allows for general grammars to be written and processed

against text files. The test driver is "test_grammar.exe" and the sample

C-like grammmar provided is in "text/mgrammar.txt". The sample text is the

actual header file for the module, "include/mgrammar.h", with its comments

removed. The memory may not be sufficient for very large text files.

 

MXMLPARSER

—————–

This provides data structures and an API for reading, parsing and

writing XML and HTML files. Observe that some generators or designers write

everything without line breaks, but this will read, parse and write the file(s)

in pretty-printed, indented format. There are two general search functions

provided by you may extend these to other search functions with more specific

criteria. Sample XML and HTML files are provided for the test driver:

"bin/test_XML.exe".

 

MDB

—————–

Unlike the other C libraries and programs in this package, this module

is written in C++ but only uses the defaulting arguments of this language

as compared to C. This module provides a general API for reading and

writing tabulated text files (data tables), with index creation and a

speedy search function.

 

****************************************************************************

Job Control Board Application

 

This Application provides a configurable and modifiable Job Control Board Application which includes an Engine for processing and executing the jobs. The job status includes scheduled, running, stopped, completed or failed. It has an API for scheduling jobs; as well, the engine API and Jobs API are modifiable by the programmer in Microsoft Visual Studio C++ for actual execution of jobs.

 

Refund Policy:

Should you purchase a product and don’t get the following download to your system, you can either request a full refund at the email above or request an email with the product attached to it.

If, however, you do get the download, there is no refund as you already have the software on your

system as is, without warranty or guarantee.

Copyright © Brian Alan Sroufek, Navarre, Florida, United States of America

 

The above modules include Makefiles for generating the executables and creating build files/projects. They also include README.txt files describing the modules contained therein as well as supporting "../text/*.ini" and "../text/m*.txt" files for running the drivers contained in the downloaded modules. Header files and source codes are included with the modules. To note, the provided license allows for modifications of all contained files and the sales and distributions of your own work upon them as included with your own files, although individual sales and distributions are not allowed. The copyright headers must be included at the top of the contained files.

 

Please visit our Products Page for Purchase and Download