/* libhello - source to demo shared library use.
 * Shared libraries have a "major" varsion and a
 * "minor" version (and somtimes a "release" version
 * number as well).  Different major numbers indicate
 * (possibly) incompatible versions; if the major
 * number is the same than the minor number indicates
 * compatible bug fixes.  Our current version is
 * libhello.1.0.0 .
 *
 * BUILD DIRECTIONS:
 *   gcc -fPIC -shared -Wl,-soname,libhello.so.1 \
 *       -o libhello.so.1.0.0 libhello.c
 *
 * INSTALL DIRECTIONS:
 *  Copy the libhello.so.1.0.0 to a standard directory
 *    such as /usr/lib (or if system is configured for it,
 *    /usr/local/lib).
 *  Run "ldconfig" to create the various symlinks required.
 *
 *    * OR *
 *
 *  Put the libhello.so.1.0.0 anywhere, say ~/lib, and then:
 *  Run "ldconfig -nv ~/lib" (or whatever dir you used).
 *  (Note for security reasons LD_LIBRARY_PATH is ignored when
 *  running SUID programs!)
 *
 * In either case ldconfig doesn't seem to create a full set
 * of symlinks.  Make sure you manually create any missing ones:
 *    cd ~/lib
 *    ln -s libhello.so.1.0.0 libhello.so.1.0
 *    ln -s libhello.so.1.0 libhello.so.1
 *    ln -s libhello.so.1 libhello.so
 *
 * Written 7/2005 by Wayne Pollock, Tampa Florida USA.
 */

#include "libhello.h"
#include <stdio.h>

/* ELF shared libraries can have many functions and even
 * global variables.  Here is one demo function:
 */

void say_hello ( char* s )
{
   printf( "Hello, %s!\n", s );
}

/* When a shared library is loaded, two special function
 * are used: _init when the library is loaded and _fini
 * when it is unloaded (typically when the process exits).
 * If you don't have either one defined, the system will
 * create a default "do nothing" version for you!

void _init ()
{
   printf( "%s\n", "Library libhello.so initializing!" );
}

void _fini ();
{
   printf( "%s\n", "Library libhello.so unloading!" );
}

*/
