home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp / src / devs / netinfo / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-19  |  2.2 KB  |  101 lines

  1. RCS_ID_C="$Id: init.c,v 3.1 1994/01/23 02:46:18 ppessi Exp $"; 
  2. /*
  3.  * init.c --- netinfo.device main functions
  4.  *
  5.  * Author: ppessi <Pekka.Pessi@hut.fi>
  6.  *
  7.  * This file is part of the AmiTCP/IP NetInfo device.
  8.  *
  9.  * Copyright © 1993 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  10.  *                  Helsinki University of Technology, Finland.
  11.  *
  12.  * Created      : Sun Nov 28 17:45:55 1993 ppessi
  13.  * Last modified: Sat Jan 22 15:46:51 1994 ppessi
  14.  *
  15.  * $Log: init.c,v $
  16.  * Revision 3.1  1994/01/23  02:46:18  ppessi
  17.  * New command semantics, new version.
  18.  *
  19.  * Revision 2.3  1994/01/23  02:42:01  ppessi
  20.  * Removed the path from device name.
  21.  *
  22.  * Revision 2.2  1994/01/21  12:11:44  ppessi
  23.  * Removed <sys/errno.h> from includes
  24.  *
  25.  * Revision 2.1  1994/01/18  09:10:44  ppessi
  26.  * Basic functionality
  27.  *
  28.  */
  29.  
  30. #include "base.h"
  31.  
  32. #include <dos/dostags.h>
  33. #include <exec/resident.h>
  34.  
  35. #include "netinfo.device_rev.h"
  36.  
  37. extern const LONG __far _LibInitTab[];
  38. extern const UBYTE _DevName[];
  39.  
  40. LONG _libstart(void)
  41. {
  42.   return -1;
  43. }
  44.  
  45. const static struct Resident LibRomTag =
  46. {
  47.   RTC_MATCHWORD,
  48.   &LibRomTag,
  49.   (APTR)_LibInit,
  50.   RTF_AUTOINIT,
  51.   VERSION,
  52.   NT_DEVICE,
  53.   0,
  54.   _DevName,
  55.   VSTRING,
  56.   (APTR)&_LibInitTab,
  57. };
  58.  
  59. static const APTR _LibFuncTable[] =
  60. {
  61.   (APTR) _DevOpen,
  62.   (APTR) _DevClose,
  63.   (APTR) _DevExpunge,
  64.   (APTR) _DevRes,
  65.   (APTR) _NetInfoBeginIO,
  66.   (APTR) _NetInfoAbortIO,
  67.   (APTR)-1,
  68. };
  69.  
  70. const LONG __far _LibInitTab[] =  {
  71.   NETINFOSIZE,
  72.   (LONG)_LibFuncTable,
  73.   NULL,                        /* will initialize my own data */
  74.   (LONG)_LibInit,
  75. };
  76.  
  77. const UBYTE _DevName[] = "netinfo.device";
  78.  
  79. /*
  80.  * Device initialization routine
  81.  * 
  82.  * Called after device has been allocated.
  83.  * This routine is single threaded
  84.  *
  85.  * return pointer to device when successful, NULL otherwise
  86.  */
  87. SAVEDS ASM ULONG _LibInit(REG(a0) APTR seglist, 
  88.               REG(d0) struct Library *devbase)
  89. {
  90.   /* init. library structure (since I don't do automatic data init.) */
  91.   devbase->lib_Node.ln_Type = NT_LIBRARY;
  92.   devbase->lib_Node.ln_Name =  (STRPTR)_DevName;
  93.   devbase->lib_Flags = LIBF_SUMUSED | LIBF_CHANGED;
  94.   devbase->lib_Version = VERSION;
  95.   devbase->lib_Revision = REVISION;
  96.   devbase->lib_IdString = (APTR) VSTRING;
  97.  
  98.   return _DevInit((struct NetInfoDevice*)devbase, seglist);
  99. }
  100.  
  101.