#***************************************************************************
#*                         sim_srev.awk -  description
#*                            -------------------
#*   begin                : Mon 26 Dec 2005 04:38:19 PM EST
#*   copyright            : (C) 2005 by Terry D. Boldt
#*   email                : fastsnip-wm1@yahoo.com
#***************************************************************************/
#
#***************************************************************************
#*                                                                         *
#*   This program is free software; you can redistribute it and/or modify  *
#*   it under the terms of the GNU General Public License as published by  *
#*   the Free Software Foundation; either version 2 of the License, or     *
#*   (at your option) any later version.                                   *
#*                                                                         *
#***************************************************************************/
#*
#*
#*   QTAwk program to demostrate dynamically loaded user function
#*/
BEGIN {
    display_PROCINFO();
    display_user_functions();
    display_modules();

    sim_srev_version = "Not Installed";
    print("Simulated 'srev' Module Version:",sim_srev_version);

    # load desired module specifying initialization function
    # exit function uses default name
    module_name = "sim_srev.so";
    load_module(module_name,"init_sim_srev");

    display_PROCINFO();
    display_user_functions();
    display_modules();

    print("Simulated 'srev' Module Version:",sim_srev_version);

    test_string = POSIX["alpha"];
    print("Test String:",test_string);
    rrts = sim_srev(test_string);
    print("Returned   :",rrts);
    srts = rev_caps(rrts);
    print("Cap Rev    :",srts);

    # unload module - exit function will be executed
    unload_module(module_name);

    display_PROCINFO();
    display_user_functions();
    display_modules();

    print("Simulated 'srev' Module Version:",sim_srev_version);
} ## BEGIN

#include "display_funcs.awk"