anonymous.c

This is an example of doing an anonymous bind.

To compile this example on Unix:

  cc -I /opt/isode/include -c anonymous.c 
  

To compile this example on Windows:

  cl /nologo /I C:\Progra~1\Isode\include /c anonymous.c
  

To link this example on Unix:

  cc -o anonymous anonymous.o -L/opt/isode/lib \
      -ldua -lisode -libase -lldap -llber -lisode_ssl \
      -lisode_crypto -lpthread
  

To link this example on Windows:

  cl /nologo /o anonymous.exe anonymous.obj \
      C:\Progra~1\Isode\bin\libdua.lib
  

00001 /* 
00002  * Copyright (c) 2005-2006, Isode Limited, London, England.
00003  * All rights reserved.
00004  * 
00005  * Acquisition and use of this software and related materials for any
00006  * purpose requires a written licence agreement from Isode Limited,
00007  * or a written licence from an organisation licenced by Isode Limited
00008  * to grant such a licence.
00009  */
00010 #include <stdio.h>
00011 
00012 #include <isode/ds/dsapi/dsapi.h>
00013 
00022 int main ( void )
00023 {
00024     DS_Session *ds;
00025     DS_Status   status;
00026 
00027     status = DS_Initialize( );
00028     if ( status != DS_E_NOERROR ) {
00029         fprintf( stderr, "Initialization failed\n" );
00030         return 1;
00031     }
00032     
00033     status = DS_BindSync_Anonymous( "Internet=localhost+19999", &ds );
00034     if ( status != DS_E_NOERROR ) {
00035         fprintf( stderr, "Bind failed\n" );
00036         return 1;
00037     }
00038     
00039     DS_UnbindSync( &ds );
00040     return 0;
00041 }
Copyright © 2008 Isode privacy   feedback Subscribe to our rss newsfeed