Comiclib.pm
config file and subroutines for comics
This is a library of functions and data structures for the ComicMan web comic downloading system.
Jay Scott Raymond
None known as yet.
inf-doc.txt
Copyright 2006, Jay Scott Raymond. All Rights Reserved
This program is free software. You may copy or redistribute it under the same terms as Perl itself.
Parameters: none.
Returns: string.
The get_safe_home()
function returns an untainted copy of the Home
directory path.
A hash containing various configuration variables.
Parameter 0: log message
Returns: none.
The write_to_logfile()
function writes a log message to the file defined
in $comicman_data{dload_log_file}.
Parameter 0: the debug level setting (0: no output, 1: failure, 2: serious problem, 3: minor problem, 4: trace mode)
Parameter 1: The debug message.
Returns: none.
The debug_print()
function prints with multiple debug levels to regulate
the amount of output.
Parameter 0: the member of comicman_data to get
Returns: The requested data item or 0 on error.
The get_cm_data()
function is an accessor for the comicman_data hash.
Parameter 0: the member of comicman_data to set
Parameter 1: what to set the member to
Returns: 1 = success, 0 = failure.
The set_cm_data()
function is an accessor for the comicman_data hash.
Parameters: none
Returns: 0: failure 1: success
The make_user_dir()
function sets up a new user's data directories
Parameters: none
Returns: none
The comicman_setup()
function sets up a new user's data directories via make_user_dir and
which comics to download
Parameter 0: Path to config file
Parameter 1: Reference to a list of updatable fields
Returns: 1=success, 0=failure.
The update_cm_settings()
function updates %comicman_data with settings from a file.
Parameters: none
Returns: 0: failure 1: success
The init_cm_data()
function initializes the comicman_data hash with the user settings
Parameter 0: URL of webpage to download
Returns: The text of the webpage.
The get_webpage()
function gets the text of a webpage.
Parameter 0: data filename
Returns: array of last downloaded comics
The get_old_data()
function gets data of the last comic downloaded.
Parameter 0: webpage text
Parameter 1: regular expression to parse the webpage with
Returns: array of filenames
The parse_filename()
function parses a webpage using the provided regEx.
Parameter 0: search part of regEx
Parameter 1: replace part of regEx
Parameter 2: reference to array of filenames
Returns: array of filenames
The name_fixup()
function performs adjustments to an array of filenames with a search-replace regEx.
Parameter 0: datfile name
Parameter 1: reference to an array of comic identifier(s)
(could be filenames,
numbers or checksums)
Returns: 1=success, 0=failure
The update_comics_file()
function updates the data file for a comic.
Parameter 0: prefix
Parameter 1: reference to an array of comic(s)
Returns: none
The prefix_comic()
function adds a prefix to the comic name(s).
Parameter 0: text or regEx to be replaced
Parameter 1: replacement text
Parameter 2: reference to an array of comic(s)
Returns: none
Replacement codes: #orig# = original filename
The rename_comic()
function renames the comic(s).
Parameter 0: Referer URL
Parameter 1: URL to append comic names to
Parameter 2: Data file to update if new comic downloaded
Parameter 3: reference to an Array of new comic data
Returns: none
The get_named_comics()
function gets the named new comic(s), if any.
Parameter 0: Referer URL
Parameter 1: URL to append comic names to
Parameter 2: Data file to update if new comic downloaded
Parameter 3: reference to an Array of new comic data
Returns: none
The get_cksum_comics()
function gets the checksumed new comic(s), if any.
Parameter 0: comic id
Parameter 1: reference to an array of old comic ids
Returns: 1=found, 0=not found
The acquired_data()
function checks if a comic id is in the dat file.
Parameter 0: inf file name
Returns: comic data hash
The fetch_inf_data()
function gets a comic's inf data.
Parameter 0: inf directory
Returns: array of filenames
The get_inf_list()
function gets a list of inf files.
Parameters: none
Returns: array of filenames
The get_chosen_list()
function gets a list of chosen inf files.
Parameter 0: a reference to an array of filenames
Returns: none
The save_chosen_list()
function sets a list of chosen inf files.
Parameter 0: array reference of required field names
Parameter 1: hash reference from inf file
Returns: 1=missing, 0=OK
The missing_fields()
function checks inf data for required fields.
Parameters: none
Returns: none
The make_new_inf()
function makes a new inf file with data from the user.