Table of Contents
1.
Introduction
Welcome to AFC
AFC Features
How to use AFCs
#include <afc/afc.h>
afc-config
2.
AFC Tagging System
The TAG system
3.
AFCBase
Introduction
Utility Functions
Methods
afc_clear
-- Clears all stored data
afc_debug
-- Writes a debug message to the standard error
afc_debug_adv
-- Writes a debug message to the standard error
afc_delete
-- Disposes a valid afc instance.
afc_free
-- Allocates memory
afc_log
-- Writes a log message to the standard error
afc_log_fast
-- Writes a log message to the standard error
afc_malloc
-- Allocates memory
afc_new
-- Initializes a new afc instance.
afc_set_tag
-- Set a tag
afc_set_tags
-- Sets valid tags
4.
AFC String
Introduction
Methods
afc_string_add
-- Add a string to the current one
afc_string_clear
-- Empty the contents of a string
afc_string_comp
-- Compares two strings
afc_string_copy
-- Copy a string inside an AFC string_new
afc_string_delete
-- Remove the string from memory
afc_string_dup
-- Creates a new string with the same contents of the given one
afc_string_fget
-- Get a line of text from a file
afc_string_hash
-- Creates an hash value for the string
afc_string_instr
-- Search for a matching string inside a string
afc_string_left
-- Copies the leftmost len chars from src to string
afc_string_len
-- Returns the actual string length
afc_string_lower
-- Converts a string in lower case chars
afc_string_make
-- Copies data into string using the given fmt and args
afc_string_max
-- Returns the maximum size of the given string
afc_string_mid
-- Copies a part of source string in dest string
afc_string_new
-- Allocates a string numchars long
afc_string_pattern_match
-- Use pattern matching against this string
afc_string_radix
-- Rappresents a number using the given base
afc_string_reset_len
-- Resets internal string len
afc_string_right
-- Copies the leftmost len chars from src to string
afc_string_temp
-- Creates a temporary file name
afc_string_trim
-- Removes all blank chars from string
afc_string_upper
-- Converts a string in upper case chars
5.
ArrayMaster
Introduction
Methods
afc_array_master_add
-- Adds a new element to the array
afc_array_master_clear
-- Clears all stored data
afc_array_master_current_pos
-- Returns the current ordinal position
afc_array_master_del
-- Deletes the current element from the array
afc_array_master_delete
-- Disposes a valid array_master instance.
afc_array_master_first
-- Returns the first element in the array
afc_array_master_init
-- Inits the Array size
afc_array_master_is_empty
-- Checks if the array is empty
afc_array_master_is_first
-- Checks if you are on the first element
afc_array_master_is_last
-- Checks if you are on the last element
afc_array_master_item
-- Returns the desired element in the Array
afc_array_master_last
-- Returns the last element in the array
afc_array_master_new
-- Initializes a new afc_array_master instance.
afc_array_master_num_items
-- Returns the number of items in list
afc_array_master_obj
-- Returns the current element in the array
afc_array_master_prev
-- Returns the previous element in the array
afc_array_master_sort
-- Sorts the elements in the array
afc_array_master_succ
-- Returns the next element in the array
6.
CGIManager
Introduction
Methods
afc_cgi_manager_clear
-- Clears all stored data
afc_cgi_manager_debug_dump
-- Dumps all data for debug
afc_cgi_manager_delete
-- Disposes a valid cgi_manager instance.
afc_cgi_manager_get_cookie
-- Retrieve a cookie value
afc_cgi_manager_get_data
-- Gets data from the previous Form
afc_cgi_manager_get_val
-- Gets a specific form field data
afc_cgi_manager_new
-- Initializes a new afc_cgi_manager instance.
afc_cgi_manager_set_content_type
-- Set the returning content type
afc_cgi_manager_set_cookie
-- Set a new cookie
afc_cgi_manager_set_cookie_domain
-- Set the cookies domain
afc_cgi_manager_set_cookie_expire
-- Set the cookies path
afc_cgi_manager_set_cookie_path
-- Set the cookies path
afc_cgi_manager_set_tag
-- Set a tag
afc_cgi_manager_write_header
-- Writes a valid HTTP header with all cookies set
7.
Dictionary
Introduction
Methods
afc_dictionary_clear
-- Clears all stored data
afc_dictionary_del
-- Deletes the current element
afc_dictionary_delete
-- Disposes a valid dictionary instance.
afc_dictionary_del_item
-- Deletes the item provieded
afc_dictionary_first
-- Returns the first element in the Dictionary
afc_dictionary_get
-- Retrieves the data of a specified key
afc_dictionary_get_key
-- Returns the current key name
afc_dictionary_has_key
-- Looks for a specified key in the Dictionary
afc_dictionary_new
-- Initializes a new afc_dictionary instance.
afc_dictionary_obj
-- Returns the current Dictionary item value
afc_dictionary_prev
-- Returns the previous element in the Dictionary
afc_dictionary_set
-- Sets a key in the dictionary
afc_dictionary_succ
-- Returns the next element in the Dictionary
8.
DirMaster
Introduction
Methods
afc_dirmaster_add_item
-- Adds a new item to the DirMaster
afc_dirmaster_clear
-- Completely clears this DirMaster
afc_dirmaster_del
-- Deletes the current item from the list.
afc_dirmaster_delete
-- Frees a DirMaster object
afc_dirmaster_first
-- Gets the first element in the list
afc_dirmaster_get_parent
-- Returns the parent of current dir
afc_dirmaster_is_empty
-- Checks if the DirMaster is empty
afc_dirmaster_item
-- Return the nth element
afc_dirmaster_last
-- Get the last element in the list
afc_dirmaster_new
-- Initializes a new ArrayMaster object.
afc_dirmaster_num_items
-- Return the number of items in list
afc_dirmaster_obj
-- Returns the FileInfo structure of the current item
afc_dirmaster_prev
-- Gets the previous element in the list
afc_dirmaster_scan_dir
-- Reads a dir inside the DirMaster
afc_dirmaster_search
-- Searches for a file name in the current DirMaster list
afc_dirmaster_set_tag
-- Set a tag
afc_dirmaster_set_tags
-- Sets a list of tags
afc_dirmaster_sort
-- Sorts the DirMaster list
afc_dirmaster_succ
-- Gets the next element in the list
9.
DynamicClass
Introduction
Methods
afc_dynamic_class_add_method
-- Adds a new method to the class
afc_dynamic_class_clear
-- Clears all stored data
afc_dynamic_class_delete
-- Disposes a valid DynamicClass instance.
afc_dynamic_class_execute
-- Executes a public method in DynamicClass
afc_dynamic_class_find_method
-- Finds a public method inside a DynamicClass
afc_dynamic_class_new
-- Initializes a new DynamicClass instance.
10.
DynamicClassMaster
Introduction
Methods
afc_dynamic_class_master_add
-- Adds a new Dynamic Class in memory
afc_dynamic_class_master_clear
-- Clears all stored data
afc_dynamic_class_master_delete
-- Disposes a valid DynamicClassMaster instance.
afc_dynamic_class_master_delete_instance
-- Deletes a DynamicClass instance from memory
afc_dynamic_class_master_get_info
-- Gets various info about a Class in memory
afc_dynamic_class_master_load
-- Loads a new class in memory
afc_dynamic_class_master_new
-- Initializes a new DynamicClassMaster instance.
afc_dynamic_class_master_new_instance
-- Creates a new instance of a DynamicClass in memory
11.
FileOperations
Introduction
Methods
afc_fileops_chmod
-- Change the file permissions
afc_fileops_chown
-- Change the file permissions
afc_fileops_copy
-- Copy a file/dir
afc_fileops_del
-- Delete a file/dir
afc_fileops_delete
-- Dispose a FileOperations object
afc_fileops_exists
-- Check whether a file/dir exists in file system
afc_fileops_exists_full
-- Check whether a file/dir exists in file system
afc_fileops_link
-- Create a symbolic link to a file/dir
afc_fileops_mkdir
-- Create a new dir
afc_fileops_move
-- Move a file/dir
afc_fileops_new
-- Initializes a new FileOperations object.
afc_fileops_set_tag
-- Sets a tag
afc_fileops_set_tags
-- Sets a group of tags
afc_fileops_utime
-- Change the file times
12.
FSTree
Introduction
Methods
afc_fstree_add
-- Adds a "file" to the FST
afc_fstree_cd
-- Changes "current directory" in FST
afc_fstree_clear
-- Clears all stored data
afc_fstree_find
-- Searches for a specific file/dir in the FST
afc_fstree_internal_add
-- Adds a new node to the FST
afc_fstree_internal_find
-- Scans the "FST" File System for a specific node
afc_fstree_internal_find_item
-- Scans an ArrayMaster for a specific item
afc_fstree_internal_recursive_dump
-- Dumps current FSTree status to stdout
afc_fstree_internal_recursive_find
-- Scans the "FST" File System for a specific node
afc_fstree_internal_split_name
-- Splits a name in dir and name parts
afc_fstree_mkdir
-- Creates a new "directory" in FST
afc_fstree_new
-- Initializes a new FSTree instance.
afc_fstree_recursive_mkdir
-- Creates a new "directory" in FST
13.
HashMaster
Introduction
Methods
afc_hash_master_add
-- Add a new data to the hash table
afc_hash_master_clear
-- Clears all stored data
afc_hash_master_del
-- Deletes the current element
afc_hash_master_delete
-- Disposes a valid hash_master instance.
afc_hash_master_find
-- Returns the data associated to the given hash_value
afc_hash_master_item
-- Returns the item-th element
afc_hash_master_new
-- Initializes a new afc_hash_master instance.
14.
NodeMaster
Introduction
Methods
afc_nodemaster_add
-- Add an item to the list
afc_nodemaster_addr
-- Returns the list address
afc_nodemaster_change
-- Changes the data in the current item
afc_nodemaster_change_numerical_pos
-- Changes the current ordinal item position
afc_nodemaster_changepos
-- Changes the current node position to another
afc_nodemaster_clear
-- Clears all NodeMaster list elements
afc_nodemaster_clear_stack
-- Clears the stack
afc_nodemaster_clone
-- Clones a NodeMaster list
afc_nodemaster_create_array
-- Creates an array rappresentation of the list
afc_nodemaster_del
-- Deletes the current item from list
afc_nodemaster_delete
-- Dispose a NodeMaster object
afc_nodemaster_first
-- Move to the first element
afc_nodemaster_free_array
-- Frees the array rappresentation of the List
afc_nodemaster_get
-- Get the current element
afc_nodemaster_insert
-- Inserts a new item in the current list position
afc_nodemaster_is_empty
-- Checks for empty list
afc_nodemaster_is_first
-- Checks if the current item is actually the first one
afc_nodemaster_is_last
-- Checks if the current item is actually the last one
afc_nodemaster_item
-- Moves to the desired item
afc_nodemaster_last
-- Moves to the last item in list
afc_nodemaster_new
-- Initializes a new NodeMaster object.
afc_nodemaster_numerical_pos
-- Returns the current ordinal item position
afc_nodemaster_num_items
-- Returns the number of items in list
afc_nodemaster_obj
-- Gets the current item
afc_nodemaster_pop
-- Pops an item from the stack
afc_nodemaster_prev
-- Moves to the previous item in list
afc_nodemaster_push
-- Pushes an item on the stack
afc_nodemaster_sort
-- Sorts the item in the NodeMaster
afc_nodemaster_succ
-- Moves to the next item in list
15.
ReadArgs
Introduction
Overview
Usage
Methods
afc_readargs_clear
-- Frees all unused memory
afc_readargs_delete
-- Dispose a ReadArgs class.
afc_readargs_get_by_name
-- Returns a parsed named field
afc_readargs_get_by_pos
-- Returns a parsed field
afc_readargs_new
-- Initializes a new ReadArgs object.
afc_readargs_parse
-- Parses a string with the given template
16.
RegExp
Methods
afc_regexp_clear
-- Clears all stored data
afc_regexp_delete
-- Disposes a valid regexp instance.
afc_regexp_get_pos
-- Returns the offsets of the string matching the RE
afc_regexp_get_sub_string
--
afc_regexp_match
-- Matches the str with the current Regular Expression
afc_regexp_new
-- Initializes a new afc_regexp instance.
afc_regexp_replace
-- Replaces a string using RE patterns
afc_regexp_set_buffer
-- Sets buffer for replace operations
afc_regexp_set_expression
-- Compiles the Regular Expression for the matches
afc_regexp_set_storage_size
-- Sets the maximum amount of results for match
17.
StringNode
Introduction
Methods
afc_stringnode_add
-- Adds a new string in the StringNode list
afc_stringnode_addr
-- Returns a pointer to the List managed by StringNode
afc_stringnode_change
-- Changes the string of a node in the list
afc_stringnode_clear
-- Deletes all the strings in the StringNode
afc_stringnode_clear_stack
-- Clears the stack of pushed string
afc_stringnode_clone
-- Clones a StringNode creating a new one
afc_stringnode_del
-- Deletes the current string from the list
afc_stringnode_delete
-- Disposes an existing StringNode
afc_stringnode_first
-- Returns the first item in the StringNode's list
afc_stringnode_get
-- Returns a pointer to the current list Node.
afc_stringnode_insert
-- Inserts a string in the current list position
afc_stringnode_is_empty
-- Checks if the StringNode's list is empty
afc_stringnode_item
-- Returns the desired item in the StringNode's list
afc_stringnode_last
-- Returns the last item in the StringNode's list
afc_stringnode_new
-- Initializes a new StringNode object.
afc_stringnode_numerical_pos
-- Returns the ordinal position of the current string in the list
afc_stringnode_num_items
-- Returns the number of strings in the list
afc_stringnode_obj
-- Returns the current string in the StringNode's list
afc_stringnode_pop
-- Returns the last item pushed on the stack
afc_stringnode_prev
-- Returns the previous item in the StringNode's list
afc_stringnode_push
-- Pushes the current list position on the stack
afc_stringnode_search
-- Searches the list for the specified string
afc_stringnode_sort
-- Sorts the strings in the list
afc_stringnode_split
-- Splits a string
afc_stringnode_succ
-- Returns the next item in the StringNode's list
List of Examples
15-1.
ReadArgs
Example-1: template
15-2.
ReadArgs
Example-2: template
15-3.
ReadArgs
Example-2: user input
Next
Introduction