VMS Help  —  LDAP  Introduction  LDAP API Use on OpenVMS Systems
    This release of the LDAP API provides support for client
    applications written in C or C++.

    In order to use the LDAP API, a program must use an include
    statement of the form:

    #include <ldap.h>

    The LDAP.H header file includes prototypes and data structures
    for all of the functions that are available in the LDAP API.

    The shareable image LDAP$SHR.EXE includes run-time support for
    LDAP applications. This shareable image resides in SYS$LIBRARY
    and should be included in the library IMAGELIB.OLB, which means
    that no special action is necessary to link or run your programs.
    For example:

      $ type myprog.c

      /* A not very useful program */
      #include <stdio.h>
      #include <ldap.h>
      void main(int argc, char *argv[])
      {
        LDAP *ld;
        if (argc != 2) {
          printf("usage: %s <hostname>\n",argv[0]);
          return;
        }
        ld = ldap_init(argv[1],LDAP_PORT);
        if (ld != NULL) {
          printf("ldap_init returned 0x%p\n",ld);
        } else {
          printf("ldap_init failed\n");
        }
      }

      $ cc myprog
      $ link myprog
      $ myprog :== $mydisk:[mydir]myprog.exe
      $ myprog fred
      ldap_init returned 0xA6748
      $
Close Help