home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 12861 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  1.9 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!dtix!mimsy!afterlife!adm!news
  2. From: daniel@gemme.u-strasbg.fr (STOEFFLER Daniel)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Pointing on a Pascal subroutine
  5. Message-ID: <32194@adm.brl.mil>
  6. Date: 25 Aug 92 19:30:03 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 51
  9.  
  10. I have to give a pointer pointing on a Pascal procedure to a C function
  11. which calls XDR procedure: the XDR procedure needs a pointer pointing
  12. on my Pascal procedure. How can I do this ?
  13. In the last version of the Pascal doc it seems possible to use pointers
  14. on functions and procedures but I was not able to make it working.
  15. Example:
  16.  
  17. { the C function declared as external }
  18. procedure Service(var proc_ptr:pointer); external;
  19.  
  20. { the program containing the procedure Calcule_dens which I want
  21.   to call in the XDR procedure }
  22.  
  23. program ...
  24.  
  25. { declaration of the procedure pointer }
  26. var     proc_ptr:^procedure;
  27.  
  28. { procedures }   
  29.  
  30. ...
  31. procedure Calcule_dens;
  32. ...
  33. ...
  34.  
  35. { main }
  36.         { allocation of the pointer }
  37.         proc_ptr:=addr(calcule_dens);
  38.         ...
  39.     { the call of the C function }
  40.         Service(proc_ptr);
  41.         ...
  42. { end of the program }
  43.  
  44. At the compilation I obtain:
  45.         Service(proc_ptr); 
  46.                         ^
  47.       Parameter type does not agree with declaration 
  48.  
  49. What is the problem and how can I solve it ?
  50. Thank in advance.
  51. STOEFFLER Daniel                daniel@gemme.u-strasbg.fr
  52.  o   ___    __            __            ___    ___                   ___
  53.  |   |  \  /  \  |\  /|  /  \          /   \  |     |\  /|  |\  /|  |
  54.  |   |__/  |     | \/ |  \__    ####   |  _   |__   | \/ |  | \/ |  |__
  55.  |   |     |     |    |     \   ####   | | |  |     |    |  |    |  |
  56.  |   |     \__/  |    |  \__/          \___/  |___  |    |  |    |  |___
  57.  
  58. INSTITUT de PHYSIQUE et de CHIMIE DE STRASBOURG        4, rue Blaise Pascal
  59. GROUPE d'ETUDES des MATERIAUX METALLIQUES        67070 Strasbourg, France
  60.     Structure Electronique et Magnetisme de Structures Artificielles
  61.