home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / plbin.zip / pl / include / stub.c < prev    next >
C/C++ Source or Header  |  1992-07-17  |  2KB  |  44 lines

  1. /*  stub.c,v 1.1 1992/07/17 12:40:36 jan Exp
  2.  
  3.     Copyright (c) 1991 Jan Wielemaker. All rights reserved.
  4.     jan@swi.psy.uva.nl
  5.  
  6.     Purpose: Skeleton for extensions
  7. */
  8.  
  9. #include <stdio.h>
  10. #include <SWI-Prolog.h>
  11.  
  12. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13. C-extension   can  either  be   loaded  through the   foreign language
  14. interface  implemented   by   load_foreign/[1,2,5]  or  through static
  15. linking.  The latter  mechanism  is  to be  used if  the first is  not
  16. ported to your machine/operating system.  Static linking is also to be
  17. preferred  for large   applications   as  it  puts  the   text  in the
  18. text-section of the (unix) process rather  than te  data section.  The
  19. text-section  of  a  process  is  normally write-protected  (providing
  20. better protection) and shared between multiple copies of the program.
  21.  
  22. To create a statically linked executable, perform the following steps:
  23.  
  24.   1) Make the file `pl.o' containing all of SWI-Prolog using
  25.      `make pl.o' in the machine-directory and install it.
  26.   2) Make a copy of this file.  In this copy:
  27.   3) Put the right #include directives
  28.   4) Fill the table below.  
  29.   5) Link pl.o with this file and the .o files defining your application.
  30.      USE STATIC LINKING!!!
  31.  
  32. If there are prolog parts involved:
  33.  
  34.   6) Start the image; load the prolog and create a state using
  35.      save_program/2.
  36. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37.  
  38. PL_extension PL_extensions [] =
  39. {
  40. /*{ "name",    arity,  function,    PL_FA_<flags> },*/
  41.  
  42.   { NULL,    0,     NULL,        0 }    /* terminating line */
  43. };
  44.