X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tools-for-build%2Fgrovel-headers.c;h=9be87441fbb2632a05a823d29a415139b9b45ef1;hb=77641d60a8b001bf3ccc755f3fb9881ee8d4753f;hp=6e934195f6d2a1c124d5aa685d27a9a595807f1d;hpb=7aef55b130d95c384b63422807f1848faa9aba5a;p=sbcl.git diff --git a/tools-for-build/grovel-headers.c b/tools-for-build/grovel-headers.c index 6e93419..9be8744 100644 --- a/tools-for-build/grovel-headers.c +++ b/tools-for-build/grovel-headers.c @@ -30,6 +30,8 @@ #define WIN32_LEAN_AND_MEAN #include #include + #include + #include #undef boolean #else #include @@ -38,6 +40,7 @@ #include #include #include + #include #include #include #endif @@ -47,6 +50,7 @@ #include #include #include +#include #ifdef LISP_FEATURE_HPUX #include /* for TIOCGPGRP */ @@ -57,12 +61,26 @@ #include #endif +#ifdef _WIN32 + #include "pthreads_win32.h" +#endif + #include "wrap.h" #include "gc.h" #define DEFTYPE(lispname,cname) { cname foo; \ printf("(define-alien-type " lispname " (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); } +#define DEFSTRUCT(lispname,cname,body) { cname bar; \ + printf("(define-alien-type nil\n (struct %s", #lispname); \ + body; \ + printf("))\n"); } +#define DEFSLOT(lispname,cname) \ + printf("\n (%s (%s %d))", \ + #lispname, \ + (((bar.cname=-1)<0) ? "sb!alien:signed" : "unsigned"), \ + (8 * (sizeof bar.cname))) + void defconstant(char* lisp_name, unsigned long unix_number) { @@ -186,12 +204,19 @@ main(int argc, char *argv[]) printf(";;; FormatMessage\n"); - defconstant ("FORMAT_MESSAGE_ALLOCATE_BUFFER", FORMAT_MESSAGE_ALLOCATE_BUFFER); - defconstant ("FORMAT_MESSAGE_FROM_SYSTEM", FORMAT_MESSAGE_FROM_SYSTEM); + defconstant("FORMAT_MESSAGE_ALLOCATE_BUFFER", FORMAT_MESSAGE_ALLOCATE_BUFFER); + defconstant("FORMAT_MESSAGE_FROM_SYSTEM", FORMAT_MESSAGE_FROM_SYSTEM); + defconstant("FORMAT_MESSAGE_MAX_WIDTH_MASK", FORMAT_MESSAGE_MAX_WIDTH_MASK); printf(";;; Errors\n"); - defconstant ("ERROR_ENVVAR_NOT_FOUND", ERROR_ENVVAR_NOT_FOUND); + printf(";;; Errors\n"); + + defconstant("ERROR_ENVVAR_NOT_FOUND", ERROR_ENVVAR_NOT_FOUND); + defconstant("ERROR_ALREADY_EXISTS", ERROR_ALREADY_EXISTS); + defconstant("ERROR_FILE_EXISTS", ERROR_FILE_EXISTS); + defconstant("ERROR_FILE_NOT_FOUND", ERROR_FILE_NOT_FOUND); + defconstant("ERROR_ACCESS_DENIED", ERROR_ACCESS_DENIED); printf(";;; GetComputerName\n"); @@ -237,6 +262,10 @@ main(int argc, char *argv[]) defconstant("STD_OUTPUT_HANDLE", STD_OUTPUT_HANDLE); defconstant("STD_ERROR_HANDLE", STD_ERROR_HANDLE); + printf(";;; WinCrypt\n"); + defconstant("crypt-verifycontext", CRYPT_VERIFYCONTEXT); + defconstant("crypt-silent", CRYPT_SILENT); + defconstant("prov-rsa-full", PROV_RSA_FULL); /* FIXME: SB-UNIX and SB-WIN32 really need to be untangled. */ printf("(in-package \"SB!UNIX\")\n\n"); @@ -489,6 +518,15 @@ main(int argc, char *argv[]) #endif // !WIN32 printf("\n"); + printf(";;; structures\n"); + DEFSTRUCT(timeval, struct timeval, + DEFSLOT(tv-sec, tv_sec); + DEFSLOT(tv-usec, tv_usec)); + DEFSTRUCT(timespec, struct timespec, + DEFSLOT(tv-sec, tv_sec); + DEFSLOT(tv-nsec, tv_nsec)); + printf("\n"); + #ifdef LISP_FEATURE_BSD printf(";;; sysctl(3) names\n"); printf("(in-package \"SB!IMPL\")\n");