home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 3 / CD_Magazyn_EXEC_nr_3.iso / Recent / misc / edu / WhirlDisc.lha / WhirlDisc / Source / reference.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-11  |  1.4 KB  |  70 lines

  1. /*
  2.  
  3. File: reference.c
  4. Author: Neil Cafferkey
  5. Copyright (C) 2000 Neil Cafferkey
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  20. MA 02111-1307, USA.
  21.  
  22. */
  23.  
  24. #include "viewer.h"
  25. #include <exec/memory.h>
  26.  
  27. #include "reference_protos.h"
  28. #include "general_protos.h"
  29. #include <proto/exec.h>
  30.  
  31.  
  32. /* Function: CreateReference
  33.  * =========================
  34.  * Creates an reference.
  35.  */
  36.  
  37. Reference CreateReference(UBYTE *data)
  38. {
  39.    Reference ref;
  40.  
  41.    ref=AllocMem(sizeof(Reference_imp),MEMF_ANY);
  42.    if(ref!=NULL)
  43.    {
  44.       ref->link_no=GetLittleEndianULong(data);
  45.       ref->node.ln_Name=data+10;
  46.    }
  47.    else
  48.    {
  49.       ReportError(NULL,ERROR_REPORT_MEM,NULL,0);
  50.    }
  51.  
  52.    return ref;
  53. }
  54.  
  55.  
  56.  
  57. /* Function: KillReference
  58.  * =======================
  59.  * Destroys an reference.
  60.  */
  61.  
  62. VOID KillReference(Reference reference)
  63. {
  64.    FreeMem(reference,sizeof(Reference_imp));
  65.    return;
  66. }
  67.  
  68.  
  69.  
  70.