649 #define POOL_HANDLE_T |
651 #define POOL_HANDLE_T |
650 typedef void *pool_handle_t; |
652 typedef void *pool_handle_t; |
651 #endif |
653 #endif |
652 |
654 |
653 #ifndef SEMAPHORE_T |
655 #ifndef SEMAPHORE_T |
654 typedef void *SEMAPHORE; |
656 // TODO: fix |
655 #define SEMAPHORE_T void * |
657 //typedef void *SEMAPHORE; |
|
658 //#define SEMAPHORE_T void * |
656 #endif /* !SEMAPHORE_T */ |
659 #endif /* !SEMAPHORE_T */ |
657 |
660 |
658 #define SESSION_HASHSIZE 5 |
661 #define SESSION_HASHSIZE 5 |
659 |
662 |
660 typedef struct PListStruct_s PListStruct_s; |
663 typedef struct PListStruct_s PListStruct_s; |
697 |
700 |
698 /* |
701 /* |
699 * FuncPtr is a pointer to an NSAPI SAF function |
702 * FuncPtr is a pointer to an NSAPI SAF function |
700 */ |
703 */ |
701 |
704 |
|
705 // TODO: fix typedefs |
702 #ifdef XP_UNIX |
706 #ifdef XP_UNIX |
703 typedef int Func(pblock *, Session *, Request *); |
707 typedef int Func(pblock *, Session *, Request *); |
704 // new func executor |
708 // new func executor |
705 typedef int FuncExec(FuncStruct *, pblock *, Session *, Request *); |
709 typedef int FuncExec(FuncStruct *, pblock *, Session *, Request *); |
706 #else /* XP_WIN32 */ |
710 #else /* XP_WIN32 */ |
707 typedef int _cdecl Func(pblock *, Session *, Request *); |
711 typedef int _cdecl Func(pblock *, Session *, Request *); |
708 typedef int _cdecl uncExec(FuncStruct *, pblock *, Session *, Request *); |
712 typedef int _cdecl FuncExec(FuncStruct *, pblock *, Session *, Request *); |
709 #endif /* XP_WIN32 */ |
713 #endif /* XP_WIN32 */ |
710 |
714 |
711 typedef Func *FuncPtr; |
715 typedef Func *FuncPtr; |
712 typedef FuncExec *FuncExecPtr; |
716 typedef FuncExec *FuncExecPtr; |
713 |
717 |
857 SYS_FILE fd; /* internal use: file descriptor for region */ |
861 SYS_FILE fd; /* internal use: file descriptor for region */ |
858 }; |
862 }; |
859 |
863 |
860 /* Define a handle for a thread */ |
864 /* Define a handle for a thread */ |
861 //typedef void* SYS_THREAD; |
865 //typedef void* SYS_THREAD; |
|
866 |
|
867 #ifdef XP_UNIX |
862 typedef pthread_t SYS_THREAD; |
868 typedef pthread_t SYS_THREAD; |
|
869 #else |
|
870 typedef void* SYS_THREAD; |
|
871 #endif |
863 |
872 |
864 /* Define an error value for the thread handle */ |
873 /* Define an error value for the thread handle */ |
865 #define SYS_THREAD_ERROR NULL |
874 #define SYS_THREAD_ERROR NULL |
866 |
875 |
867 |
876 |
1532 |
1541 |
1533 #define SYS_STDERR STDERR_FILENO |
1542 #define SYS_STDERR STDERR_FILENO |
1534 |
1543 |
1535 #ifdef XP_WIN32 |
1544 #ifdef XP_WIN32 |
1536 |
1545 |
1537 typedef HANDLE pid_t; |
1546 //typedef HANDLE pid_t; // TODO |
1538 |
1547 |
1539 #define ERROR_PIPE \ |
1548 #define ERROR_PIPE \ |
1540 (ERROR_BROKEN_PIPE | ERROR_BAD_PIPE | \ |
1549 (ERROR_BROKEN_PIPE | ERROR_BAD_PIPE | \ |
1541 ERROR_PIPE_BUSY | ERROR_PIPE_LISTENING | ERROR_PIPE_NOT_CONNECTED) |
1550 ERROR_PIPE_BUSY | ERROR_PIPE_LISTENING | ERROR_PIPE_NOT_CONNECTED) |
1542 #define CONVERT_TO_PRINTABLE_FORMAT(Filename) \ |
1551 #define CONVERT_TO_PRINTABLE_FORMAT(Filename) \ |
1555 if ( *s == '/') \ |
1564 if ( *s == '/') \ |
1556 *s = '\\'; \ |
1565 *s = '\\'; \ |
1557 } |
1566 } |
1558 |
1567 |
1559 #ifdef INTNSAPI |
1568 #ifdef INTNSAPI |
1560 NSAPI_PUBLIC extern nsapi_dispatch_t *__nsapi30_table; |
1569 //NSAPI_PUBLIC extern nsapi_dispatch_t *__nsapi30_table; |
1561 #if NSAPI_VERSION >= 302 |
1570 #if NSAPI_VERSION >= 302 |
1562 NSAPI_PUBLIC extern nsapi302_dispatch_t *__nsapi302_table; |
1571 //NSAPI_PUBLIC extern nsapi302_dispatch_t *__nsapi302_table; |
1563 #endif /* NSAPI_VERSION >= 302 */ |
1572 #endif /* NSAPI_VERSION >= 302 */ |
1564 #if NSAPI_VERSION >= 303 |
1573 #if NSAPI_VERSION >= 303 |
1565 NSAPI_PUBLIC extern nsapi303_dispatch_t *__nsapi303_table; |
1574 //NSAPI_PUBLIC extern nsapi303_dispatch_t *__nsapi303_table; |
1566 #endif /* NSAPI_VERSION >= 303 */ |
1575 #endif /* NSAPI_VERSION >= 303 */ |
1567 #else |
1576 #else |
1568 __declspec(dllimport) nsapi_dispatch_t *__nsapi30_table; |
1577 //__declspec(dllimport) nsapi_dispatch_t *__nsapi30_table; |
1569 #if NSAPI_VERSION >= 302 |
1578 #if NSAPI_VERSION >= 302 |
1570 __declspec(dllimport) nsapi302_dispatch_t *__nsapi302_table; |
1579 //__declspec(dllimport) nsapi302_dispatch_t *__nsapi302_table; |
1571 #endif /* NSAPI_VERSION >= 302 */ |
1580 #endif /* NSAPI_VERSION >= 302 */ |
1572 #if NSAPI_VERSION >= 303 |
1581 #if NSAPI_VERSION >= 303 |
1573 __declspec(dllimport) nsapi303_dispatch_t *__nsapi303_table; |
1582 //__declspec(dllimport) nsapi303_dispatch_t *__nsapi303_table; |
1574 #endif /* NSAPI_VERSION >= 303 */ |
1583 #endif /* NSAPI_VERSION >= 303 */ |
1575 #endif /* INTNSAPI */ |
1584 #endif /* INTNSAPI */ |
1576 |
1585 |
1577 #else /* !XP_WIN32 */ |
1586 #else /* !XP_WIN32 */ |
1578 |
1587 |