Netgraph Server Files
This file describes the individual source files of the Netgraph server. Individual functions are described
in the header files, or directly in the implementation files.
The server consists of the following source files:
- Makefile - a standard Unix makefile for compiling all parts of the server
- define.h - a definition of constants for the pre-processor
- dotser.c - the core of the program
- global.cpp - a definition of some global variables
- global.h - a header file for
global.cpp
- loadsave.cpp - functions for loading/saving trees
- loadsave.h - a header file for
loadsave.cpp
- matching.c - matching of nodes is implemented here
- matching.h - a header file for
matching.c
- messages.c - some error messages for the client
- messages.h - a header file for
messages.c
- mutual.c - functions and constants common for
netser
and dotser
- mutual.h - a header file for
mutual.c
- netser.c - it takes care of the communication with the clients
- passwd.c - user accounts management
- passwd.h - a header file for
passwd.c
- searching.c - structures and functions for working with lists of nodes for searching
- searching.h - a header file for
searching.c
- trees.c - representation of the trees in the memory
- trees.h - a header file for
trees.c
- config.txt - the main configuration file for the server
- coreferences.txt - a configuration file for references
- passwd.txt - a file containing user accounts
file Makefile
A standard Unix makefile for compiling all parts of the server. It has three targets:
- all (default)
- It compiles all parts of the server and links the object files together.
- clean
- It deletes all backup files and compiled object files. Does not remove the linked executable files.
- mrproper
- It deletes all backup files and compiled object files, as well as the linked executable files.
file define.h
This file contains a definition of constants for the pre-processor. It is included to all other files.
file dotser.c
This file contains the core of the whole program, as well as the main function for dotser
.
Responds to all messages from
the client are defined here. When a query is sent from the client, a new child process is created that performs
the searching, while the parent keeps responding to messages from the client. The core of the search algorithm
is also implemented here (see a description of the search algorithm).
file global.cpp
Definition of some global variables is here.
file global.h
This is a header file for global.cpp
.
file loadsave.cpp
This file contains functions for loading/saving trees from/to a disc or a string.
file loadsave.h
This is a header file for loadsave.cpp
.
file matching.c
Functions for matching nodes are implemented here. Also functions for pre-processing the query and the searched trees.
file matching.h
This is a header file for matching.c
.
file messages.c
This file implements a few functions for sending error messages to the client. They are used for
sending a description of an error in a regular expression.
file messages.h
This is a header file for messages.c
.
file mutual.c
This file (or its header) defines some constants and functions mutual for the two main parts of the Netgraph server - netser
and dotser
, e.g. constants for setting a type or subtype of a message, or functions for reading the main configuration file. A version of the server is defined here.
file mutual.h
This is a header file for mutual.c
.
file netser.c
This part of the server takes care of the communication with the clients. When a connection from a client comes,
a forked child takes care of this connection, while the parent process waits for other connections. The child creates
a new process dotser
that handles the messages that come from the client. The main function for netser
is defined here.
file passwd.c
This file (or its header) defines constants, structures and functions for user account management. Functions for
the user authentication and authorization are implemented here. Reading/writing functions from/to the file passwd.txt
(see below) are available.
file passwd.h
This is a header file for passwd.c
.
file searching.c
Structures and functions for creating and handling lists of nodes for searching are defined and implemented here (and in the header file).
file searching.h
This is a header file for searching.c
.
file trees.c
Structures for representing an attribute, a node, a tree and a file of trees in the memory, as well as functions
for creating/handling/deleting them are defined here (and in the header file).
file trees.h
This is a header file for trees.c
.
file config.txt
This is the main configuration file for the server. Its detailed description is available.
file coreferences.txt
This is a configuration file for references. Its detailed description is available.
file passwd.txt
This file keeps user accounts. Its detailed description is available.