export.pas 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. This unit implements an uniform export object
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************}
  17. unit export;
  18. interface
  19. uses
  20. cobjects;
  21. type
  22. pexported_procedure = ^texported_procedure;
  23. texported_procedure = object(tlinkedlist_item)
  24. ordnr : word;
  25. name,func : pstring;
  26. lab : pointer; { should be plabel, but this gaves problems with circular units }
  27. constructor init(const n,s : string;o : word);
  28. destructor done;virtual;
  29. end;
  30. pexportlib=^texportlib;
  31. texportlib=object
  32. constructor Init;
  33. destructor Done;
  34. procedure preparelib(const s:string);virtual;
  35. procedure exportprocedure(const func:string;index:longint;const name:string);virtual;
  36. procedure generatelib;virtual;
  37. end;
  38. var
  39. exportlib : pexportlib;
  40. procedure InitExport;
  41. procedure DoneExport;
  42. implementation
  43. uses
  44. systems,verbose,globals
  45. {$ifdef i386}
  46. ,os2_targ
  47. ,win_targ
  48. {$endif}
  49. ,lin_targ
  50. ;
  51. {****************************************************************************
  52. TImported_procedure
  53. ****************************************************************************}
  54. constructor texported_procedure.init(const n,s : string;o : word);
  55. begin
  56. inherited init;
  57. func:=stringdup(n);
  58. name:=stringdup(s);
  59. ordnr:=o;
  60. lab:=nil;
  61. end;
  62. destructor texported_procedure.done;
  63. begin
  64. stringdispose(name);
  65. inherited done;
  66. end;
  67. {****************************************************************************
  68. TImportLib
  69. ****************************************************************************}
  70. constructor texportlib.Init;
  71. begin
  72. end;
  73. destructor texportlib.Done;
  74. begin
  75. end;
  76. procedure texportlib.preparelib(const s:string);
  77. begin
  78. Message(exec_e_dll_not_supported);
  79. end;
  80. procedure texportlib.exportprocedure(const func : string;index:longint;const name:string);
  81. begin
  82. Message(exec_e_dll_not_supported);
  83. end;
  84. procedure texportlib.generatelib;
  85. begin
  86. Message(exec_e_dll_not_supported);
  87. end;
  88. procedure DoneExport;
  89. begin
  90. if assigned(exportlib) then
  91. dispose(exportlib,done);
  92. end;
  93. procedure InitExport;
  94. begin
  95. case target_info.target of
  96. {$ifdef i386}
  97. { target_i386_Linux :
  98. importlib:=new(pimportliblinux,Init);
  99. }
  100. target_i386_Win32 :
  101. exportlib:=new(pexportlibwin32,Init);
  102. {
  103. target_i386_OS2 :
  104. exportlib:=new(pexportlibos2,Init);
  105. }
  106. {$endif i386}
  107. {$ifdef m68k}
  108. {
  109. target_m68k_Linux :
  110. importlib:=new(pimportliblinux,Init);
  111. }
  112. {$endif m68k}
  113. else
  114. exportlib:=new(pexportlib,Init);
  115. end;
  116. end;
  117. end.
  118. {
  119. $Log$
  120. Revision 1.1 1998-10-27 10:22:34 florian
  121. + First things for win32 export sections
  122. }