[1352] in Moira
Re: moira client code changes of WIN2000
daemon@ATHENA.MIT.EDU (Marc Horowitz)
Mon Feb 14 23:59:58 2000
From: Marc Horowitz <marc@MIT.EDU>
To: "David E. Tanner" <dtanner@MIT.EDU>
Cc: Garry Zacheiss <zacheiss@MIT.EDU>, moiradev@MIT.EDU
Date: 14 Feb 2000 23:59:40 -0500
In-Reply-To: "David E. Tanner"'s message of "Mon, 14 Feb 2000 15:15:59 -0500"
Message-Id: <t53k8k7xdqb.fsf@horowitz.ne.mediaone.net>
"David E. Tanner" <dtanner@MIT.EDU> writes:
>> I hope this helps.
Well, it helped many people in the sipb office laugh uproariously.
But seriously, when porting software across different architectures,
it is best to try to change the code so that one common code base
works on both architectures, rather than simply creating divergence
between the old code and the new platform. Of course, this is not
always possible (for example, UI code), but it is an ideal which can
be closely approached.
For example, in a number of places, the memory management code has
changed, or function signatures have been altered. If the new code is
correct, then it should be run on all platforms, not just on Windows.
Header files and alternate functions should be conditionalized on
feature defines rather than OS names. In a cygwin32 environment,
autoconf should be used to automatically generate the defines.
For example:
#ifndef HAVE_UNISTD_H
#include <unistd.h>
#endif /*HAVE_UNISTD_H*/
or
#ifdef HAVE_STRTOK_R
for (p = strtok_r(addr, ", ", &lasts); p; p = strtok_r(NULL, ",", &lasts))
#else
for (p = strtok(addr, ", "); p; p = strtok(NULL, ","))
#endif /*HAVE_STRTOK_R*/
Another set of diffs which concern me are the places where variables
are casted between different-sized integer types. This is rarely
correct. Often, it indicates that the underlying types or interfaces
are incorrect, and need to be changed. One must be very careful not
to use types which may be incompatible with some other implementation,
such as Alpha machines with long words.
Marc
>>
>> David
>>
>> At 04:16 PM 2/11/2000 -0500, you wrote:
>> >>> I've ported the moira client to the WIN2000 platform. In doing so, I've
>> >>> made changes to the moira client source code. In particular I've made
>> >>> changes to the following source modules:
>> >
>> > I haven't read through your changes carefully yet, so I won't comment
>> >on the content, but it appears you've reversed the sense of the diffs
>> >everyplace; would it be possible for you to resubmit them?
>> >
>> >Garry
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="clients_lib.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\lib/pobox.c moiraw2k\clients\lib/pobox.c
>> *** moiradev\clients\lib/pobox.c Wed Feb 09 16:15:49 2000
>> --- moiraw2k\clients\lib/pobox.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 41,47 ****
>> --- 41,51 ----
>> /* For each comma-delimited address, canonicalize the hostname and
>> * verify that the address won't cause mail problems.
>> */
>> + #ifdef WIN32
>> + for (p = strtok(addr, ", "); p; p = strtok(NULL, ","))
>> + #else
>> for (p = strtok_r(addr, ", ", &lasts); p; p = strtok_r(NULL, ",", &lasts))
>> + #endif /*WIN32*/
>> {
>> m = strchr(p, '@');
>> if (m)
>> ***************
>> *** 130,136 ****
>> --- 134,144 ----
>> /* Given a canonicalized machine name, ask the Moira server if it is of type
>> * POP, LOCAL, or MAILHUB -- if none of those, we assume it's foreign.
>> */
>> + #ifndef WIN32
>> static int potype(char *machine)
>> + #else
>> + int potype(char *machine)
>> + #endif
>> {
>> char *name;
>> int status, match = 0;
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="clients_mailmaint.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\mailmaint/mailmaint.c moiraw2k\clients\mailmaint/mailmaint.c
>> *** moiradev\clients\mailmaint/mailmaint.c Wed Feb 09 16:16:07 2000
>> --- moiraw2k\clients\mailmaint/mailmaint.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 14,32 ****
>> #include <moira_site.h>
>> #include <mrclient.h>
>>
>> #include <ctype.h>
>> #ifdef HAVE_CURSES
>> #include <curses.h>
>> #endif
>> #include <pwd.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> #include <krb.h>
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/mailmaint/mailmaint.c,v 1.45 1999/12/30 17:30:34 danw Exp $");
>>
>> #define STARTCOL 0
>> #define STARTROW 3
>> --- 14,57 ----
>> #include <moira_site.h>
>> #include <mrclient.h>
>>
>> + #ifdef WIN32
>> + #include <conio.h>
>> + #endif
>> #include <ctype.h>
>> #ifdef HAVE_CURSES
>> + #ifdef WIN32
>> + #ifdef MOUSE_MOVED
>> + #undef MOUSE_MOVED
>> + #endif /*MOUSE_MOVED*/
>> + #endif /*WIN32*/
>> #include <curses.h>
>> #endif
>> + #ifndef WIN32
>> #include <pwd.h>
>> + #endif
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #endif
>>
>> #include <krb.h>
>>
>> ! #ifdef WIN32
>> ! #define INPUT_MASK 0xff
>> ! #ifdef getchar
>> ! #undef getchar
>> ! #endif /*getchar*/
>> ! #define getchar() _getch()
>> ! #ifdef title
>> ! #undef title
>> ! #endif
>> ! #else
>> ! #define INPUT_MASK 0x7f
>> ! #endif /*WIN32*/
>> !
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/clients/mailmaint/mailmaint.c,v 1.2 2000/01/31 16:43:28 dtanner Exp $");
>>
>> #define STARTCOL 0
>> #define STARTROW 3
>> ***************
>> *** 111,116 ****
>> --- 136,145 ----
>>
>> int main(int argc, char *argv[])
>> {
>> + #ifdef WIN32
>> + int i;
>> + #endif
>> +
>> void (*old_hook)(const char *, long, const char *, va_list);
>> int use_menu = 1, k_errno;
>> char buf[BUFSIZ], pname[ANAME_SZ];
>> ***************
>> *** 171,176 ****
>> --- 203,237 ----
>> cls();
>> endwin();
>> set_com_err_hook(old_hook);
>> + #ifdef WIN32
>> + for (i = 0; i < main_menu->num_items; i++)
>> + free(main_menu->items[i]);
>> + free(main_menu->items);
>> + free(main_menu->title);
>> + free(main_menu);
>> +
>> + for (i = 0; i < help_menu->num_items; i++)
>> + free(help_menu->items[i]);
>> + free(help_menu->items);
>> + free(help_menu->title);
>> + free(help_menu);
>> +
>> + if (current_li->acl_type)
>> + free(current_li->acl_type);
>> + if (current_li->acl_name)
>> + free(current_li->acl_name);
>> + if (current_li->desc)
>> + free(current_li->desc);
>> + if (current_li->modtime)
>> + free(current_li->modtime);
>> + if (current_li->modby)
>> + free(current_li->modby);
>> + if (current_li->modwith)
>> + free(current_li->modwith);
>> + free(current_li);
>> + mr_disconnect();
>> +
>> + #endif /*WIN32*/
>> exit(0);
>>
>> punt:
>> ***************
>> *** 191,197 ****
>> currow = DISPROW + 2;
>> page = 1;
>> toggle = num_members = moreflg = 0;
>> ! c = getchar() & 0x7f; /* mask parity bit */
>> if (c == '\r' || c == '\n')
>> {
>> if (position[level] == 7)
>> --- 252,258 ----
>> currow = DISPROW + 2;
>> page = 1;
>> toggle = num_members = moreflg = 0;
>> ! c = getchar() & INPUT_MASK; /* mask parity bit */
>> if (c == '\r' || c == '\n')
>> {
>> if (position[level] == 7)
>> ***************
>> *** 246,256 ****
>> delete_member();
>> break;
>> case 27: /* escape */
>> ! c = getchar() & 0x7f;
>> if (c == 91)
>> {
>> ! c = getchar() & 0x7f;
>> if (c == 65) /* up arrow */
>> {
>> position[level]--;
>> if (!position[level])
>> --- 307,326 ----
>> delete_member();
>> break;
>> case 27: /* escape */
>> ! #ifdef WIN32
>> ! case 0xe0:
>> ! #endif /*WIN32*/
>> !
>> ! c = getchar() & INPUT_MASK;
>> ! #ifndef WIN32
>> if (c == 91)
>> {
>> ! c = getchar() & INPUT_MASK;
>> ! /* escape */
>> if (c == 65) /* up arrow */
>> + #else
>> + if (c == 0x48)
>> + #endif /*WIN32*/
>> {
>> position[level]--;
>> if (!position[level])
>> ***************
>> *** 258,271 ****
>> --- 328,347 ----
>> }
>> else
>> {
>> + #ifdef WIN32
>> + if (c == 0x50)
>> + #else
>> if (c == 66) /* down arrow */
>> + #endif /*WIN32*/
>> {
>> position[level]++;
>> if (position[level] > 7)
>> position[level] = 1;
>> }
>> }
>> + #ifndef WIN32
>> }
>> + #endif /*WIN32*/
>> break;
>> default:
>> printf("%c", 7);
>> ***************
>> *** 311,316 ****
>> --- 387,395 ----
>> show_text(currow, STARTCOL, "Press any Key to continue...");
>> getchar();
>> }
>> + #ifdef WIN32
>> + free(buf);
>> + #endif
>> clrwin(DISPROW);
>> }
>>
>> ***************
>> *** 325,331 ****
>>
>> cnt = 0;
>> printbuf = calloc(maxcol, 1);
>> ! for (i = 0; i <= strlen(buf); i++)
>> {
>> printbuf[cnt] = buf[i];
>> cnt++;
>> --- 404,410 ----
>>
>> cnt = 0;
>> printbuf = calloc(maxcol, 1);
>> ! for (i = 0; i <= (int)strlen(buf); i++)
>> {
>> printbuf[cnt] = buf[i];
>> cnt++;
>> ***************
>> *** 341,347 ****
>> --- 420,433 ----
>> {
>> start_display_buff(printbuf);
>> free(printbuf);
>> + #ifdef WIN32
>> + printbuf = NULL;
>> + #endif /*WIN32*/
>> }
>> + #ifdef WIN32
>> + if (printbuf)
>> + free(printbuf);
>> + #endif
>> return;
>> }
>>
>> ***************
>> *** 404,409 ****
>> --- 490,498 ----
>> show_text(DISPROW + 4, STARTCOL, "Press any Key to continue...");
>> getchar();
>> }
>> + #ifdef WIN32
>> + free(buf);
>> + #endif
>> clrwin(DISPROW);
>> }
>>
>> ***************
>> *** 434,440 ****
>> currow = DISPROW + 4;
>> show_text(DISPROW + 4, STARTCOL, "Press any Key to continue...");
>> getchar();
>> ! }
>> clrwin(DISPROW);
>> }
>>
>> --- 523,537 ----
>> currow = DISPROW + 4;
>> show_text(DISPROW + 4, STARTCOL, "Press any Key to continue...");
>> getchar();
>> ! #ifdef WIN32
>> ! free(argv[0]);
>> ! free(argv[1]);
>> ! free(argv[2]);
>> ! #endif /*WIN32*/
>> ! }
>> ! #ifdef WIN32
>> ! free(buf);
>> ! #endif /*WIN32*/
>> clrwin(DISPROW);
>> }
>>
>> ***************
>> *** 460,465 ****
>> --- 557,565 ----
>> show_text(currow, STARTCOL, "Press any Key to continue...");
>> getchar();
>> clrwin(DISPROW);
>> + #ifdef WIN32
>> + free(buf);
>> + #endif /*WIN32*/
>> }
>>
>> /****************************************************/
>> ***************
>> *** 468,474 ****
>> char c;
>>
>> show_text(DISPROW, STARTCOL, "This function may take a while... proceed? [n] ");
>> ! c = getchar() & 0x7f;
>> if (c == 'y' || c == 'Y')
>> {
>> move(DISPROW + 1, STARTCOL);
>> --- 568,574 ----
>> char c;
>>
>> show_text(DISPROW, STARTCOL, "This function may take a while... proceed? [n] ");
>> ! c = getchar() & INPUT_MASK;
>> if (c == 'y' || c == 'Y')
>> {
>> move(DISPROW + 1, STARTCOL);
>> ***************
>> *** 557,568 ****
>> --- 657,677 ----
>> show_text(currow, STARTCOL, "Press any key to continue...");
>> getchar();
>> clrwin(DISPROW);
>> + #ifdef WIN32
>> + free(buf);
>> + #endif /*WIN32*/
>> return;
>> }
>> end_display();
>> + #ifdef WIN32
>> + free(buf);
>> + #endif /*WIN32*/
>> return;
>> }
>> clrwin(DISPROW);
>> + #ifdef WIN32
>> + free(buf);
>> + #endif /*WIN32*/
>> }
>>
>> /****************************************************/
>> ***************
>> *** 598,603 ****
>> --- 707,715 ----
>> erase_line(currow, STARTCOL);
>> show_text(currow, STARTCOL, "Flushing query...");
>> moreflg = 1;
>> + #ifdef WIN32
>> + free(buffer);
>> + #endif /*WIN32*/
>> return;
>> }
>> clrwin(DISPROW + 2);
>> ***************
>> *** 616,621 ****
>> --- 728,736 ----
>> currow++;
>> }
>> toggle = !toggle;
>> + #ifdef WIN32
>> + free(buffer);
>> + #endif /*WIN32*/
>> }
>>
>> /****************************************************/
>> ***************
>> *** 637,642 ****
>> --- 752,760 ----
>> show_text(currow, STARTCOL, "Press any key to continue...");
>> getchar();
>> clrwin(DISPROW);
>> + #ifdef WIN32
>> + free(buffer);
>> + #endif /*WIN32*/
>> }
>>
>> /****************************************************/
>> ***************
>> *** 692,697 ****
>> --- 810,818 ----
>> main_menu->items[4] = strdup("5. Add yourself to a mailing list.");
>> main_menu->items[5] = strdup("6. Delete yourself from a mailing list.");
>> main_menu->items[6] = strdup("q. Quit.");
>> + #ifdef WIN32
>> + free(buf);
>> + #endif /*WIN32*/
>> }
>>
>> /****************************************************/
>> ***************
>> *** 840,848 ****
>> --- 961,972 ----
>> {
>> int c;
>> char *p;
>> + int x,y;
>>
>> + c = getsyx(&y, &x);
>> addstr(prompt);
>> refresh();
>> +
>> for (p = buf; abs(strlen(p) - strlen(buf)) <= buflen;)
>> {
>> refresh();
>> ***************
>> *** 846,852 ****
>> for (p = buf; abs(strlen(p) - strlen(buf)) <= buflen;)
>> {
>> refresh();
>> ! c = getchar() & 0x7f;
>> switch (c)
>> {
>> case CTL('C'):
>> --- 970,984 ----
>> for (p = buf; abs(strlen(p) - strlen(buf)) <= buflen;)
>> {
>> refresh();
>> ! c = getchar() & INPUT_MASK;
>> ! #ifdef WIN32
>> ! if (c == 0xe0)
>> ! {
>> ! c = getchar() & INPUT_MASK;
>> ! putchar(CTL('G'));
>> ! continue;
>> ! }
>> ! #endif /*WIN32*/
>> switch (c)
>> {
>> case CTL('C'):
>> ***************
>> *** 871,884 ****
>> --- 1003,1030 ----
>> if (p > buf)
>> {
>> p--;
>> + #ifndef WIN32
>> printf("\b \b");
>> + #else
>> + c = getsyx(&y, &x);
>> + x -= 1;
>> + mvdelch(y,x);
>> + #endif
>> }
>> break;
>> case CTL('U'):
>> case CTL('G'):
>> case CTL('['):
>> while (p-- > buf)
>> + {
>> + #ifndef WIN32
>> printf("\b \b");
>> + #else
>> + c = getsyx(&y, &x);
>> + x -= 1;
>> + mvdelch(y,x);
>> + #endif
>> + }
>> p = buf;
>> break;
>> default:
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="clients_moira.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/attach.c moiraw2k\clients\moira/attach.c
>> *** moiradev\clients\moira/attach.c Wed Feb 09 16:32:34 2000
>> --- moiraw2k\clients\moira/attach.c Wed Feb 09 16:43:30 2000
>> ***************
>> *** 28,36 ****
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/attach.c,v 1.48 1999/04/30 17:41:06 danw Exp $");
>>
>> char *canonicalize_cell(char *c);
>> int GetAliasValue(int argc, char **argv, void *retval);
>> --- 28,38 ----
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #endif /*WIN32*/
>>
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/clients/moira/attach.c,v 1.1.1.2 1999/10/21 16:30:49 dtanner Exp $");
>>
>> char *canonicalize_cell(char *c);
>> int GetAliasValue(int argc, char **argv, void *retval);
>> ***************
>> *** 237,244 ****
>> --- 239,250 ----
>>
>> char *canonicalize_cell(char *c)
>> {
>> + #ifndef WIN32
>> struct stat stbuf;
>> + #endif /*WIN32*/
>> char path[512];
>> + char HostName[64];
>> + #ifndef WIN32
>> int count;
>>
>> sprintf(path, "/afs/%s", c);
>> ***************
>> *** 250,255 ****
>> --- 256,267 ----
>> path[count] = 0;
>> free(c);
>> return strdup(path);
>> + #else
>> + memset(HostName, '\0', sizeof(HostName));
>> + gethostname(HostName, sizeof(HostName));
>> + sprintf(path, "\\\\%s-afs\\all\\%s", HostName, c);
>> + return c;
>> + #endif /*WIN32*/
>> }
>>
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/cluster.c moiraw2k\clients\moira/cluster.c
>> *** moiradev\clients\moira/cluster.c Wed Feb 09 16:32:43 2000
>> --- moiraw2k\clients\moira/cluster.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 23,33 ****
>> --- 23,35 ----
>> #include "globals.h"
>>
>> #include <sys/types.h>
>> + #ifndef WIN32
>> #include <sys/utsname.h>
>>
>> #include <netinet/in.h>
>> #include <arpa/inet.h>
>> #include <netdb.h>
>> + #endif /*WIN32*/
>>
>> #include <ctype.h>
>> #include <stdio.h>
>> ***************
>> *** 584,590 ****
>> return NULL;
>> if (GetAddressFromUser("Network mask", &info[SN_MASK]) == SUB_ERROR)
>> return NULL;
>> ! if (atoi(info[SN_LOW]) == ntohl(inet_addr(S_DEFAULT_LOW)))
>> {
>> struct in_addr low;
>> unsigned long mask, addr;
>> --- 586,592 ----
>> return NULL;
>> if (GetAddressFromUser("Network mask", &info[SN_MASK]) == SUB_ERROR)
>> return NULL;
>> ! if (atoi(info[SN_LOW]) == (int)ntohl(inet_addr(S_DEFAULT_LOW)))
>> {
>> struct in_addr low;
>> unsigned long mask, addr;
>> ***************
>> *** 600,606 ****
>> if (GetAddressFromUser("Lowest assignable address", &info[SN_LOW]) ==
>> SUB_ERROR)
>> return NULL;
>> ! if (atoi(info[SN_HIGH]) == ntohl(inet_addr(S_DEFAULT_HIGH)))
>> {
>> struct in_addr high;
>> unsigned long mask, addr;
>> --- 602,608 ----
>> if (GetAddressFromUser("Lowest assignable address", &info[SN_LOW]) ==
>> SUB_ERROR)
>> return NULL;
>> ! if (atoi(info[SN_HIGH]) == (int)ntohl(inet_addr(S_DEFAULT_HIGH)))
>> {
>> struct in_addr high;
>> unsigned long mask, addr;
>> ***************
>> *** 997,1006 ****
>> else
>> {
>> struct hostent *hp;
>> struct utsname name;
>> -
>> uname(&name);
>> hp = gethostbyname(name.nodename);
>> cp = strchr(hp->h_name, '.');
>> if (cp)
>> def_domain = strdup(++cp);
>> --- 999,1014 ----
>> else
>> {
>> struct hostent *hp;
>> + #ifndef WIN32
>> struct utsname name;
>> uname(&name);
>> hp = gethostbyname(name.nodename);
>> + #else
>> + char name[256];
>> + memset(name, '\0', sizeof(name));
>> + gethostname(name, sizeof(name));
>> + hp = gethostbyname(name);
>> + #endif /*WIN32*/
>> cp = strchr(hp->h_name, '.');
>> if (cp)
>> def_domain = strdup(++cp);
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/main.c moiraw2k\clients\moira/main.c
>> *** moiradev\clients\moira/main.c Wed Feb 09 16:33:52 2000
>> --- moiraw2k\clients\moira/main.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 19,29 ****
>> --- 19,36 ----
>> #include "f_defs.h"
>> #include "globals.h"
>>
>> + #ifndef WIN32
>> #include <pwd.h>
>> + #endif /*WIN32*/
>> #include <signal.h>
>> #include <stdio.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #else
>> + #define SIGHUP 4
>> + #define SIGQUIT 9
>> + #endif /*WIN32*/
>>
>> #include <krb.h>
>>
>> ***************
>> *** 31,37 ****
>> --- 38,48 ----
>>
>> static void ErrorExit(char *buf, int status);
>> static void Usage(void);
>> + #ifdef WIN32
>> + void __cdecl Signal_Handler(int sig);
>> + #else
>> static void Signal_Handler(void);
>> + #endif /*WIN32*/
>> static void CatchInterrupt(void);
>>
>> char *whoami; /* used by menu.c ugh!!! */
>> ***************
>> *** 55,61 ****
>> --- 66,74 ----
>> int status;
>> Menu *menu;
>> char **arg, pname[ANAME_SZ];
>> + #ifndef WIN32
>> struct sigaction act;
>> + #endif /*WIN32*/
>>
>> if (!(program_name = strrchr(argv[0], '/')))
>> program_name = argv[0];
>> ***************
>> *** 133,152 ****
>> --- 146,176 ----
>> * system.
>> */
>>
>> + #ifndef WIN32
>> sigemptyset(&act.sa_mask);
>> act.sa_flags = 0;
>> act.sa_handler = Signal_Handler;
>> sigaction(SIGHUP, &act, NULL);
>> sigaction(SIGQUIT, &act, NULL);
>> + #else
>> + signal(SIGHUP, Signal_Handler);
>> + signal(SIGQUIT, Signal_Handler);
>> + #endif /*WIN32*/
>> #ifdef HAVE_CURSES
>> if (use_menu)
>> + #ifndef WIN32
>> sigaction(SIGINT, &act, NULL);
>> else
>> + #else
>> + signal(SIGINT, NULL);
>> + #endif /*WIN32*/
>> #endif
>> + #ifndef WIN32
>> {
>> act.sa_handler = CatchInterrupt;
>> sigaction(SIGINT, &act, NULL);
>> }
>> + #endif /*WIN32*/
>>
>> if (!strcmp(program_name, "listmaint"))
>> menu = &list_menu;
>> ***************
>> *** 205,211 ****
>> --- 229,239 ----
>> * Returns: doesn't
>> */
>>
>> + #ifndef WIN32
>> static void Signal_Handler(void)
>> + #else
>> + void Signal_Handler(int sig)
>> + #endif /*WIN32*/
>> {
>> Put_message("Signal caught - exiting");
>> #ifdef HAVE_CURSES
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/menu.c moiraw2k\clients\moira/menu.c
>> *** moiradev\clients\moira/menu.c Wed Feb 09 16:34:01 2000
>> --- moiraw2k\clients\moira/menu.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 11,27 ****
>> #include <moira.h>
>> #include "menu.h"
>>
>> #include <ctype.h>
>> #ifdef HAVE_CURSES
>> #include <curses.h>
>> #endif
>> #include <signal.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/menu.c,v 1.56 1999/08/04 15:10:23 danw Exp $");
>>
>> #ifdef MAX
>> #undef MAX
>> --- 11,47 ----
>> #include <moira.h>
>> #include "menu.h"
>>
>> +
>> + #ifdef WIN32
>> + #include <conio.h>
>> + #endif /*WIN32*/
>> #include <ctype.h>
>> #ifdef HAVE_CURSES
>> + #ifdef WIN32
>> + #ifdef MOUSE_MOVED
>> + #undef MOUSE_MOVED
>> + #endif /*MOUSE_MOVED*/
>> + #endif /*WIN32*/
>> #include <curses.h>
>> #endif
>> #include <signal.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #endif /*WIN32*/
>>
>> ! #ifdef WIN32
>> ! #ifdef getchar
>> ! #undef getchar
>> ! #define getchar() _getch()
>> ! #endif /*getchar*/
>> ! #ifdef title
>> ! #undef title
>> ! #endif
>> ! #endif
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/clients/moira/menu.c,v 1.1.1.2 1999/10/21 16:30:53 dtanner Exp $");
>>
>> #ifdef MAX
>> #undef MAX
>> ***************
>> *** 460,470 ****
>> /* Prompt the user for input in the input window of cur_ms */
>> int Prompt_input(char *prompt, char *buf, int buflen)
>> {
>> int c;
>> char *p;
>> int y, x, oldx, oldy;
>>
>> - #ifdef HAVE_CURSES
>> if (cur_ms != NULLMS)
>> {
>> more_flg = 1;
>> --- 480,490 ----
>> /* Prompt the user for input in the input window of cur_ms */
>> int Prompt_input(char *prompt, char *buf, int buflen)
>> {
>> + #ifdef HAVE_CURSES
>> int c;
>> char *p;
>> int y, x, oldx, oldy;
>>
>> if (cur_ms != NULLMS)
>> {
>> more_flg = 1;
>> ***************
>> *** 491,497 ****
>> --- 511,519 ----
>> *p = '\0';
>> return 0;
>> case CTL('Z'):
>> + #ifndef WIN32
>> kill(getpid(), SIGTSTP);
>> + #endif /*WIN32*/
>> touchwin(cur_ms->ms_screen);
>> break;
>> case CTL('L'):
>> ***************
>> *** 644,651 ****
>> --- 666,675 ----
>> /* Will be truncated to COLS characters. */
>> void Put_line(char *msg)
>> {
>> + #ifdef HAVE_CURSES
>> int y, x, i;
>> char *msg1, chr;
>> + #endif /*HAVE_CURSES*/
>>
>> if (!more_flg)
>> return;
>> ***************
>> *** 691,697 ****
>> --- 715,725 ----
>> strncpy(msg1, msg, COLS - 1);
>> for (i = strlen(msg1); i < COLS - 1; i++)
>> msg1[i] = ' ';
>> + #ifndef WIN32
>> wprintw(cur_ms->ms_input, "%s\n", msg1);
>> + #else
>> + wprintw(cur_ms->ms_input, "%s", msg1);
>> + #endif /*WIN32*/
>> }
>> else
>> #endif /* HAVE_CURSES */
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/misc.c moiraw2k\clients\moira/misc.c
>> *** moiradev\clients\moira/misc.c Wed Feb 09 16:34:27 2000
>> --- moiraw2k\clients\moira/misc.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 23,32 ****
>> --- 23,34 ----
>> #include "globals.h"
>>
>> #include <sys/types.h>
>> + #ifndef WIN32
>> #include <sys/socket.h>
>> #include <netinet/in.h>
>> #include <arpa/inet.h>
>> #include <netdb.h>
>> + #endif /*WIN32*/
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/pobox.c moiraw2k\clients\moira/pobox.c
>> *** moiradev\clients\moira/pobox.c Wed Feb 09 16:34:54 2000
>> --- moiraw2k\clients\moira/pobox.c Wed Feb 09 16:08:49 2000
>> ***************
>> *** 395,404 ****
>> {
>> int status;
>> char *type, temp_buf[BUFSIZ], *local_user, *args[10], *box;
>> char *temp_box;
>> struct mqelem *top = NULL;
>> -
>> local_user = argv[1];
>> if (!ValidName(local_user))
>> return DM_NORMAL;
>>
>> --- 395,406 ----
>> {
>> int status;
>> char *type, temp_buf[BUFSIZ], *local_user, *args[10], *box;
>> + #ifndef WIN32
>> char *temp_box;
>> + #endif
>> struct mqelem *top = NULL;
>> local_user = argv[1];
>> +
>> if (!ValidName(local_user))
>> return DM_NORMAL;
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/printer.c moiraw2k\clients\moira/printer.c
>> *** moiradev\clients\moira/printer.c Wed Feb 09 16:35:03 2000
>> --- moiraw2k\clients\moira/printer.c Wed Feb 09 16:08:49 2000
>> ***************
>> *** 207,213 ****
>> --- 207,215 ----
>> {
>> char temp_buf[BUFSIZ];
>> char *args[3], *lpc_acl;
>> + #ifndef WIN32
>> char *s, *d;
>> + #endif /*WIN32*/
>> int status;
>>
>> Put_message("");
>> ***************
>> *** 526,532 ****
>> --- 528,536 ----
>> static char *PrintPrintSrvInfo(char **info)
>> {
>> char buf[BUFSIZ];
>> + #ifndef WIN32
>> int status;
>> + #endif /*WIN32*/
>>
>> if (!info) /* If no informaion */
>> {
>> ***************
>> *** 575,583 ****
>> --- 579,589 ----
>> static char **AskPrintSrvInfo(char **info)
>> {
>> char buf[BUFSIZ];
>> + #ifndef WIN32
>> char *args[3], *lpc_acl;
>> char *s, *d;
>> int status;
>> + #endif /*WIN32*/
>>
>> Put_message("");
>> sprintf(buf, "Print Server entry for %s.", info[PRINTSERVER_HOST]);
>> ***************
>> *** 644,650 ****
>> --- 650,660 ----
>>
>> int ChangePrintSrv(int argc, char **argv)
>> {
>> + #ifndef WIN32
>> char *name, **args;
>> + #else
>> + char *name;
>> + #endif
>> struct mqelem *elem = NULL;
>> int stat;
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/user.c moiraw2k\clients\moira/user.c
>> *** moiradev\clients\moira/user.c Wed Feb 09 16:35:19 2000
>> --- moiraw2k\clients\moira/user.c Wed Feb 09 16:08:49 2000
>> ***************
>> *** 19,25 ****
>> --- 19,27 ----
>> #include "f_defs.h"
>> #include "globals.h"
>>
>> + #ifndef WIN32
>> #include <sys/time.h>
>> + #endif /*WIN32*/
>>
>> #include <ctype.h>
>> #include <stdio.h>
>> ***************
>> *** 698,704 ****
>> FreeAndClear(&args[L_MODTIME], TRUE);
>> FreeAndClear(&args[L_MODBY], TRUE);
>> FreeAndClear(&args[L_MODWITH], TRUE);
>> ! SlipInNewName(args, args[L_NAME]);
>> if ((status = do_mr_query("update_list", CountArgs(args), args,
>> NULL, NULL)))
>> {
>> --- 700,706 ----
>> FreeAndClear(&args[L_MODTIME], TRUE);
>> FreeAndClear(&args[L_MODBY], TRUE);
>> FreeAndClear(&args[L_MODWITH], TRUE);
>> ! SlipInNewName(args, strdup(args[L_NAME]));
>> if ((status = do_mr_query("update_list", CountArgs(args), args,
>> NULL, NULL)))
>> {
>> ***************
>> *** 734,740 ****
>> FreeAndClear(&args[FS_MODTIME], TRUE);
>> FreeAndClear(&args[FS_MODBY], TRUE);
>> FreeAndClear(&args[FS_MODWITH], TRUE);
>> ! SlipInNewName(args, args[FS_NAME]);
>> if ((status = do_mr_query("update_filesys", CountArgs(args), args,
>> NULL, NULL)))
>> {
>> --- 736,742 ----
>> FreeAndClear(&args[FS_MODTIME], TRUE);
>> FreeAndClear(&args[FS_MODBY], TRUE);
>> FreeAndClear(&args[FS_MODWITH], TRUE);
>> ! SlipInNewName(args, strdup(args[FS_NAME]));
>> if ((status = do_mr_query("update_filesys", CountArgs(args), args,
>> NULL, NULL)))
>> {
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\moira/utils.c moiraw2k\clients\moira/utils.c
>> *** moiradev\clients\moira/utils.c Wed Feb 09 16:35:27 2000
>> --- moiraw2k\clients\moira/utils.c Wed Feb 09 16:08:49 2000
>> ***************
>> *** 21,29 ****
>> --- 21,31 ----
>>
>> #include <sys/types.h>
>>
>> + #ifndef WIN32
>> #include <netinet/in.h>
>> #include <arpa/inet.h>
>> #include <netdb.h> /* for gethostbyname. */
>> + #endif /*WIN32*/
>>
>> #include <ctype.h>
>> #include <stdio.h>
>> ***************
>> *** 778,783 ****
>> --- 780,789 ----
>> for (elem = GetTypeValues(tname); elem; elem = elem->q_forw)
>> {
>> strcat(buffer, elem->q_data);
>> + #ifdef WIN32
>> + if (strlen(buffer) > 64)
>> + break;
>> + #endif
>> if (elem->q_forw)
>> strcat(buffer, ", ");
>> }
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="clients_mrcheck.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\mrcheck/mrcheck.c moiraw2k\clients\mrcheck/mrcheck.c
>> *** moiradev\clients\mrcheck/mrcheck.c Wed Feb 09 16:16:23 2000
>> --- moiraw2k\clients\mrcheck/mrcheck.c Wed Feb 09 16:09:10 2000
>> ***************
>> *** 12,18 ****
>> --- 12,20 ----
>> #include <moira_site.h>
>> #include <mrclient.h>
>>
>> + #ifndef WIN32
>> #include <sys/time.h>
>> + #endif /*WIN32*/
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="clients_mrtest.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\mrtest/mrtest.c moiraw2k\clients\mrtest/mrtest.c
>> *** moiradev\clients\mrtest/mrtest.c Wed Feb 09 16:16:36 2000
>> --- moiraw2k\clients\mrtest/mrtest.c Wed Feb 09 16:09:09 2000
>> ***************
>> *** 6,11 ****
>> --- 6,14 ----
>> * For copying and distribution information, please see the file
>> * <mit-copyright.h>.
>> */
>> + #ifdef WIN32
>> + #include <windows.h>
>> + #endif
>>
>> #include <mit-copyright.h>
>> #include <moira.h>
>> ***************
>> *** 17,23 ****
>> --- 20,38 ----
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #else
>> + #include <ctype.h>
>> + #define _CRTAPI1 __cdecl
>> + #define _CRTAPI2 __cdecl
>> + int _CRTAPI1 dup(int);
>> + int _CRTAPI1 isatty(int);
>> + int _CRTAPI1 close(int);
>> + int _CRTAPI2 open(const char *, int,...);
>> + int _CRTAPI1 dup2(int, int);
>> + typedef unsigned long sigset_t;
>> + #endif /*WIN32*/
>>
>> #ifdef HAVE_READLINE
>> #include "readline/readline.h"
>> ***************
>> *** 29,39 ****
>> --- 44,65 ----
>> int recursion = 0, quote_output = 0, interactive;
>> int count, quit = 0, cancel = 0;
>> char *whoami;
>> + #ifndef WIN32
>> sigjmp_buf jb;
>> + #else
>> + jmp_buf jb;
>> + #endif /*WIN32*/
>>
>> #define MAXARGS 20
>>
>> + #ifdef WIN32
>> + extern int getopt(nargc, nargv, ostr);
>> + BOOL WINAPI SignalHandler(DWORD dwCtrlType);
>> + void __cdecl discard_input(int sig);
>> + #else
>> void discard_input(void);
>> + #endif /*WIN32*/
>> +
>> char *mr_gets(char *prompt, char *buf, size_t len);
>> void execute_line(char *cmdbuf);
>> int parse(char *buf, char *argv[MAXARGS]);
>> ***************
>> *** 55,61 ****
>> --- 81,89 ----
>> int main(int argc, char **argv)
>> {
>> char cmdbuf[BUFSIZ];
>> + #ifndef WIN32
>> struct sigaction action;
>> + #endif /*WIN32*/
>> int c;
>>
>> whoami = argv[0];
>> ***************
>> *** 83,93 ****
>> --- 111,126 ----
>> rl_bind_key('\t', rl_insert);
>> #endif
>>
>> + #ifndef WIN32
>> action.sa_handler = discard_input;
>> action.sa_flags = 0;
>> sigemptyset(&action.sa_mask);
>> sigaction(SIGINT, &action, NULL);
>> sigsetjmp(jb, 1);
>> + #else
>> + signal(SIGINT, discard_input);
>> + setjmp(jb);
>> + #endif /*WIN32*/
>>
>> while (!quit)
>> {
>> ***************
>> *** 99,105 ****
>> --- 132,142 ----
>> exit(0);
>> }
>>
>> + #ifndef WIN32
>> void discard_input(void)
>> + #else
>> + void discard_input(int sig)
>> + #endif /*WIN32*/
>> {
>> putc('\n', stdout);
>>
>> ***************
>> *** 108,116 ****
>> --- 145,158 ----
>> if (recursion)
>> cancel = 1;
>> else
>> + #ifndef WIN32
>> siglongjmp(jb, 1);
>> + #else
>> + longjmp(jb, 0);
>> + #endif /*WIN32*/
>> }
>>
>> +
>> char *mr_gets(char *prompt, char *buf, size_t len)
>> {
>> char *in;
>> ***************
>> *** 444,454 ****
>> --- 486,504 ----
>> count = 0;
>> /* Don't allow ^C during the query: it will confuse libmoira's
>> internal state. (Yay static variables) */
>> + #ifndef WIN32
>> sigemptyset(&sigs);
>> sigaddset(&sigs, SIGINT);
>> sigprocmask(SIG_BLOCK, &sigs, NULL);
>> + #else
>> + SetConsoleCtrlHandler(SignalHandler, TRUE);
>> + #endif /*WIN32*/
>> status = mr_query(argv[1], argc - 2, argv + 2, print_reply, &help);
>> + #ifndef WIN32
>> sigprocmask(SIG_UNBLOCK, &sigs, NULL);
>> + #else
>> + SetConsoleCtrlHandler(SignalHandler, FALSE);
>> + #endif /*WIN32*/
>> printf("%d tuple%s\n", count, ((count == 1) ? "" : "s"));
>> if (status)
>> com_err("moira (query)", status, "");
>> ***************
>> *** 520,522 ****
>> --- 570,579 ----
>> if (status)
>> com_err("moira (version)", status, "");
>> }
>> +
>> + #ifdef WIN32
>> + BOOL WINAPI SignalHandler(DWORD dwCtrlType)
>> + {
>> + return(TRUE);
>> + }
>> + #endif /*WIN32*/
>> \ No newline at end of file
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="clients_passwd.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\clients\passwd/chpobox.c moiraw2k\clients\passwd/chpobox.c
>> *** moiradev\clients\passwd/chpobox.c Wed Feb 09 16:15:30 2000
>> --- moiraw2k\clients\passwd/chpobox.c Wed Feb 09 16:08:48 2000
>> ***************
>> *** 26,38 ****
>> #include <moira_site.h>
>> #include <mrclient.h>
>>
>> #include <pwd.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/passwd/chpobox.c,v 1.28 2000/01/28 00:31:55 danw Exp $");
>>
>> int get_pobox(int argc, char **argv, void *callarg);
>> void usage(void);
>> --- 26,46 ----
>> #include <moira_site.h>
>> #include <mrclient.h>
>>
>> + #ifndef WIN32
>> #include <pwd.h>
>> + #endif /*WIN32*/
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #else
>> + extern int getopt(nargc, nargv, ostr);
>> + extern int optind;
>> + extern char *optarg;
>> + #endif /*WIN32*/
>>
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/clients/chpobox/chpobox.c,v 1.1.1.1 1999/10/21 16:30:45 dtanner Exp $");
>>
>> int get_pobox(int argc, char **argv, void *callarg);
>> void usage(void);
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="include.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\include/moira.h moiraw2k\include/moira.h
>> *** moiradev\include/moira.h Wed Feb 09 19:24:17 2000
>> --- moiraw2k\include/moira.h Thu Feb 10 15:19:44 2000
>> ***************
>> *** 8,19 ****
>> #define _moira_h_
>>
>> /* return values from queries (and error codes) */
>> !
>> #include <sys/types.h>
>> #include <com_err.h>
>> #include "mr_et.h"
>> #include "krb_et.h"
>> #include "ureg_err.h"
>> #define MR_SUCCESS 0 /* Query was successful */
>>
>> #define MR_VERSION_1 1 /* Version in use from 7/87 to 4/88 */
>> --- 8,39 ----
>> #define _moira_h_
>>
>> /* return values from queries (and error codes) */
>> ! #ifdef WIN32
>> ! #include <windows.h>
>> ! #include <process.h>
>> ! #include <ctype.h>
>> ! #else
>> #include <sys/types.h>
>> + #endif /*WIN32*/
>> #include <com_err.h>
>> #include "mr_et.h"
>> #include "krb_et.h"
>> #include "ureg_err.h"
>> +
>> + #ifdef WIN32
>> + #define LOG_ERR 3 /* error conditions */
>> + #ifdef LIBMOIRA_BUILD
>> + #define ssize_t int
>> + #define close closesocket
>> + #define read(x,y,z) recv(x,y,z,0)
>> + #define write(a,b,c) send(a,b,c,0)
>> + #define getpid _getpid
>> + #endif
>> + #ifndef strcasecmp
>> + #define strcasecmp stricmp
>> + #endif
>> + #endif /* WIN32 */
>> +
>> #define MR_SUCCESS 0 /* Query was successful */
>>
>> #define MR_VERSION_1 1 /* Version in use from 7/87 to 4/88 */
>> ***************
>> *** 145,150 ****
>> --- 166,177 ----
>> int mr_query(char *handle, int argc, char **argv,
>> int (*callback)(int, char **, void *), void *callarg);
>> int mr_version(int version);
>> +
>> + #ifdef WIN32
>> + void initialize_krb_error_table (void);
>> + void initialize_sms_error_table (void);
>> + void initialize_ureg_error_table (void);
>> + #endif /*WIN32*/
>>
>> /* error-name backward compatibility */
>> #define MR_INGRES_ERR MR_DBMS_ERR
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="lib.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\lib/critical.c moiraw2k\lib/critical.c
>> *** moiradev\lib/critical.c Wed Feb 09 18:43:03 2000
>> --- moiraw2k\lib/critical.c Wed Feb 09 19:28:29 2000
>> ***************
>> *** 24,30 ****
>> --- 24,34 ----
>> #include <stdlib.h>
>> #include <string.h>
>> #ifndef HAVE_ZEPHYR
>> + #ifndef WIN32
>> #include <syslog.h>
>> + #else
>> + #include <edkevent.h>
>> + #endif /*WIN32*/
>> #endif
>> #include <time.h>
>>
>> ***************
>> *** 33,38 ****
>> --- 37,50 ----
>> /* mode to create the file with */
>> #define LOGFILEMODE 0644
>>
>> + #ifdef WIN32
>> + void
>> + syslog(
>> + int pri,
>> + char *buf
>> + );
>> + #endif /*WIN32*/
>> +
>> extern char *whoami;
>>
>> /* This routine sends a class MOIRA zephyrgram of specified instance
>> ***************
>> *** 121,123 ****
>> --- 133,150 ----
>> }
>> #endif
>> }
>> +
>> + #ifdef WIN32
>> + void
>> + syslog(
>> + int pri,
>> + char *buf
>> + )
>> + {
>> + HRESULT hr = NOERROR;
>> +
>> + hr = HrEventOpenLog(whoami, NULL, NULL, NULL, NULL, NULL);
>> + EventLogMsg(pri, 1, buf,0);
>> + (void) HrEventCloseLog();
>> + }
>> + #endif /*WIN32*/
>> \ No newline at end of file
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\lib/fixhost.c moiraw2k\lib/fixhost.c
>> *** moiradev\lib/fixhost.c Wed Feb 09 18:43:17 2000
>> --- moiraw2k\lib/fixhost.c Wed Feb 09 19:28:27 2000
>> ***************
>> *** 11,21 ****
>> --- 11,23 ----
>> #include <moira.h>
>>
>> #include <sys/types.h>
>> + #ifndef WIN32
>> #include <sys/socket.h>
>> #include <sys/utsname.h>
>>
>> #include <netdb.h>
>> #include <netinet/in.h>
>> + #endif /*WIN32*/
>>
>> #include <ctype.h>
>> #include <stdio.h>
>> ***************
>> *** 29,34 ****
>> --- 31,39 ----
>> static char *domain = NULL;
>> char *cp;
>> struct hostent *hp;
>> + #ifdef WIN32
>> + char HostName[64];
>> + #endif /*WIN32*/
>>
>> if (domain == NULL)
>> {
>> ***************
>> *** 42,50 ****
>> --- 47,61 ----
>> }
>> else
>> {
>> + #ifndef WIN32
>> struct utsname name;
>> uname(&name);
>> hp = gethostbyname(name.nodename);
>> + #else
>> + memset(HostName, '\0', sizeof(HostName));
>> + gethostname(HostName, sizeof(HostName));
>> + hp = gethostbyname(HostName);
>> + #endif /*WIN32*/
>> if (hp)
>> {
>> cp = strchr(hp->h_name, '.');
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\lib/kname_unparse.c moiraw2k\lib/kname_unparse.c
>> *** moiradev\lib/kname_unparse.c Wed Feb 09 18:43:45 2000
>> --- moiraw2k\lib/kname_unparse.c Wed Feb 09 19:28:24 2000
>> ***************
>> *** 13,22 ****
>>
>> #include <stdio.h>
>>
>> #include <des.h>
>> #include <krb.h>
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/lib/kname_unparse.c,v 1.4 1998/02/08 19:31:18 danw Exp $");
>>
>> /* Turn a principal, instance, realm triple into a single non-ambiguous
>> * string. This is the inverse of kname_parse(). It returns a pointer
>> --- 13,24 ----
>>
>> #include <stdio.h>
>>
>> + #ifndef WIN32
>> #include <des.h>
>> + #endif /*WIN32*/
>> #include <krb.h>
>>
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/lib/lib/kname_unparse.c,v 1.1.1.2 1999/10/21 16:31:16 dtanner Exp $");
>>
>> /* Turn a principal, instance, realm triple into a single non-ambiguous
>> * string. This is the inverse of kname_parse(). It returns a pointer
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\lib/mr_call.c moiraw2k\lib/mr_call.c
>> *** moiradev\lib/mr_call.c Wed Feb 09 18:44:20 2000
>> --- moiraw2k\lib/mr_call.c Wed Feb 09 19:29:32 2000
>> ***************
>> *** 7,23 ****
>> * <mit-copyright.h>.
>> */
>>
>> #include <mit-copyright.h>
>> #include <moira.h>
>> #include "mr_private.h"
>>
>> #include <errno.h>
>> #include <netinet/in.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/lib/mr_call.c,v 1.16 1999/04/30 17:38:37 danw Exp $");
>>
>> /* Moira RPC format:
>>
>> --- 7,31 ----
>> * <mit-copyright.h>.
>> */
>>
>> + #ifdef WIN32
>> + #define LIBMOIRA_BUILD
>> + #endif /*WIN32*/
>> +
>> #include <mit-copyright.h>
>> #include <moira.h>
>> #include "mr_private.h"
>>
>> #include <errno.h>
>> + #ifndef WIN32
>> #include <netinet/in.h>
>> + #endif /*WIN32*/
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #endif /*WIN32*/
>>
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/lib/lib/mr_call.c,v 1.1.1.2 1999/10/21 16:31:18 dtanner Exp $");
>>
>> /* Moira RPC format:
>>
>> ***************
>> *** 87,93 ****
>> memset(buf, 0, length);
>>
>> putlong(buf + 4, MR_VERSION_2);
>> ! putlong(buf + 8, params->u.mr_procno);
>> putlong(buf + 12, params->mr_argc);
>>
>> for (i = 0, p = buf + 16; i < params->mr_argc; i++)
>> --- 95,101 ----
>> memset(buf, 0, length);
>>
>> putlong(buf + 4, MR_VERSION_2);
>> ! putlong(buf + 8, (unsigned char)params->u.mr_procno);
>> putlong(buf + 12, params->mr_argc);
>>
>> for (i = 0, p = buf + 16; i < params->mr_argc; i++)
>> ***************
>> *** 97,103 ****
>> p += argl[i] + (4 - argl[i] % 4) % 4;
>> }
>> length = p - buf;
>> ! putlong(buf, length);
>>
>> written = write(fd, buf, length);
>> free(buf);
>> --- 105,111 ----
>> p += argl[i] + (4 - argl[i] % 4) % 4;
>> }
>> length = p - buf;
>> ! putlong(buf, (unsigned char)length);
>>
>> written = write(fd, buf, length);
>> free(buf);
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\lib/mr_connect.c moiraw2k\lib/mr_connect.c
>> *** moiradev\lib/mr_connect.c Wed Feb 09 18:44:28 2000
>> --- moiraw2k\lib/mr_connect.c Wed Feb 09 19:29:29 2000
>> ***************
>> *** 8,34 ****
>> * <mit-copyright.h>.
>> */
>>
>> #include <mit-copyright.h>
>> #include <moira.h>
>> #include <moira_site.h>
>> #include "mr_private.h"
>>
>> #include <sys/types.h>
>> #include <sys/socket.h>
>>
>> #include <netinet/in.h>
>> #include <netdb.h>
>>
>> #include <errno.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> #ifdef HAVE_HESIOD
>> #include <hesiod.h>
>> #endif
>>
>> ! RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/lib/mr_connect.c,v 1.31 1999/05/27 19:04:49 danw Exp $");
>>
>> int _mr_conn = 0;
>> static char *mr_server_host = NULL;
>> --- 8,46 ----
>> * <mit-copyright.h>.
>> */
>>
>> + #ifdef WIN32
>> + #define LIBMOIRA_BUILD
>> + #endif /*WIN32*/
>> +
>> #include <mit-copyright.h>
>> #include <moira.h>
>> #include <moira_site.h>
>> #include "mr_private.h"
>>
>> #include <sys/types.h>
>> + #ifndef WIN32
>> #include <sys/socket.h>
>>
>> #include <netinet/in.h>
>> #include <netdb.h>
>> + #endif /* WIN32 */
>>
>> #include <errno.h>
>> #include <stdlib.h>
>> #include <string.h>
>> + #ifndef WIN32
>> #include <unistd.h>
>> + #endif /*WIN32*/
>>
>> #ifdef HAVE_HESIOD
>> #include <hesiod.h>
>> #endif
>>
>> ! RCSID("$Header: /cvs/pismere-test/moiradev/moira/lib/lib/mr_connect.c,v 1.2 1999/12/06 18:03:34 dtanner Exp $");
>> !
>> ! #ifdef WIN32
>> ! #define DEFAULT_PORT 1795
>> ! #endif /*WIN32*/
>>
>> int _mr_conn = 0;
>> static char *mr_server_host = NULL;
>> ***************
>> *** 129,135 ****
>> return 0;
>>
>> if (port[0] == '#')
>> ! target.sin_port = htons(atoi(port + 1));
>> else
>> {
>> struct servent *s;
>> --- 141,147 ----
>> return 0;
>>
>> if (port[0] == '#')
>> ! target.sin_port = htons((unsigned short)atoi(port + 1));
>> else
>> {
>> struct servent *s;
>> ***************
>> *** 137,143 ****
>> --- 149,159 ----
>> if (s)
>> target.sin_port = s->s_port;
>> else
>> + #ifdef WIN32
>> + target.sin_port = DEFAULT_PORT;
>> + #else
>> return 0;
>> + #endif /*WIN32*/
>> }
>>
>> memcpy(&target.sin_addr, shost->h_addr, shost->h_length);
>> ***************
>> *** 240,246 ****
>> --- 256,266 ----
>> if (s)
>> sin.sin_port = s->s_port;
>> else
>> + #ifdef WIN32
>> + sin.sin_port = DEFAULT_PORT;
>> + #else
>> return -1;
>> + #endif /*WIN32*/
>> }
>>
>> s = socket(AF_INET, SOCK_STREAM, 0);
>> ***************
>> *** 316,322 ****
>> free(*buf);
>> return 0;
>> }
>> ! putlong(*buf, len);
>> *nread = 4;
>> return -1;
>> }
>> --- 336,342 ----
>> free(*buf);
>> return 0;
>> }
>> ! putlong(*buf, (unsigned char)len);
>> *nread = 4;
>> return -1;
>> }
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\lib/mr_private.h moiraw2k\lib/mr_private.h
>> *** moiradev\lib/mr_private.h Wed Feb 09 18:45:05 2000
>> --- moiraw2k\lib/mr_private.h Wed Feb 09 19:30:24 2000
>> ***************
>> *** 12,20 ****
>>
>> #include <sys/types.h>
>>
>> #include <netinet/in.h>
>> #include <arpa/inet.h>
>> !
>> extern int _mr_conn, mr_inited;
>>
>> typedef struct mr_params {
>> --- 12,21 ----
>>
>> #include <sys/types.h>
>>
>> + #ifndef WIN32
>> #include <netinet/in.h>
>> #include <arpa/inet.h>
>> ! #endif /*WIN32*/
>> extern int _mr_conn, mr_inited;
>>
>> typedef struct mr_params {
>>
>> --=====================_950577359==_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Disposition: attachment; filename="util_et.txt"
>>
>> diff -r -w -B -b -c -I $Id -I $Header moiradev\util\et/error_message.c moiraw2k\util\et/error_message.c
>> *** moiradev\util\et/error_message.c Wed Feb 09 19:39:43 2000
>> --- moiraw2k\util\et/error_message.c Wed Feb 09 19:44:45 2000
>> ***************
>> *** 1,6 ****
>> /*
>> ! * $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/util/et/error_message.c,v 1.2 1998/02/05 22:13:07 danw Exp $
>> ! * $Source: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/util/et/error_message.c,v $
>> * $Locker: $
>> *
>> * Copyright 1987 by the Student Information Processing Board
>> --- 1,6 ----
>> /*
>> ! * $Header: /cvs/pismere-test/moiradev/moira/util/et/error_message.c,v 1.1.1.2 1999/10/21 16:31:28 dtanner Exp $
>> ! * $Source: /cvs/pismere-test/moiradev/moira/util/et/error_message.c,v $
>> * $Locker: $
>> *
>> * Copyright 1987 by the Student Information Processing Board
>> ***************
>> *** 11,16 ****
>> --- 11,20 ----
>>
>> #include <stdio.h>
>> #include <string.h>
>> +
>> + #ifdef WIN32
>> + #include "com_err.h"
>> + #endif
>> #include "error_table.h"
>> #include "mit-sipb-copyright.h"
>>
>>
>> --=====================_950577359==_--