Back to index

lightning-sunbird  0.9+nobinonly
ldap-macos.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Communicator client code, released
00015  * March 31, 1998.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 /*
00038  * macos.h: bridge unix and Mac for  LBER/LDAP
00039  */
00040 #ifndef __LDAP_MACOS_H__
00041 #define __LDAP_MACOS_H__
00042 #if 0
00043               /*------------------*/
00044               #define ntohl( l )   (l)
00045               #define htonl( l )   (l)
00046               #define ntohs( s )   (s)
00047               #define htons( s )   (s)
00048               /*------------------*/
00049 #endif
00050 
00051 #define NSLDAPI_AVOID_OS_SOCKETS
00052 
00053 #ifdef NO_GLOBALS
00054 
00055 #ifdef macintosh     /* IUMagIDString declared in TextUtils.h under MPW */
00056 #include <TextUtils.h>
00057 #else /* macintosh */       /* IUMagIDString declared in Packages.h under ThinkC */
00058 #include <Packages.h>
00059 #endif /* macintosh */
00060 
00061 #define strcasecmp( s1, s2 )       IUMagIDString( s1, s2, strlen( s1 ), \
00062                                    strlen( s2 ))
00063 #else /* NO_GLOBALS */
00064 int strcasecmp(  const char *s1,  const char *s2 );
00065 int strncasecmp(  const char *s1,  const char *s2,  const long n );
00066 #endif NO_GLOBALS
00067 
00068 #include <Memory.h>  /* to get BlockMove() */
00069 
00070 char *strdup( const char *s );
00071 
00072 #ifndef isascii
00073 #define isascii(c)   ((unsigned)(c)<=0177)       /* for those who don't have this in ctype.h */
00074 #endif isascii
00075 
00076 /*
00077  * if we aren't supporting OpenTransport, we need to define some standard "errno" values here
00078  * the values should match those in OpenTransport.h
00079  */
00080 #if !defined( SUPPORT_OPENTRANSPORT )
00081 #define EHOSTUNREACH 65     /* No route to host */
00082 #define EAGAIN              11     /* Resource temporarily unavailable */
00083 #define EWOULDBLOCK  35     /* ditto */
00084 #endif
00085 
00086 int getopt(int nargc, char **nargv, char *ostr);
00087 
00088 #include <time.h>
00089 #include <stdlib.h>
00090 
00091 #include "macsocket.h"
00092 #include "tcp.h"
00093 #if 0
00094               /*------------------*/
00095               #ifndef AF_INET
00096               /* these next few things are defined only for use by the LDAP socket I/O function callbacks */
00097               #define AF_INET                    2
00098               #define SOCK_STREAM         1
00099               struct in_addr {
00100                      unsigned long s_addr;
00101               };
00102               struct sockaddr_in {
00103                      short                sin_family;
00104                      unsigned short       sin_port;
00105                      struct in_addr       sin_addr;
00106                      char                 sin_zero[8];
00107               };
00108               #endif
00109               /*------------------*/
00110 #endif
00111 
00112 
00113 #endif /* __LDAP_MACOS_H__ */