Skip to content
Snippets Groups Projects
config.h 855 B
Newer Older
  • Learn to ignore specific revisions
  • Corentin Chary's avatar
    Corentin Chary committed
    #ifndef CONFIG_H
    # define CONFIG_H
    
    
    # define DEBUG_OUTPUT 0 // change to 1 to enable debugging
    
    
    # define PKCS11PROXY_LISTEN_BACKLOG 128
    
    
    Corentin Chary's avatar
    Corentin Chary committed
    #ifdef __MINGW32__
    
    # include <stdint.h>
    # include <stdlib.h>
    # include <limits.h>
    
    Corentin Chary's avatar
    Corentin Chary committed
    # include <winsock2.h>
    
    Corentin Chary's avatar
    Corentin Chary committed
    
    typedef uint32_t __uid32_t;
    typedef uint32_t __gid32_t;
    typedef uint32_t uid_t;
    
    Corentin Chary's avatar
    Corentin Chary committed
    typedef int socklen_t;
    
    Corentin Chary's avatar
    Corentin Chary committed
    
    struct sockaddr_un {
    	uint16_t sun_family;
    	char sun_path[PATH_MAX];
    };
    
    enum  {
    	SHUT_RD = 0, /* No more receptions.  */
    	SHUT_WR, /* No more transmissions.  */
    	SHUT_RDWR /* No more receptions or transmissions.  */
    };
    
    
    Corentin Chary's avatar
    Corentin Chary committed
    #ifdef  __MINGW32__
    static inline int inet_aton(const char * cp, struct in_addr *pin)
    {
            int rc = inet_addr(cp);
            if (rc == -1 && strcmp(cp, "255.255.255.255"))
                    return 0;
    
            pin->s_addr = rc;
            return 1;
    }
    #endif
    
    
    Corentin Chary's avatar
    Corentin Chary committed
    #endif
    
    #endif	/* CONFIG_H */