#include "xpsh.h"
Functions | |
SXP_NodeType | getNodeType_i (SXP_Node node) |
returns the node type | |
const SXP_char * | getNodeName_i (SXP_Node node) |
returns the name of the node | |
const SXP_char * | getNodeNameURI_i (SXP_Node node) |
returns the namespace URI of the node | |
const SXP_char * | getNodeNameLocal_i (SXP_Node node) |
return the local part of the node name | |
const SXP_char * | getNodeValue_i (SXP_Node node) |
returns the node value | |
SXP_Node | getNextSibling_i (SXP_Node node) |
returns the next sibling of the node | |
SXP_Node | getPreviousSibling_i (SXP_Node node) |
returns the previous sibling of the node | |
int | getChildCount_i (SXP_Node node) |
counts the children of a node | |
int | getAttributeCount_i (SXP_Node node) |
counts the attributes of a node | |
int | getNamespaceCount_i (SXP_Node node) |
returns the number of namespace declarations belonging to this node | |
SXP_Node | getNamespaceNo_i (SXP_Node node, int n) |
returns the namespace node with a given index | |
SXP_Node | getParent_i (SXP_Node node) |
returns the parent of the context node | |
SXP_Document | getOwnerDocument_i (SXP_Node node) |
returns the owner document of the given node | |
int | compareNodes_i (SXP_Node node1, SXP_Node node2) |
compares two nodes | |
char * | pathname (SXP_Node node) |
generates the absolute path of the node | |
void | append_path (char *ret, node_xpsh *node) |
appends the name of the actual node-name to a given string | |
SXP_Node | genParents (const char *path) |
generate the ancestor nodes up to the root node | |
node_type | getDirentType (struct dirent *dir, char *pn) |
returns the FSX-nodetype of a file or dirent-structure | |
node_xpsh * | createNewNode (node_xpsh *parent, node_type t, char *name, char *value, node_xpsh *prev, node_xpsh *child) |
allocates memory for a new node and sets initial values | |
char * | getMimeType (node_xpsh *node, char dest[]) |
returns the MIME type of a node (i.e. file) | |
void | loadMimeTypes (void) |
loads the MIME types in the configuration file in an internal array | |
void | clearLastpn (void) |
clears the pn history | |
void | declareNamespaces (QueryContext Q) |
declare the internal namespaces in SXP | |
void | xpsh_clear (void) |
cleans up the library | |
void | xpsh_clear_mime (mime_type *mt) |
cleans up the mime_type linked-list | |
void | xpsh_clear_internal (node_xpsh *node) |
cleans up a node and recursively clean up all nodes with parent=this node | |
FILE * | openConfigFile (void) |
opens the XPsh-configuration file |
|
before that, the same function is called recursively for its parent.
|
|
should only used if the library is compiled with WITH_PN_HISTORY but doesn't hurt anyone |
|
|
|
|
|
the namespace that are defined by Shell environment variables and those defined in the adaptors.
|
|
(including all its children, for speed reasons)
|
|
if the node is not an element 0 is returned.
|
|
if the node is neither an element nor a document node, 0 should be returned.
|
|
because the dirent-structure hasn't the complete information on all operating systems the type could also be extracted out of the path to a file.
|
|
the MIME type is built out of the filename-ending. This mapping is defined in the configuration file in lines starting with MIME. The MIE-type of a directory is 'application/directory', of a symlink 'application/symlink'.
|
|
|
|
if the index is out of bounds, NULL is returned.
|
|
|
|
|
|
as defined by DOM Level 2 core specification, with the namespace addition SXP defines.
|
|
if the node has an explicit namespace node, its URI is returned, otherwise the fsx-URI (http://fsx.org/fsx) is returned.
|
|
as defined by enum SXP_NodeType. The root node of the FSX-tree is of type DOCUMENT_NODE, attribute nodes (fsx_ATTRIBUTE) of type ATTRIBUTE_NODE, namespace nodes (fsx_NS) of type NAMESPACE_NODE, text nodes (fsx_TEXT) of type TEXT_NODE. All other nodes are element nodes (ELEMENT_NODE).
|
|
as defined by DOM Level 1 core specification, with the namespace addition SXP defines.
|
|
in other words: the root node
|
|
because the parent ancestor-axis is created at the start, all parents are expanded and linked in the tree. so nothing has to be generated here. But the node could have no parent (for example if it's the root node).
|
|
|
|
all lines in the configuration file starting with MIME contain a mapping of an extension to a MIME type. Each one is stored in a mime_type entry, as part of a linked list. |
|
it is located either in the home-directory of the user with the filename .xpsh or globally in the /etc directory with filename xpsh
|
|
don't forget to free the memory of the returned string!
|
|
|
|
|