"Fossies" - the Fresh Open Source Software Archive

Member "nss_ldap-265/tests/testd.c" (6 Nov 2009, 680 Bytes) of package /linux/privat/old/nss_ldap-265.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 #import <lber.h>
    3 #import <ldap.h>
    4 #import "ldap-nss.h"
    5 #import "util.h"
    6 #import "dnsconfig.h"
    7 
    8 void
    9 printcf (ldap_config_t * cf)
   10 {
   11   printf ("host %s\n", cf->ldc_host);
   12   printf ("port %d\n", cf->ldc_port);
   13   printf ("base %s\n", cf->ldc_base);
   14 #if 0
   15   char *ldc_host;
   16   int ldc_port;
   17   char *ldc_base;
   18   int ldc_scope;
   19   char *ldc_binddn;
   20   char *ldc_bindpw;
   21   struct ldap_config *ldc_next;
   22 #endif
   23 }
   24 
   25 void
   26 main (void)
   27 {
   28 /*
   29    NSS_STATUS _nss_ldap_readconfigfromdns(
   30    ldap_config_t *result,
   31    char *buf,
   32    size_t buflen
   33  */
   34   ldap_config_t cf;
   35   char buf[1024];
   36 
   37   _nss_ldap_readconfigfromdns (&cf, buf, sizeof (buf));
   38   printcf (&cf);
   39   printcf (cf.ldc_next);
   40   exit (0);
   41 }