CVS update: /ccvs/windows-NT/
[email protected] 31 May 2005 02:08:28 -0000
| Newsgroups | gmane.comp.version-control.cvs.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: conradpino Date: 05/05/30 19:08:28 Modified: /ccvs/windows-NT/ ChangeLog, config.h.in.footer, config.h.in.in, pwd.c, unistd.h, woe32.c Log: * woe32.h: Create header file with ANSI style function prototypes. * woe32.c: Use "woe32.h" header and ANSI style function prototypes. Use minimal #include file set (#include "cvs.h" dropped). Rename: function "init_winsock" to "woe32_init_winsock" function "wnt_cleanup" to "woe32_cleanup" function "nanosleep" to "woe32_nanosleep" function "win32getlogin" to "woe32_getlogin" Change function "sleep" return type to "unsigned int" was "unsigned". * unistd.h: Move function (getpass,getpid,sleep) prototypes here. * config.h.in.footer: Update 2 macros for the above changes: #define SYSTEM_CLEANUP woe32_cleanup #define SYSTEM_INITIALIZE(pargc,pargv) woe32_init_winsock() Use "woe32.h" header file and remove function prototypes: pid_t getpid (void); void init_winsock (void); unsigned int sleep (unsigned int); void wnt_cleanup (void); * config.h.in.in: Modify 3 macros: #define HAVE_DECL_GETPASS 1 /* was 0 */ #define HAVE_DECL_NANOSLEEP 1 /* was #undef */ #define nanosleep woe32_nanosleep /* was #undef */ * pwd.c: Update to use "woe32.h" and renamed "woe32.c" function. File Changes: Directory: /ccvs/windows-NT/ ============================ File [changed]: ChangeLog Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/ChangeLog?r1=1.309&r2=1.310 Delta lines: +25 -0 -------------------- --- ChangeLog 28 May 2005 22:40:02 -0000 1.309 +++ ChangeLog 31 May 2005 02:08:25 -0000 1.310 @@ -1,3 +1,28 @@ +2005-05-30 Conrad T. Pino <[email protected]> + + * woe32.h: Create header file with ANSI style function prototypes. + * woe32.c: Use "woe32.h" header and ANSI style function prototypes. + Use minimal #include file set (#include "cvs.h" dropped). Rename: + function "init_winsock" to "woe32_init_winsock" + function "wnt_cleanup" to "woe32_cleanup" + function "nanosleep" to "woe32_nanosleep" + function "win32getlogin" to "woe32_getlogin" + Change function "sleep" return type to "unsigned int" was "unsigned". + * unistd.h: Move function (getpass,getpid,sleep) prototypes here. + * config.h.in.footer: Update 2 macros for the above changes: + #define SYSTEM_CLEANUP woe32_cleanup + #define SYSTEM_INITIALIZE(pargc,pargv) woe32_init_winsock() + Use "woe32.h" header file and remove function prototypes: + pid_t getpid (void); + void init_winsock (void); + unsigned int sleep (unsigned int); + void wnt_cleanup (void); + * config.h.in.in: Modify 3 macros: + #define HAVE_DECL_GETPASS 1 /* was 0 */ + #define HAVE_DECL_NANOSLEEP 1 /* was #undef */ + #define nanosleep woe32_nanosleep /* was #undef */ + * pwd.c: Update to use "woe32.h" and renamed "woe32.c" function. + 2005-05-28 Derek Price <[email protected]> * config.h.in.in (MISSING_SYS_CDEFS_H): Rename... File [changed]: config.h.in.footer Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/config.h.in.footer?r1=1.5&r2=1.6 Delta lines: +3 -13 -------------------- --- config.h.in.footer 26 May 2005 08:40:47 -0000 1.5 +++ config.h.in.footer 31 May 2005 02:08:26 -0000 1.6 @@ -60,10 +60,10 @@ #define START_SERVER_RETURNS_SOCKET 1 /* Macro name tells the story */ -#define SYSTEM_CLEANUP wnt_cleanup +#define SYSTEM_CLEANUP woe32_cleanup /* Macro name tells the story */ -#define SYSTEM_INITIALIZE(pargc,pargv) init_winsock() +#define SYSTEM_INITIALIZE(pargc,pargv) woe32_init_winsock() /* Is this true on NT? Seems like I remember reports that NT 3.51 has problems with 200K writes (of course, the issue of large writes is @@ -93,21 +93,11 @@ /* ====================== Function Prototypes Follow ====================== */ -/* This is just a call to GetCurrentProcessID. */ -pid_t getpid (void); - -/* #define SYSTEM_INITIALIZE(pargc,pargv) init_winsock() */ -void init_winsock (void); +#include <woe32.h> /* #define SOCK_STRERROR sock_strerror */ char *sock_strerror (int errnum); -/* This is just a call to the Win32 Sleep function. */ -unsigned int sleep (unsigned int); - -/* #define SYSTEM_CLEANUP wnt_cleanup */ -void wnt_cleanup (void); - /* #define CVS_MKDIR wnt_mkdir */ int wnt_mkdir (const char *PATH, int MODE); File [changed]: config.h.in.in Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/config.h.in.in?r1=1.34&r2=1.35 Delta lines: +3 -3 ------------------- --- config.h.in.in 28 May 2005 22:40:02 -0000 1.34 +++ config.h.in.in 31 May 2005 02:08:26 -0000 1.35 @@ -222,7 +222,7 @@ /* Define to 1 if you have the declaration of `getpass', and to 0 if you don't. */ -#define HAVE_DECL_GETPASS 0 +#define HAVE_DECL_GETPASS 1 /* Define to 1 if you have the declaration of `memrchr', and to 0 if you don't. */ @@ -230,7 +230,7 @@ /* Define to 1 if you have the declaration of `nanosleep', and to 0 if you don't. */ -#undef HAVE_DECL_NANOSLEEP +#define HAVE_DECL_NANOSLEEP 1 /* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if you don't. */ @@ -1161,7 +1161,7 @@ #define my_strftime nstrftime /* Define to rpl_nanosleep if the replacement function should be used. */ -#undef nanosleep +#define nanosleep woe32_nanosleep /* Define to `int' if <sys/types.h> does not define. */ #define pid_t int File [changed]: pwd.c Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/pwd.c?r1=1.9&r2=1.10 Delta lines: +3 -2 ------------------- --- pwd.c 26 May 2005 16:40:00 -0000 1.9 +++ pwd.c 31 May 2005 02:08:26 -0000 1.10 @@ -23,7 +23,8 @@ #include <pwd.h> #include "xalloc.h" -char* win32getlogin(); +#include "woe32.h" + static char *lookup_env (char **); /* where people might scribble their name into the environment ... */ @@ -94,7 +95,7 @@ /* In the absence of user override, ask the operating system. */ if (!login) - login = win32getlogin(); + login = woe32_getlogin (); /* If all else fails, fall back on Old Faithful. */ if (!login) File [changed]: unistd.h Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/unistd.h?r1=1.5&r2=1.6 Delta lines: +8 -2 ------------------- --- unistd.h 26 May 2005 08:40:47 -0000 1.5 +++ unistd.h 31 May 2005 02:08:26 -0000 1.6 @@ -27,8 +27,15 @@ /* include Microsoft's close, dup */ #include <io.h> -/* This function doesn't exist under Windows NT; we provide a stub */ +#ifndef pid_t +#define pid_t int +#endif /* pid_t */ + +/* These functions doesn't exist under Windows NT; we provide stubs */ +char * getpass (const char *prompt); +pid_t getpid (void); int readlink (const char *path, char *buf, size_t buf_size); +unsigned int sleep (unsigned int seconds); /* FIXME: gethostname prototype for lib/xgethostname.c, no #include <winsock.h> @@ -80,7 +87,6 @@ pid_t waitpid (pid_t pid, int *status, int options); void _exit (int status); int kill (pid_t pid, int sig); -unsigned int sleep (unsigned int seconds); int pause (void); unsigned int alarm (unsigned int seconds); int setuid (uid_t uid); File [changed]: woe32.c Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/woe32.c?r1=1.5&r2=1.6 Delta lines: +25 -13 --------------------- --- woe32.c 14 May 2004 19:07:32 -0000 1.5 +++ woe32.c 31 May 2005 02:08:26 -0000 1.6 @@ -1,25 +1,29 @@ /* - * win32.c + * woe32.c * - utility functions for cvs under win32 * */ #include "config.h" -#include <ctype.h> +#include "woe32.h" + #include <stdio.h> #include <conio.h> +/* function prototypes: getpass, getpid, sleep */ +#include <unistd.h> + #define WIN32_LEAN_AND_MEAN -#include <windows.h> +#include <winsock.h> /* This does: #include <windows.h> */ -#include <winsock.h> #include <stdlib.h> -#include "cvs.h" + +/* #define SYSTEM_INITIALIZE(pargc,pargv) woe32_init_winsock() */ void -init_winsock () +woe32_init_winsock (void) { WSADATA data; @@ -30,8 +34,11 @@ } } + + +/* #define SYSTEM_CLEANUP woe32_cleanup */ void -wnt_cleanup (void) +woe32_cleanup (void) { if (WSACleanup ()) { @@ -51,7 +58,7 @@ -unsigned sleep(unsigned seconds) +unsigned int sleep (unsigned seconds) { Sleep(1000*seconds); return 0; @@ -75,8 +82,9 @@ +/* #define nanosleep woe32_nanosleep */ int -nanosleep (const struct timespec *requested_delay, +woe32_nanosleep (const struct timespec *requested_delay, struct timespec *remaining_delay) { return my_usleep (requested_delay); @@ -84,10 +92,11 @@ -char *win32getlogin() +char * +woe32_getlogin (void) { static char name[256]; - DWORD dw = 256; + DWORD dw = sizeof (name); GetUserName (name, &dw); if (name[0] == '\0') return NULL; @@ -96,12 +105,15 @@ } +/* This is just a call to GetCurrentProcessID */ pid_t -getpid () +getpid (void) { return (pid_t) GetCurrentProcessId(); } + + char * getpass (const char *prompt) {