home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / os2tk21j / c / samples / tp / link.c__ / link.c
Encoding:
C/C++ Source or Header  |  1993-03-12  |  3.0 KB  |  100 lines

  1. #ifndef lint
  2. static char *sccsid = "@(#)link.c 1.3 1/22/92 16:09:29 [1/26/92] (c)IBM Corp. 1992";
  3. #endif
  4.  
  5. /*
  6.  * This class is adapted from the book
  7.  *   Class Construction in C and C++, Object Oriented Fundamentals
  8.  *   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  9.  * Reprinted with permission.
  10.  */
  11.  
  12. #define link_Class_Source
  13. #include "link.ih"
  14.  
  15. /* ************************************************************ */
  16. SOM_Scope void SOMLINK somInit(link * somSelf)
  17. {
  18.     linkData *somThis = linkGetData(somSelf);
  19.     linkMethodDebug("link", "somInit");
  20.     parent_somInit(somSelf);
  21.  
  22.     _next = 0;
  23.     _previous = 0;
  24.     _contents = 0;
  25. }
  26.  
  27. /* ************************************************************ */
  28. SOM_Scope void SOMLINK somDumpSelfInt(link * somSelf,
  29.                        int level)
  30. {
  31.     linkData *somThis = linkGetData(somSelf);
  32.     linkMethodDebug("link", "somDumpSelfInt");
  33.     parent_somDumpSelfInt(somSelf, level);
  34. }
  35.  
  36. /* ************************************************************ */
  37. SOM_Scope void SOMLINK linkSetNext(link * somSelf,
  38.                     link * nextLink)
  39. {
  40.     linkData *somThis = linkGetData(somSelf);
  41.     linkMethodDebug("link", "linkSetNext");
  42.     _next = nextLink;
  43. }
  44.  
  45. /* ************************************************************ */
  46. SOM_Scope void SOMLINK linkSetPrevious(link * somSelf,
  47.                     link * nextLink)
  48. {
  49.     linkData *somThis = linkGetData(somSelf);
  50.     linkMethodDebug("link", "linkSetPrevious");
  51.     _previous = nextLink;
  52. }
  53.  
  54. /* ************************************************************ */
  55. SOM_Scope void SOMLINK linkSetContents(link * somSelf,
  56.                     baseType * newContents)
  57. {
  58.     linkData *somThis = linkGetData(somSelf);
  59.     linkMethodDebug("link", "linkSetContents");
  60.     _contents = newContents;
  61. }
  62.  
  63. /* ************************************************************ */
  64. SOM_Scope link *SOMLINK linkGetNext(link * somSelf)
  65. {
  66.     linkData *somThis = linkGetData(somSelf);
  67.     linkMethodDebug("link", "linkGetNext");
  68.     return (_next);
  69. }
  70.  
  71. /* ************************************************************ */
  72. SOM_Scope link *SOMLINK linkGetPrevious(link * somSelf)
  73. {
  74.     linkData *somThis = linkGetData(somSelf);
  75.     linkMethodDebug("link", "linkGetPrevious");
  76.     return (_previous);
  77. }
  78.  
  79. /* ************************************************************ */
  80. SOM_Scope baseType *SOMLINK linkGetContents(link * somSelf)
  81. {
  82.     linkData *somThis = linkGetData(somSelf);
  83.     linkMethodDebug("link", "linkGetContents");
  84.     return (_contents);
  85. }
  86.  
  87. /* ************************************************************ */
  88. SOM_Scope void SOMLINK print(link * somSelf,
  89.                   FILE * outputFile)
  90. {
  91.     linkData *somThis = linkGetData(somSelf);
  92.     linkMethodDebug("link", "print");
  93.     fprintf(outputFile, "\n");
  94.     fprintf(outputFile, "    Link\n");
  95.     fprintf(outputFile, "    self: %x \n", somSelf);
  96.     fprintf(outputFile, "    next: %x \n", _next);
  97.     fprintf(outputFile, "previous: %x\n", _previous);
  98.     fprintf(outputFile, "contents: %x\n", _contents);
  99. }
  100.