home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / bx75p3.zip / doc / bitchx_os2.diff < prev    next >
Text File  |  1999-02-23  |  26KB  |  1,123 lines

  1. diff -c --recursive old/commands.c new/commands.c
  2. *** old/commands.c    Wed May  7 02:25:16 1997
  3. --- new/commands.c    Mon Jul 14 16:28:44 1997
  4. ***************
  5. *** 14,19 ****
  6. --- 14,23 ----
  7.   
  8.   #include <sys/stat.h>
  9.   
  10. + #ifdef __EMX__
  11. + #include <netdb.h>
  12. + #endif
  13.   #ifdef ESIX
  14.   # include <lan/net_types.h>
  15.   #endif
  16. ***************
  17. *** 3024,3030 ****
  18.       if ((reason = strchr(args, ' ')) != NULL)
  19.           *reason++ = '\0';
  20.       else
  21. !         if ((reason = get_reason(args, "~/.BitchX/BitchX.kill")))
  22.               reason = empty_string;
  23.   
  24.       if (!strcmp(args, "*"))
  25. --- 3028,3034 ----
  26.       if ((reason = strchr(args, ' ')) != NULL)
  27.           *reason++ = '\0';
  28.       else
  29. !         if ((reason = get_reason(args, "~/BitchX/BitchX.kil")))
  30.               reason = empty_string;
  31.   
  32.       if (!strcmp(args, "*"))
  33. diff -c --recursive old/commands2.c new/commands2.c
  34. *** old/commands2.c    Tue May  6 01:37:54 1997
  35. --- new/commands2.c    Sun Jul 13 23:39:26 1997
  36. ***************
  37. *** 9,14 ****
  38. --- 9,18 ----
  39.   
  40.   #include <sys/stat.h>
  41.   
  42. + #ifdef __EMX__
  43. + #include <netdb.h>
  44. + #endif
  45.   #ifdef ESIX
  46.   # include <lan/net_types.h>
  47.   #endif
  48. Only in new: core
  49. diff -c --recursive old/ctcp.c new/ctcp.c
  50. *** old/ctcp.c    Sat Apr 19 09:53:08 1997
  51. --- new/ctcp.c    Mon Jul 14 00:56:00 1997
  52. ***************
  53. *** 739,745 ****
  54.       }
  55.       if (get_int_var(CLOAK_VAR))
  56.           return NULL;
  57. !     malloc_strcpy(&version_reply, stripansicodes(convert_output_format(get_string_var(FORMAT_VERSION_VAR), "%s %s %s", irc_version, internal_version, "*IX")));
  58.       send_ctcp(CTCP_NOTICE, from, CTCP_VERSION, "%s :%s", version_reply, 
  59.   #endif
  60.           (tmp = get_string_var(CLIENTINFO_VAR)) ?  tmp : IRCII_COMMENT);
  61. --- 739,745 ----
  62.       }
  63.       if (get_int_var(CLOAK_VAR))
  64.           return NULL;
  65. !     malloc_strcpy(&version_reply, stripansicodes(convert_output_format(get_string_var(FORMAT_VERSION_VAR), "%s %s %s", irc_version, internal_version, "OS/2")));
  66.       send_ctcp(CTCP_NOTICE, from, CTCP_VERSION, "%s :%s", version_reply, 
  67.   #endif
  68.           (tmp = get_string_var(CLIENTINFO_VAR)) ?  tmp : IRCII_COMMENT);
  69. diff -c --recursive old/dcc.c new/dcc.c
  70. *** old/dcc.c    Tue Apr 29 21:32:08 1997
  71. --- new/dcc.c    Mon Jul 14 19:33:32 1997
  72. ***************
  73. *** 14,20 ****
  74.   #include <stdarg.h>
  75.   #include <stdio.h>
  76.   #include <dirent.h>
  77.   
  78.   #include "ctcp.h"
  79.   #include "crypt.h"
  80. --- 14,23 ----
  81.   #include <stdarg.h>
  82.   #include <stdio.h>
  83.   #include <dirent.h>
  84. ! #ifdef __EMX__
  85. ! #include <netdb.h>
  86. ! #include <sys/fcntl.h>
  87. ! #endif
  88.   
  89.   #include "ctcp.h"
  90.   #include "crypt.h"
  91. ***************
  92. *** 1055,1066 ****
  93.       }
  94.       else
  95.       {
  96.           char current_dir[BIG_BUFFER_SIZE+1];
  97.           getcwd(current_dir, sizeof(current_dir) - strlen(filename) - 4);
  98. !         malloc_sprintf(&FileBuf, "%s/%s", current_dir, filename); 
  99.       }
  100.   
  101. !     if (access(FileBuf, R_OK))
  102.       {
  103.           put_it("%s", convert_output_format("$G %RDCC%n Cannot access: $0", "%s", FileBuf));
  104.           new_free(&FileBuf);
  105. --- 1058,1073 ----
  106.       }
  107.       else
  108.       {
  109. + #ifndef __EMX__
  110.           char current_dir[BIG_BUFFER_SIZE+1];
  111.           getcwd(current_dir, sizeof(current_dir) - strlen(filename) - 4);
  112. !         malloc_sprintf(&FileBuf, "%s/%s", current_dir, filename);
  113. ! #else
  114. !         malloc_sprintf(&FileBuf, "%s", filename);
  115. ! #endif
  116.       }
  117.   
  118. !     if (access(FileBuf, R_OK))
  119.       {
  120.           put_it("%s", convert_output_format("$G %RDCC%n Cannot access: $0", "%s", FileBuf));
  121.           new_free(&FileBuf);
  122. ***************
  123. *** 1125,1137 ****
  124.       }
  125.       else
  126.       {
  127.           getcwd(FileBuf, sizeof(FileBuf));
  128.   #ifdef WINNT
  129.           strcat(FileBuf, "\\");
  130.   #else
  131.           strcat(FileBuf, "/");
  132.   #endif
  133. !         strcat(FileBuf, filename);
  134.       }
  135.   
  136.       while (args && *args)
  137. --- 1132,1150 ----
  138.       }
  139.       else
  140.       {
  141. + #ifndef __EMX__
  142.           getcwd(FileBuf, sizeof(FileBuf));
  143. + #endif
  144.   #ifdef WINNT
  145.           strcat(FileBuf, "\\");
  146.   #else
  147.           strcat(FileBuf, "/");
  148.   #endif
  149. ! #ifndef __EMX__
  150. !         strcat(FileBuf, filename);
  151. ! #else
  152. !         strcpy(FileBuf, filename);
  153. ! #endif
  154.       }
  155.   
  156.       while (args && *args)
  157. ***************
  158. *** 1323,1329 ****
  159.           malloc_strcpy(&fullname, tmp);
  160.   
  161.   
  162. !     if (-1 == (Client->file = open(fullname, O_WRONLY | O_TRUNC | O_CREAT, 0644)))
  163.       {
  164.           put_it("%s", convert_output_format("$G %RDCC%n Unable to open $0: $1", "%s %s", Client->description, errno?strerror(errno):"Unknown"));
  165.           if (dcc_active_count) dcc_active_count--;
  166. --- 1336,1346 ----
  167.           malloc_strcpy(&fullname, tmp);
  168.   
  169.   
  170. ! #ifndef __EMX__
  171. !     if (-1 == (Client->file = open(fullname, O_WRONLY | O_TRUNC | O_CREAT, 0644)))
  172. ! #else
  173. !     if (-1 == (Client->file = open(fullname, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0644)))
  174. ! #endif
  175.       {
  176.           put_it("%s", convert_output_format("$G %RDCC%n Unable to open $0: $1", "%s %s", Client->description, errno?strerror(errno):"Unknown"));
  177.           if (dcc_active_count) dcc_active_count--;
  178. ***************
  179. *** 1382,1388 ****
  180. --- 1399,1409 ----
  181.   
  182.       if (!dcc_open(Client))
  183.           return;
  184. + #ifndef __EMX__
  185.       if (-1 == (Client->file = open(fullname, O_WRONLY | O_CREAT, 0644)))
  186. + #else
  187. +     if (-1 == (Client->file = open(fullname, O_WRONLY | O_CREAT | O_BINARY, 0644)))
  188. + #endif
  189.       {
  190.           put_it("%s", convert_output_format("$G %RDCC%n Unable to open $0: $1", "%s %s", Client->description, errno?strerror(errno):"Unknown"));
  191.           Client->flags |= DCC_DELETE;
  192. ***************
  193. *** 1991,1997 ****
  194. --- 2012,2022 ----
  195.           Client->flags |= DCC_ACTIVE;
  196.           Client->eof = 0;
  197.           get_time(&Client->starttime);
  198. + #ifndef __EMX__
  199.           if ((Client->file = open(Client->description, O_RDONLY)) == -1)
  200. + #else
  201. +         if ((Client->file = open(Client->description, O_RDONLY | O_BINARY)) == -1)
  202. + #endif
  203.           {
  204.               put_it("%s", convert_output_format("$G %RDCC%n Unable to open $0: $1", "%s %s", Client->description, errno ? strerror(errno) : "Unknown Host"));
  205.               FD_CLR(Client->read, &readables);
  206. ***************
  207. *** 3495,3501 ****
  208. --- 3520,3530 ----
  209.       if (0 == (fullname = expand_twiddle(tmp)))
  210.           malloc_strcpy(&fullname, tmp);
  211.   
  212. + #ifndef __EMX__
  213.       if (!(Client->file = open(fullname, O_WRONLY | O_APPEND, 0644)))
  214. + #else
  215. +     if (!(Client->file = open(fullname, O_WRONLY | O_APPEND | O_BINARY, 0644)))
  216. + #endif
  217.       {
  218.           say("Unable to open %s: %s", Client->description, errno ? strerror(errno) : "<No Error>");
  219.           Client->flags |= DCC_DELETE;
  220. ***************
  221. *** 3690,3696 ****
  222. --- 3719,3729 ----
  223.       {
  224.           struct stat st;
  225.           Client->read = Client->write = s1;
  226. + #ifndef __EMX__
  227.           Client->file = open(args, O_RDONLY);
  228. + #else
  229. +         Client->file = open(args, O_RDONLY | O_BINARY);
  230. + #endif
  231.           fstat(Client->file, &st);
  232.           Client->flags |= DCC_ACTIVE;
  233.           FD_SET(Client->write, &writables);
  234. ***************
  235. *** 3778,3784 ****
  236. --- 3811,3821 ----
  237.       if ((Client = dcc_searchlist("ftpget", filename, DCC_FTPGET, 1, NULL, NULL, -1)))
  238.       {
  239.           Client->read = Client->write = s1;
  240. + #ifndef __EMX__
  241.           Client->file = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
  242. + #else
  243. +         Client->file = open(filename, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644);
  244. + #endif
  245.           Client->flags |= DCC_ACTIVE;
  246.           FD_SET(Client->read, &readables);
  247.           Client->filesize = filesize;
  248. diff -c --recursive old/exec.c new/exec.c
  249. *** old/exec.c    Fri Apr  4 00:49:06 1997
  250. --- new/exec.c    Mon Jul 14 00:04:22 1997
  251. ***************
  252. *** 639,645 ****
  253. --- 639,649 ----
  254.           pgid = getpgid(process_list[kill_index]->pid);
  255.   #else
  256.   #  ifndef GETPGRP_VOID
  257. + #ifndef __EMX__
  258.           pgid = getpgrp(process_list[kill_index]->pid);
  259. + #else
  260. +         pgid = getpgrp();
  261. + #endif
  262.   #  else
  263.           pgid = process_list[kill_index]->pid;
  264.   #  endif
  265. ***************
  266. *** 735,741 ****
  267. --- 739,747 ----
  268.           break;
  269.       case 0:
  270.       {
  271. + #ifndef __EMX__
  272.           setsid();
  273. + #endif
  274.           my_signal(SIGINT, (sigfunc *) SIG_IGN, 0);
  275.           my_signal(SIGQUIT, (sigfunc *) SIG_DFL, 0);
  276.           my_signal(SIGSEGV, (sigfunc *) SIG_DFL, 0);
  277. diff -c --recursive old/functions.c new/functions.c
  278. *** old/functions.c    Wed Apr 30 14:58:32 1997
  279. --- new/functions.c    Mon Jul 14 00:04:06 1997
  280. ***************
  281. *** 3176,3181 ****
  282. --- 3176,3182 ----
  283.    */
  284.   BUILT_IN_FUNCTION(function_crypt, words)
  285.   {
  286. +    #ifndef __EMX__
  287.           char pass[9] = "\0";
  288.           char seed[3] = "\0";
  289.           char *blah, *bleh, *crypt _((const char *, const char *));
  290. ***************
  291. *** 3185,3190 ****
  292. --- 3186,3192 ----
  293.       strmcpy(pass, blah, 8);
  294.       strmcpy(seed, bleh, 2);
  295.       RETURN_STR(crypt(pass, seed));
  296. +     #endif
  297.   }
  298.   
  299.   BUILT_IN_FUNCTION(function_info, words)
  300. ***************
  301. *** 4149,4154 ****
  302. --- 4151,4157 ----
  303.   
  304.   BUILT_IN_FUNCTION(function_chmod, words)
  305.   {
  306. +     #ifndef __EMX__
  307.       char *filearg, *after;
  308.       int fd = -1;
  309.       char *perm_s;
  310. ***************
  311. *** 4168,4173 ****
  312. --- 4171,4177 ----
  313.       }
  314.       else
  315.           RETURN_INT(chmod(filearg, perm))
  316. +     #endif
  317.   }
  318.   
  319.   BUILT_IN_FUNCTION(function_twiddle, words)
  320. diff -c --recursive old/glob.c new/glob.c
  321. *** old/glob.c    Mon Mar 31 22:16:28 1997
  322. --- new/glob.c    Mon Jul 14 00:04:48 1997
  323. ***************
  324. *** 65,70 ****
  325. --- 65,73 ----
  326.    */
  327.   
  328.   #include <sys/param.h>
  329. + #ifdef __EMX__
  330. + #include <sys/types.h>
  331. + #endif
  332.   #include <sys/stat.h>
  333.   
  334.   #include <ctype.h>
  335. ***************
  336. *** 768,778 ****
  337.                       glob_t *pglob            )
  338.   {
  339.       char buf[MAXPATHLEN];
  340.       g_Ctoc(fn, buf);
  341.       if (pglob->gl_flags & GLOB_ALTDIRFUNC)
  342.           return((*pglob->gl_lstat)(buf, sb));
  343.       return(lstat(buf, sb));
  344.   }
  345.   
  346.   static int g_stat        (    register Char *fn,
  347. --- 771,782 ----
  348.                       glob_t *pglob            )
  349.   {
  350.       char buf[MAXPATHLEN];
  351. ! #ifndef __EMX__
  352.       g_Ctoc(fn, buf);
  353.       if (pglob->gl_flags & GLOB_ALTDIRFUNC)
  354.           return((*pglob->gl_lstat)(buf, sb));
  355.       return(lstat(buf, sb));
  356. + #endif
  357.   }
  358.   
  359.   static int g_stat        (    register Char *fn,
  360. diff -c --recursive old/help.c new/help.c
  361. *** old/help.c    Mon Apr 14 19:00:58 1997
  362. --- new/help.c    Sun Jul 13 23:43:20 1997
  363. ***************
  364. *** 44,49 ****
  365. --- 44,55 ----
  366.   
  367.   #include <stdarg.h>
  368.   
  369. + #ifdef __EMX__
  370. + #include <netdb.h>
  371. + #include <sys/types.h>
  372. + #include <dirent.h>
  373. + #endif
  374.   #include "help.h"
  375.   #include "input.h"
  376.   #include "ircaux.h"
  377. diff -c --recursive old/input.c new/input.c
  378. *** old/input.c    Wed Apr 23 20:10:46 1997
  379. --- new/input.c    Mon Jul 14 02:20:20 1997
  380. ***************
  381. *** 52,58 ****
  382.   
  383.   NickTab *tabkey_array = NULL, *autoreply_array = NULL;
  384.   
  385.   
  386.   const int WIDTH = 10;
  387.   
  388. --- 52,60 ----
  389.   
  390.   NickTab *tabkey_array = NULL, *autoreply_array = NULL;
  391.   
  392. ! #ifdef __EMX__
  393. ! static int ESC = 0;
  394. ! #endif
  395.   
  396.   const int WIDTH = 10;
  397.   
  398. ***************
  399. *** 155,161 ****
  400.           return;
  401.       cursor_to_input();
  402.   
  403. !     if (current_screen->promptlist)
  404.           prompt = current_screen->promptlist->prompt;
  405.       else
  406.           prompt = input_prompt;
  407. --- 157,164 ----
  408.           return;
  409.       cursor_to_input();
  410.   
  411. !     if (current_screen->promptlist)
  412.           prompt = current_screen->promptlist->prompt;
  413.       else
  414.           prompt = input_prompt;
  415. ***************
  416. *** 1159,1164 ****
  417. --- 1162,1174 ----
  418.           meta_not_hit;
  419.       int     i;
  420.   
  421. + #ifdef __EMX__
  422. +     if (key == 0) { ESC = 1; return 0; }
  423. +     if (ESC == 1) {
  424. +        ESC = 0; current_screen->meta_hit[1] = 1;
  425. +     }
  426. + #endif
  427.       /* were we waiting for a keypress? */
  428.       if (current_screen->promptlist && current_screen->promptlist->type == WAIT_PROMPT_KEY)
  429.       {
  430. ***************
  431. *** 1179,1185 ****
  432.   
  433.   #ifdef TRANSLATE
  434.       if (translation)
  435. !         extended_key = transFromClient[key];
  436.       else
  437.   #endif
  438.       extended_key = key;
  439. --- 1189,1195 ----
  440.   
  441.   #ifdef TRANSLATE
  442.       if (translation)
  443. !         extended_key = transFromClient[key];
  444.       else
  445.   #endif
  446.       extended_key = key;
  447. diff -c --recursive old/irc.c new/irc.c
  448. *** old/irc.c    Wed Apr 30 15:08:44 1997
  449. --- new/irc.c    Mon Jul 14 22:20:24 1997
  450. ***************
  451. *** 6,12 ****
  452.    * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
  453.    */
  454.   
  455. ! const char irc_version[] = "BitchX-71p2";
  456.   
  457.   /*
  458.    * INTERNAL_VERSION is the number that the special alias $V returns.
  459. --- 6,12 ----
  460.    * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
  461.    */
  462.   
  463. ! const char irc_version[] = "BitchX/2-71p2";
  464.   
  465.   /*
  466.    * INTERNAL_VERSION is the number that the special alias $V returns.
  467. ***************
  468. *** 27,32 ****
  469. --- 27,36 ----
  470.   #endif
  471.   #include <stdarg.h>
  472.   
  473. + #ifdef __EMX__
  474. + #include <netdb.h>
  475. + #endif
  476.   #include "status.h"
  477.   #include "dcc.h"
  478.   #include "names.h"
  479. ***************
  480. *** 356,365 ****
  481.   void display_bitchx(int j) 
  482.   {
  483.   int i = strip_ansi_in_echo;
  484. !     strip_ansi_in_echo = 0; 
  485. !     if (j == -1)
  486.               i = (int) (9.0*rand()/RAND_MAX);
  487. !     else
  488.           i = j;
  489.       switch(i)
  490.       {
  491. --- 360,370 ----
  492.   void display_bitchx(int j) 
  493.   {
  494.   int i = strip_ansi_in_echo;
  495. !     strip_ansi_in_echo = 0;
  496. !     if (j == -1) {
  497.               i = (int) (9.0*rand()/RAND_MAX);
  498. !             if (i == 8) i = 7;
  499. !     } else
  500.           i = j;
  501.       switch(i)
  502.       {
  503. ***************
  504. *** 559,565 ****
  505.   
  506.               break;
  507.           case 8:
  508. ! put_it("(U");
  509.               break;
  510.           default:
  511.               break;
  512. --- 564,570 ----
  513.   
  514.               break;
  515.           case 8:
  516. ! put_it("");
  517.               break;
  518.           default:
  519.               break;
  520. ***************
  521. *** 863,869 ****
  522.       }
  523.   
  524.       if (!ircservers_file)
  525. !         malloc_strcpy(&ircservers_file, ".ircservers");
  526.   
  527.       /* v-- right there was a '!' that should not have been there. */
  528.       if ((ptr = getenv("IRCLIB")))
  529. --- 868,874 ----
  530.       }
  531.   
  532.       if (!ircservers_file)
  533. !         malloc_strcpy(&ircservers_file, "ircserv.txt");
  534.   
  535.       /* v-- right there was a '!' that should not have been there. */
  536.       if ((ptr = getenv("IRCLIB")))
  537. ***************
  538. *** 1023,1029 ****
  539.           malloc_sprintf(&bircrc_file, "%s\\.bitchxrc", my_path);
  540.   #else
  541.       if (bircrc_file == NULL)
  542. !         malloc_sprintf(&bircrc_file, "%s/.bitchxrc", my_path);
  543.   #endif
  544.   
  545.       if ((ptr = getenv("IRCPORT")))
  546. --- 1028,1034 ----
  547.           malloc_sprintf(&bircrc_file, "%s\\.bitchxrc", my_path);
  548.   #else
  549.       if (bircrc_file == NULL)
  550. !         malloc_sprintf(&bircrc_file, "%s/bitchxrc", my_path);
  551.   #endif
  552.   
  553.       if ((ptr = getenv("IRCPORT")))
  554. ***************
  555. *** 1419,1424 ****
  556. --- 1424,1433 ----
  557.       time(&start_time);
  558.       time(&idle_time);
  559.   
  560. + #ifdef __EMX__
  561. + //    setvbuf(stdout, NULL, _IOLBF, 80);
  562. + #endif
  563.   #ifdef SOCKS
  564.       SOCKSinit(argv[0]);
  565.   #endif
  566. ***************
  567. *** 1445,1452 ****
  568.   
  569.       if (!dumb) 
  570.       {
  571. !         my_signal(SIGCONT, term_cont, 0);
  572.           my_signal(SIGWINCH, sig_refresh_screen, 0);
  573.           init_screen();
  574.           }   
  575.       else
  576. --- 1454,1463 ----
  577.   
  578.       if (!dumb) 
  579.       {
  580. ! #ifndef __EMX__
  581. !         my_signal(SIGCONT, term_cont, 0);
  582.           my_signal(SIGWINCH, sig_refresh_screen, 0);
  583. + #endif
  584.           init_screen();
  585.           }   
  586.       else
  587. diff -c --recursive old/ircaux.c new/ircaux.c
  588. *** old/ircaux.c    Wed Apr 30 15:00:26 1997
  589. --- new/ircaux.c    Mon Jul 14 19:10:08 1997
  590. ***************
  591. *** 29,34 ****
  592. --- 29,38 ----
  593.   #endif NTDBG
  594.   #endif WINNT
  595.   
  596. + #ifdef __EMX__
  597. + #include <sys/time.h>
  598. + #include <sys/fcntl.h>
  599. + #endif
  600.   
  601.   #include <sys/stat.h>
  602.   
  603. ***************
  604. *** 1748,1757 ****
  605.   
  606.       if (timer)
  607.       {
  608. !         timer.tv_sec = time2;
  609. !         timer.tv_usec = 0;
  610.           return *timer;
  611. !     }
  612.       timer2.tv_sec = time2;
  613.       timer2.tv_usec = 0;
  614.       return timer2;
  615. --- 1752,1761 ----
  616.   
  617.       if (timer)
  618.       {
  619. !         timer->tv_sec = time2;
  620. !         timer->tv_usec = 0;
  621.           return *timer;
  622. !     }
  623.       timer2.tv_sec = time2;
  624.       timer2.tv_usec = 0;
  625.       return timer2;
  626. ***************
  627. *** 1928,1934 ****
  628.   #if defined(NBLOCK_POSIX)
  629.       nonb |= O_NONBLOCK;
  630.   #else
  631. ! # if defined(NBLOCK_BSD)
  632.       nonb |= O_NDELAY;
  633.   # else
  634.   #  if defined(NBLOCK_SYSV)
  635. --- 1932,1938 ----
  636.   #if defined(NBLOCK_POSIX)
  637.       nonb |= O_NONBLOCK;
  638.   #else
  639. ! # if defined(NBLOCK_BSD) || defined(__EMX__)
  640.       nonb |= O_NDELAY;
  641.   # else
  642.   #  if defined(NBLOCK_SYSV)
  643. ***************
  644. *** 1941,1947 ****
  645.   #  endif
  646.   # endif
  647.   #endif
  648. ! #if (defined(NBLOCK_POSIX) || defined(NBLOCK_BSD)) && !defined(NBLOCK_SYSV)
  649.       if ((res = fcntl(fd, F_GETFL, 0)) == -1)
  650.           return -1;
  651.       else if (fcntl(fd, F_SETFL, res | nonb) == -1)
  652. --- 1945,1951 ----
  653.   #  endif
  654.   # endif
  655.   #endif
  656. ! #if (defined(NBLOCK_POSIX) || defined(NBLOCK_BSD) || defined(__EMX__)) && !defined(NBLOCK_SYSV)
  657.       if ((res = fcntl(fd, F_GETFL, 0)) == -1)
  658.           return -1;
  659.       else if (fcntl(fd, F_SETFL, res | nonb) == -1)
  660. ***************
  661. *** 1957,1963 ****
  662.   #if defined(NBLOCK_POSIX)
  663.       nonb |= O_NONBLOCK;
  664.   #else
  665. ! # if defined(NBLOCK_BSD)
  666.       nonb |= O_NDELAY;
  667.   # else
  668.   #  if defined(NBLOCK_SYSV)
  669. --- 1961,1967 ----
  670.   #if defined(NBLOCK_POSIX)
  671.       nonb |= O_NONBLOCK;
  672.   #else
  673. ! # if defined(NBLOCK_BSD) || defined(__EMX__)
  674.       nonb |= O_NDELAY;
  675.   # else
  676.   #  if defined(NBLOCK_SYSV)
  677. ***************
  678. *** 1970,1976 ****
  679.   #  endif
  680.   # endif
  681.   #endif
  682. ! #if (defined(NBLOCK_POSIX) || defined(NBLOCK_BSD)) && !defined(NBLOCK_SYSV)
  683.       if ((res = fcntl(fd, F_GETFL, 0)) == -1)
  684.           return -1;
  685.       else if (fcntl(fd, F_SETFL, res &~ nonb) == -1)
  686. --- 1974,1980 ----
  687.   #  endif
  688.   # endif
  689.   #endif
  690. ! #if (defined(NBLOCK_POSIX) || defined(NBLOCK_BSD) || defined(__EMX__)) && !defined(NBLOCK_SYSV)
  691.       if ((res = fcntl(fd, F_GETFL, 0)) == -1)
  692.           return -1;
  693.       else if (fcntl(fd, F_SETFL, res &~ nonb) == -1)
  694. diff -c --recursive old/mail.c new/mail.c
  695. *** old/mail.c    Wed Apr 30 15:03:24 1997
  696. --- new/mail.c    Sun Jul 13 23:48:34 1997
  697. ***************
  698. *** 15,21 ****
  699.   #include "misc.h"
  700.   #include <sys/stat.h>
  701.   
  702. ! static    char    *mail_path = NULL;
  703.   static    int    mail_latch = 0;
  704.   
  705.   /*
  706. --- 15,25 ----
  707.   #include "misc.h"
  708.   #include <sys/stat.h>
  709.   
  710. ! #ifdef __EMX__
  711. ! #define UNIX_MAIL "./"
  712. ! #endif
  713. ! static  char    *mail_path = NULL;
  714.   static    int    mail_latch = 0;
  715.   
  716.   /*
  717. Only in new: makefile
  718. Only in new: makefile.bak
  719. diff -c --recursive old/misc.c new/misc.c
  720. *** old/misc.c    Mon May  5 11:53:30 1997
  721. --- new/misc.c    Sun Jul 13 23:49:06 1997
  722. ***************
  723. *** 17,22 ****
  724. --- 17,25 ----
  725.   #include <sys/rusage.h>
  726.   #endif
  727.   
  728. + #ifdef __EMX__
  729. + #include <netdb.h>
  730. + #endif
  731.   
  732.   #include "irc.h"
  733.   #include "server.h"
  734. diff -c --recursive old/network.c new/network.c
  735. *** old/network.c    Sat Apr  5 09:29:54 1997
  736. --- new/network.c    Sun Jul 13 23:49:40 1997
  737. ***************
  738. *** 10,15 ****
  739. --- 10,19 ----
  740.   #include "ircaux.h"
  741.   #include "vars.h"
  742.   
  743. + #ifdef __EMX__
  744. + #include <netdb.h>
  745. + #endif
  746.   #ifdef HAVE_SYS_UN_H
  747.   #include <sys/un.h>
  748.   #endif
  749. diff -c --recursive old/newio.c new/newio.c
  750. *** old/newio.c    Mon Mar 31 22:16:26 1997
  751. --- new/newio.c    Sun Jul 13 23:51:06 1997
  752. ***************
  753. *** 38,44 ****
  754. --- 38,48 ----
  755.   # define IO_ARRAYLEN sysconf(_SC_OPEN_MAX)
  756.   #else
  757.   # ifdef FD_SETSIZE
  758. + #ifndef __EMX__
  759.   #  define IO_ARRAYLEN FDSETSIZE
  760. + #else
  761. + #define IO_ARRAYLEN FD_SETSIZE
  762. + #endif
  763.   # else
  764.   #  define IO_ARRAYLEN NFDBITS
  765.   # endif
  766. diff -c --recursive old/numbers.c new/numbers.c
  767. *** old/numbers.c    Sat Apr 19 21:13:44 1997
  768. --- new/numbers.c    Mon Jul 14 17:03:14 1997
  769. ***************
  770. *** 578,584 ****
  771.       case 001:    /* #define RPL_WELCOME          001 */
  772.       {        
  773.           bitchsay("For more information about \002BitchX\002 type \002/about\002");
  774. !         set_server2_8(from_server, 1);
  775.           set_server_nickname(from_server, user);
  776.           attempting_to_connect--;
  777.           set_server_motd(from_server, 1);
  778. --- 578,585 ----
  779.       case 001:    /* #define RPL_WELCOME          001 */
  780.       {        
  781.           bitchsay("For more information about \002BitchX\002 type \002/about\002");
  782. !         bitchsay("\002BitchX-OS/2\002 port by Taneli \'rosmo\' Leppä <bandit@icenet.fi>");
  783. !         set_server2_8(from_server, 1);
  784.           set_server_nickname(from_server, user);
  785.           attempting_to_connect--;
  786.           set_server_motd(from_server, 1);
  787. diff -c --recursive old/scandir.c new/scandir.c
  788. *** old/scandir.c    Mon Apr  7 17:52:18 1997
  789. --- new/scandir.c    Mon Jul 14 00:03:34 1997
  790. ***************
  791. *** 47,53 ****
  792.   
  793.   # if defined(XD88) || defined(__svr4__) || defined(POSIX) || defined(__linux__) \
  794.     || defined(SVR3) || defined(__osf__) || defined(M_UNIX) || defined(_SEQUENT_) \
  795. !   || defined(__QNX__) || defined(SVR4) || defined(WINNT)
  796.   
  797.   /*
  798.   **  SCANDIR
  799. --- 47,53 ----
  800.   
  801.   # if defined(XD88) || defined(__svr4__) || defined(POSIX) || defined(__linux__) \
  802.     || defined(SVR3) || defined(__osf__) || defined(M_UNIX) || defined(_SEQUENT_) \
  803. !   || defined(__QNX__) || defined(SVR4) || defined(WINNT) || defined(__EMX__)
  804.   
  805.   /*
  806.   **  SCANDIR
  807. ***************
  808. *** 183,190 ****
  809. --- 183,192 ----
  810.       return (-1);
  811.       if ((dirp = opendir(dirname)) == NULL)
  812.       return (-1);
  813. + #ifndef __EMX__
  814.       if (fstat(dirp->dd_fd, &stb) < 0)
  815.       return (-1);
  816. + #endif
  817.   
  818.       /*
  819.        * estimate the array size by taking the size of the directory file and
  820. ***************
  821. *** 218,225 ****
  822. --- 220,229 ----
  823.        */
  824.       if (++nitems >= arraysz)
  825.       {
  826. + #ifndef __EMX__
  827.           if (fstat(dirp->dd_fd, &stb) < 0)
  828.           return (-1);    /* just might have grown */
  829. + #endif
  830.           arraysz = stb.st_size / 12;
  831.           names = (struct direct **) realloc((char *) names,
  832.                        arraysz * sizeof(struct direct *));
  833. diff -c --recursive old/screen.c new/screen.c
  834. *** old/screen.c    Sun Apr 27 07:21:30 1997
  835. --- new/screen.c    Sun Jul 13 23:54:36 1997
  836. ***************
  837. *** 16,21 ****
  838. --- 16,28 ----
  839.   # include <sys/un.h>
  840.   #endif /* HAVE_SYS_UN_H */
  841.   
  842. + #ifdef __EMX__
  843. + struct  sockaddr_un {
  844. +        u_short sun_family;     /* socket family: AF_UNIX */
  845. +        char    sun_path[108];  /* path name (not used) */
  846. + };
  847. + #endif
  848.   #include "screen.h"
  849.   #include "window.h"
  850.   #include "output.h"
  851. diff -c --recursive old/server.c new/server.c
  852. *** old/server.c    Wed Apr 30 15:05:34 1997
  853. --- new/server.c    Mon Jul 14 19:29:14 1997
  854. ***************
  855. *** 914,920 ****
  856.       window_display = 0;
  857.   #ifdef SERVERS_FILE
  858.       malloc_sprintf(&file_path, "%s%s", irc_lib, SERVERS_FILE);
  859. !     if ((fp = fopen(file_path, "r")))
  860.       {
  861.           fgets(buffer, BIG_BUFFER_SIZE, fp);
  862.           while (!feof(fp))
  863. --- 914,920 ----
  864.       window_display = 0;
  865.   #ifdef SERVERS_FILE
  866.       malloc_sprintf(&file_path, "%s%s", irc_lib, SERVERS_FILE);
  867. !     if ((fp = fopen(file_path, "r")))
  868.       {
  869.           fgets(buffer, BIG_BUFFER_SIZE, fp);
  870.           while (!feof(fp))
  871. Only in new: sig.inc
  872. diff -c --recursive old/term.c new/term.c
  873. *** old/term.c    Wed Apr 23 20:12:14 1997
  874. --- new/term.c    Mon Jul 14 22:10:52 1997
  875. ***************
  876. *** 18,23 ****
  877. --- 18,29 ----
  878.   #include "translat.h"
  879.   #endif
  880.   
  881. + #ifdef __EMX__
  882. + #include <sys/fcntl.h>
  883. + #define INCL_VIO
  884. + #include <os2.h>
  885. + #endif
  886.   #ifdef HAVE_SYS_TERMIOS_H
  887.   #include <sys/termios.h>
  888.   #else
  889. ***************
  890. *** 76,81 ****
  891. --- 82,93 ----
  892.   static    int    co;
  893.   static    char    termcap[1024];
  894.   
  895. + #ifdef __EMX__
  896. +     static BYTE pair[1];
  897. +     static USHORT x, y;
  898. +     VIOMODEINFO vmode;
  899. + #endif
  900.   
  901.   /*
  902.    * term_echo: if 0, echo is turned off (all characters appear as blanks), if
  903. ***************
  904. *** 200,206 ****
  905.   extern void term_pause (char unused, char *not_used)
  906.   {
  907.       term_reset();
  908. !     kill(getpid(), SIGSTOP);
  909.   }
  910.   #endif /* NOT IN WTERM_C */
  911.   
  912. --- 212,218 ----
  913.   extern void term_pause (char unused, char *not_used)
  914.   {
  915.       term_reset();
  916. ! /*    kill(getpid(), SIGSTOP); */
  917.   }
  918.   #endif /* NOT IN WTERM_C */
  919.   
  920. ***************
  921. *** 239,244 ****
  922. --- 251,266 ----
  923.           li = 24;
  924.       ptr = termcap;
  925.   
  926. + #ifdef __EMX__
  927. +     vmode.cb = sizeof(VIOMODEINFO);
  928. +     VioGetMode(&vmode, 0);
  929. +     li = vmode.row - 1;
  930. +     co = vmode.col;
  931. +     LI = vmode.row - 1;
  932. +     CO = vmode.col;
  933. + #endif
  934.       /*    
  935.        * Get termcap capabilities
  936.        */    
  937. ***************
  938. *** 278,285 ****
  939.       if (!MD || !ME) { MD = empty_string; ME = empty_string; }
  940.   
  941.   
  942.       if (!CM || !CL || !CE || !ND || (!LE && !BS) || (!CS && !(AL && DL)))
  943. !     {
  944.           fprintf(stderr, "\nYour terminal cannot run IRC II in full screen mode.\n");
  945.           fprintf(stderr, "The following features are missing from your TERM setting.\n");
  946.   
  947. --- 300,308 ----
  948.       if (!MD || !ME) { MD = empty_string; ME = empty_string; }
  949.   
  950.   
  951. + #ifndef __EMX__
  952.       if (!CM || !CL || !CE || !ND || (!LE && !BS) || (!CS && !(AL && DL)))
  953. !     {
  954.           fprintf(stderr, "\nYour terminal cannot run IRC II in full screen mode.\n");
  955.           fprintf(stderr, "The following features are missing from your TERM setting.\n");
  956.   
  957. ***************
  958. *** 295,300 ****
  959. --- 318,326 ----
  960.           fprintf(stderr, "Try using VT100 emulation or better.\n");
  961.           exit(1);
  962.       }
  963. + #else
  964. +     CS = strdup("OS/2 rules!");
  965. + #endif
  966.   
  967.       if (!LE) LE = "\010";
  968.   
  969. ***************
  970. *** 344,350 ****
  971.           newb.c_iflag &= ~IXON;    /* No XON/XOFF */
  972.   #endif
  973.   
  974. !     tcsetattr(tty_des, TCSADRAIN, &newb);
  975.   }
  976.   
  977.   
  978. --- 370,376 ----
  979.           newb.c_iflag &= ~IXON;    /* No XON/XOFF */
  980.   #endif
  981.   
  982. !     tcsetattr(tty_des, TCSADRAIN, &newb);
  983.   }
  984.   
  985.   
  986. ***************
  987. *** 359,364 ****
  988. --- 385,391 ----
  989.   {
  990.       static    int    old_li = -1,
  991.               old_co = -1;
  992. + #ifndef __EMX_
  993.   
  994.   #    if defined (TIOCGWINSZ)
  995.       {
  996. ***************
  997. *** 383,390 ****
  998.           CO = co;
  999.       }
  1000.   #    endif
  1001.       CO--;
  1002.       if ((old_li != LI) || (old_co != CO))
  1003.       {
  1004.           old_li = LI;
  1005. --- 410,417 ----
  1006.           CO = co;
  1007.       }
  1008.   #    endif
  1009.       CO--;
  1010. + #endif
  1011.       if ((old_li != LI) || (old_co != CO))
  1012.       {
  1013.           old_li = LI;
  1014. ***************
  1015. *** 416,434 ****
  1016.       int    i;
  1017.       char    *thing;
  1018.   
  1019. !     if (n > 0)
  1020.           thing = SF ? SF : NL;
  1021.       else if (n < 0)
  1022.       {
  1023.           if (SR)
  1024. !             thing = SR;
  1025.           else
  1026.               return 1;
  1027.       }
  1028.       else
  1029.           return 0;
  1030.   
  1031. !     tputs_x(tgoto(CS, line2, line1));  /* shouldn't do this each time */
  1032.       if (n < 0)
  1033.       {
  1034.           term_move_cursor(0, line1);
  1035. --- 443,462 ----
  1036.       int    i;
  1037.       char    *thing;
  1038.   
  1039. ! #ifndef __EMX__
  1040. !     if (n > 0)
  1041.           thing = SF ? SF : NL;
  1042.       else if (n < 0)
  1043.       {
  1044.           if (SR)
  1045. !             thing = SR;
  1046.           else
  1047.               return 1;
  1048.       }
  1049.       else
  1050.           return 0;
  1051.   
  1052. !     tputs_x(tgoto(CS, line2, line1));  /* shouldn't do this each time */
  1053.       if (n < 0)
  1054.       {
  1055.           term_move_cursor(0, line1);
  1056. ***************
  1057. *** 439,444 ****
  1058. --- 467,480 ----
  1059.       for (i = 0; i < n; i++)
  1060.           tputs_x(thing);
  1061.       tputs_x(tgoto(CS, LI - 1, 0));    /* shouldn't do this each time */
  1062. + #else
  1063. + //    printf("%d, %d, %d", line1, line2, n);
  1064. +     pair[0] = ' '; pair[1] = 7;
  1065. +     vmode.cb = sizeof(VIOMODEINFO);
  1066. +     VioGetMode(&vmode, 0);
  1067. +     if (n > 0) VioScrollUp(line1, 0, line2, vmode.col, n, (PBYTE)&pair, (HVIO) 0);
  1068. +     if (n < 0) { n = -n; VioScrollDn(line1, 0, line2, vmode.col, n, (PBYTE)&pair, (HVIO) 0); }
  1069. + #endif
  1070.       return (0);
  1071.   }
  1072.   
  1073. diff -c --recursive old/translat.c new/translat.c
  1074. *** old/translat.c    Wed Apr 23 20:29:28 1997
  1075. --- new/translat.c    Mon Jul 14 01:32:38 1997
  1076. ***************
  1077. *** 30,36 ****
  1078.   #include "output.h"
  1079.   
  1080.   #ifndef TRANSLATION_PATH
  1081. ! #define TRANSLATION_PATH "/usr/local/lib/irc/translation/"
  1082.   #endif
  1083.   
  1084.   
  1085. --- 30,36 ----
  1086.   #include "output.h"
  1087.   
  1088.   #ifndef TRANSLATION_PATH
  1089. ! #define TRANSLATION_PATH "translat/"
  1090.   #endif
  1091.   
  1092.   
  1093. ***************
  1094. *** 436,439 ****
  1095.   
  1096.       }
  1097.   }
  1098. ! #endif
  1099. \ No newline at end of file
  1100. --- 436,439 ----
  1101.   
  1102.       }
  1103.   }
  1104. ! #endif
  1105.