Retrochallenge 2009
      Mark Wickens
      8-Jan-2009 20:16
                                        Programming 1

      My first steps to remembering programming in C on OpenVMS. I'm lucky in that I
      recently managed to get hold of virtually a full set of OpenVMS manuals from
      someone who was getting rid of them. That's about 6 feet of manuals piled on top
      of each other! You cant beat books for the pick-up and read appeal and I'm a
      great believer in printed manuals. My initial struggles with getting up to speed
      again with the OpenVMS-specifics reminded me of my early days of programming on
      OpenVMS back in 1991. I'm at a distinct advantage this time, however, having
      printed manuals to refer to. I don't remember the exact model of my workstation,
      but it was a VAXstation 3100 of some description with a 19" monochrome monitor
      and a one-bit display! Yes, that's right - either black or white!

      So, I wanted to experiment with the LBR$ routines that support access of records
      within various types of libraries created with the Librarian utility. My initial
      thoughts were that I could store the mappings between the name of the machine
      connected to a port of my power controller to the port number that the IO
      controller uses to reference that port. I think maybe using the Librarian may be
      complete overkill, but it was useful to get into how to access header files
      again.

      Header files for the C programming language are stored themselves within text
      libraries on OpenVMS. To get a listing of the modules (in library-speak) stored
      within the library you have to use a command such as:

      $ library/list=sys$starlet_c.lis sys$library:sys$starlet_c.tlb

      To extract an individual header file from the library, you can use the following
      command:

      $ library/extract=lbrdef/output=lbrdef.h sys$library:sys$starlet_c.tlb

      For the LBR$ routines there are two header files:

      lbrdef.h contains the #defines and structure definitions
      lbr$routines.h contains the function prototypes

      It's worth pointing out the system routines contained within the various
      libraries provided by OpenVMS conform to the OpenVMS Calling Standard. The
      languages provided by DIGITAL all conform to the calling standard, meaning that
      the libraries can be called from any language. The downside of this is that the
      library implementation doesn't necessarily fit too well with the way in which
      language-specific libraries are implemented.