home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / apollo / 3324 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.2 KB  |  51 lines

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!cel.cummins.com!philip
  2. From: philip@cel.cummins.com (Philip D. Pokorny)
  3. Newsgroups: comp.sys.apollo
  4. Subject: Re: Node ID from C
  5. Message-ID: <9208201514.AA02375@cel.cummins.com>
  6. Date: 20 Aug 92 15:14:26 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 39
  11.  
  12. Greg Pritchett writes:
  13. > I have used the following in the past. Unfortunately, it's not
  14. > documented ( or supported ! ) . It used to work on a flat 10.0
  15. > and I've just tested it on a 10.3.5 machine , so I guess it will
  16. > work on your 10.3. Hope this helps . . . 
  17. > extern std_$call void msg_$get_my_node();
  18.          ^^^^^^^^^
  19. DANGER  DANGER  DANGER  This interface is no-longer recommended
  20. The newer and better way to declare this is to use ANSI
  21. prototypes (if you have C 6.8) and the Reference Variable
  22. extension borrowed from C++:
  23.  
  24.    extern void msg_$get_my_node( long &node_id );
  25.  
  26. > main ()
  27. > {
  28. > long node_id;
  29. > msg_$get_my_node ( node_id );
  30. > printf ("Node id %X\n", node_id );
  31.                    ^^     ^^^^^^^
  32. Type mis-match...  This should be:
  33.  
  34.   printf( "Node id: %lX\n", node_id );
  35.  
  36. > }
  37.  
  38. Neat call...  I'll have to file this one away...
  39.  
  40. Sincerely,
  41. Philip D. Pokorny
  42. philip@cel.cummins.com
  43. :)
  44.  
  45.