Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
ldap-macos.h File Reference
#include <Memory.h>
#include <time.h>
#include <stdlib.h>
#include "macsocket.h"
#include "tcp.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NSLDAPI_AVOID_OS_SOCKETS
#define isascii(c)   ((unsigned)(c)<=0177) /* for those who don't have this in ctype.h */
#define EHOSTUNREACH   65 /* No route to host */
#define EAGAIN   11 /* Resource temporarily unavailable */
#define EWOULDBLOCK   35 /* ditto */

Functions

int strcasecmp (const char *s1, const char *s2)
int strncasecmp (const char *s1, const char *s2, const long n)
char * strdup (const char *s)
int getopt (int nargc, char **nargv, char *ostr)

Define Documentation

#define EAGAIN   11 /* Resource temporarily unavailable */

Definition at line 82 of file ldap-macos.h.

#define EHOSTUNREACH   65 /* No route to host */

Definition at line 81 of file ldap-macos.h.

#define EWOULDBLOCK   35 /* ditto */

Definition at line 83 of file ldap-macos.h.

#define isascii (   c)    ((unsigned)(c)<=0177) /* for those who don't have this in ctype.h */

Definition at line 73 of file ldap-macos.h.

Definition at line 51 of file ldap-macos.h.


Function Documentation

int getopt ( int  nargc,
char **  nargv,
char *  ostr 
)

Definition at line 77 of file getopt.c.

{
       static char *place = EMSG;              /* option letter processing */
       register char *oli;                     /* option letter list index */
       char *p;

       if (!*place) {                          /* update scanning pointer */
              if (optind >= nargc || *(place = nargv[optind]) != '-') {
                     place = EMSG;
                     return(EOF);
              }
              if (place[1] && *++place == '-') {      /* found "--" */
                     ++optind;
                     place = EMSG;
                     return(EOF);
              }
       }                                       /* option letter okay? */
       if ((optopt = (int)*place++) == (int)':' ||
           !(oli = index(ostr, optopt))) {
              /*
               * if the user didn't specify '-' as an option,
               * assume it means EOF.
               */
              if (optopt == (int)'-')
                     return(EOF);
              if (!*place)
                     ++optind;
              if (opterr) {
                     if (!(p = rindex(*nargv, '/')))
                            p = *nargv;
                     else
                            ++p;
                     (void)fprintf(stderr, "%s: illegal option -- %c\n",
                         p, optopt);
              }
              return(BADCH);
       }
       if (*++oli != ':') {                    /* don't need argument */
              optarg = NULL;
              if (!*place)
                     ++optind;
       }
       else {                                  /* need an argument */
              if (*place)                     /* no white space */
                     optarg = place;
              else if (nargc <= ++optind) {   /* no arg */
                     place = EMSG;
                     if (!(p = rindex(*nargv, '/')))
                            p = *nargv;
                     else
                            ++p;
                     if (opterr)
                            (void)fprintf(stderr,
                                "%s: option requires an argument -- %c\n",
                                p, optopt);
                     return(BADCH);
              }
              else                            /* white space */
                     optarg = nargv[optind];
              place = EMSG;
              ++optind;
       }
       return(optopt);                         /* dump back option letter */
}
int strcasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 70 of file InstallCleanupMac.cpp.

{
    char    currentChar1, currentChar2;

    while (1) {
    
        currentChar1 = *str1;
        currentChar2 = *str2;
        
        if ((currentChar1 >= 'a') && (currentChar1 <= 'z'))
            currentChar1 += ('A' - 'a');
        
        if ((currentChar2 >= 'a') && (currentChar2 <= 'z'))
            currentChar2 += ('A' - 'a');
                
        if (currentChar1 == '\0')
            break;
    
        if (currentChar1 != currentChar2)
            return currentChar1 - currentChar2;
            
        str1++;
        str2++;
    
    }
    
    return currentChar1 - currentChar2;
}
char* strdup ( const char *  s)

Definition at line 122 of file strings.c.

{
       char   *r;

       r = (char *) malloc( strlen( p ) + 1 );
       if ( r != NULL ) {
              strcpy( r, p );
       }

       return( r );
}
int strncasecmp ( const char *  s1,
const char *  s2,
const long  n 
)

Definition at line 106 of file strings.c.

{
       register char *cm = charmap;
       register long remain = n;
       
       while (--remain >= 0 && cm[*s1] == cm[*s2++])
              if (*s1++ == '\0')
                     return(0);
       return remain < 0 ? 0 : cm[*s1] - cm[*--s2];
}

Here is the caller graph for this function: