Subversion Repositories Kolibri OS

Rev

Rev 7890 | Rev 9092 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                                 ;;
  3. ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved.    ;;
  4. ;; Distributed under terms of the GNU General Public License       ;;
  5. ;;                                                                 ;;
  6. ;;  IRC client for KolibriOS                                       ;;
  7. ;;                                                                 ;;
  8. ;;   Written by hidnplayr@kolibrios.org,                           ;;
  9. ;;     text encoder/decoder by Clevermouse.                        ;;
  10. ;;                                                                 ;;
  11. ;;         GNU GENERAL PUBLIC LICENSE                              ;;
  12. ;;          Version 2, June 1991                                   ;;
  13. ;;                                                                 ;;
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15.  
  16. version equ '0.33'
  17.  
  18. ; connection status
  19. STATUS_DISCONNECTED     = 0
  20. STATUS_RESOLVING        = 1
  21. STATUS_CONNECTING       = 2
  22. STATUS_CONNECTED        = 3
  23. STATUS_LOGGED_IN        = 4
  24.  
  25. ; window flags
  26. FLAG_UPDATED            = 1 shl 0
  27. FLAG_RECEIVING_NAMES    = 1 shl 1
  28. FLAG_SCROLL_LOW         = 1 shl 2
  29.  
  30. ; window types
  31. WINDOWTYPE_NONE         = 0
  32. WINDOWTYPE_SERVER       = 1
  33. WINDOWTYPE_CHANNEL      = 2
  34. WINDOWTYPE_CHAT         = 3
  35. WINDOWTYPE_LIST         = 4
  36. WINDOWTYPE_DCC          = 5
  37.  
  38. ; supported encodings
  39. CP866                   = 0
  40. CP1251                  = 1
  41. UTF8                    = 2
  42.  
  43. ; settings
  44. USERCMD_MAX_SIZE        = 400
  45.  
  46. WIN_MIN_X               = 600
  47. WIN_MIN_Y               = 183
  48.  
  49. TEXT_X                  = 2
  50. TEXT_Y                  = TOP_Y + 2
  51.  
  52. TOP_SPACE               = 2
  53. TAB_HEIGHT              = 14
  54. TAB_WIDTH               = 120
  55. TAB_SPACE               = 5
  56. TOP_Y                   = TOP_SPACE+ TAB_HEIGHT
  57. INPUTBOX_HEIGHT         = 13
  58.  
  59. MAX_WINDOWS             = 20
  60. MAX_USERS               = 4096
  61. TEXT_BUFFERSIZE         = 1024*1024
  62.  
  63. MAX_NICK_LEN            = 32
  64. MAX_REAL_LEN            = 32    ; realname
  65. QUIT_MSG_LEN            = 250
  66. MAX_SERVER_NAME         = 256
  67.  
  68. MAX_CHANNEL_LEN         = 40
  69. MAX_CHANNELS            = 37
  70.  
  71. MAX_COMMAND_LEN         = 512
  72.  
  73. PACKETBUF_SIZE          = 1024
  74. PATH_SIZE               = 1024
  75. PARAM_SIZE              = 1024
  76. SERVERCOMMAND_SIZE      = 600
  77.  
  78. TIMESTAMP               = 3     ; 3 = hh:mm:ss, 2 = hh:mm, 0 = no timestamp
  79.  
  80. MAX_WINDOWNAME_LEN      = 256
  81.  
  82. WINDOW_BTN_START        = 100
  83. WINDOW_BTN_CLOSE        = 2
  84. WINDOW_BTN_LIST         = 3
  85.  
  86. SCROLLBAR_WIDTH         = 14
  87. USERLIST_WIDTH          = 160
  88.  
  89. FONT_WIDTH              = 8
  90. FONT_HEIGHT             = 16
  91.  
  92. format binary as ""
  93.  
  94. use32
  95.  
  96.         org     0x0
  97.  
  98.         db      'MENUET01'              ; 8 byte id
  99.         dd      1                       ; header version
  100.         dd      START                   ; program start
  101.         dd      I_END                   ; program image size
  102.         dd      IM_END+2048             ; required amount of memory
  103.         dd      IM_END+2048
  104.         dd      param
  105.         dd      path
  106.  
  107. include "../../macros.inc"
  108. include "../../proc32.inc"
  109. include "../../dll.inc"
  110. include "../../network.inc"
  111. include "../../struct.inc"
  112. include "../../develop/libraries/box_lib/trunk/box_lib.mac"
  113.  
  114. struct  window
  115.         data_ptr        dd ?
  116.         flags           db ?
  117.         type            db ?
  118.         name            rb MAX_WINDOWNAME_LEN
  119.         users           dd ?
  120.         users_scroll    dd ?
  121.         selected        dd ?            ; selected user, 0 if none selected
  122.  
  123.         text_start      dd ?            ; pointer to current textbox data
  124.         text_end        dd ?
  125.         text_print      dd ?            ; pointer to first character to print on screen
  126.         text_line_print dd ?            ; line number of that character
  127.         text_write      dd ?            ; write pointer
  128.         text_lines      dd ?            ; total number of lines
  129.         text_scanned    dd ?            ; pointer to beginning of unscanned data (we still need to count number of lines, insert newline characters,..)
  130.  
  131. ends
  132.  
  133. struct  window_data
  134.         text            rb TEXT_BUFFERSIZE
  135.         names           rb MAX_NICK_LEN * MAX_USERS
  136. ends
  137.  
  138. include "encodings.inc"
  139. include "window.inc"
  140. include "serverparser.inc"
  141. include "userparser.inc"
  142. include "socket.inc"
  143. include "gui.inc"
  144. include "users.inc"
  145. include "textbox.inc"
  146.  
  147.  
  148. START:
  149.  
  150.         mcall   68, 11                  ; init heap so we can allocate memory dynamically
  151.  
  152. ; wanted events
  153.         mcall   40, EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_STACK+EVM_MOUSE+EVM_MOUSE_FILTER
  154.  
  155. ; load libraries
  156.         stdcall dll.Load, @IMPORT
  157.         test    eax, eax
  158.         jnz     exit
  159.  
  160. ; find path to main settings file (ircc.ini)
  161.         mov     edi, path               ; Calculate the length of zero-terminated string
  162.         xor     al, al
  163.         mov     ecx, PATH_SIZE
  164.         repne   scasb
  165.         dec     edi
  166.         mov     eax, '.ini'
  167.         stosd
  168.         xor     al, al
  169.         stosb
  170.  
  171. ; Fill the window buffer with zeros
  172.         mov     edi, windows
  173.         mov     ecx, (sizeof.window*MAX_WINDOWS+3)/4
  174.         xor     eax, eax
  175.         rep     stosd
  176.  
  177. ; clear command area too
  178.         mov     edi, servercommand
  179.         mov     ecx, SERVERCOMMAND_SIZE/4
  180.         rep     stosd
  181.  
  182. ; allocate window data block
  183.         mov     ebx, windows
  184.         call    window_create_textbox
  185.         test    eax, eax
  186.         jz      exit
  187.         mov     [ebx + window.type], WINDOWTYPE_SERVER
  188.  
  189. ; get settings from ini
  190.         invoke  ini.get_str, path, str_user, str_nick, user_nick, MAX_NICK_LEN, default_nick
  191.         invoke  ini.get_str, path, str_user, str_real, user_real_name, MAX_REAL_LEN, default_real
  192.         invoke  ini.get_str, path, str_user, str_quitmsg, quit_msg, 250, default_quit
  193.  
  194. ; Welcome user
  195.         mov     esi, str_welcome
  196.         call    print_asciiz
  197.  
  198. ; Check if parameter contains an URL
  199.         cmp     byte[param], 0
  200.         je      @f
  201.         mov     esi, param
  202.         mov     ecx, PARAM_SIZE
  203.         call    cmd_usr_server.now
  204.   @@:
  205.  
  206. redraw:
  207.         call    draw_window
  208.  
  209. mainloop:
  210.         mcall   10              ; wait for event
  211.  
  212.         dec     eax
  213.         jz      redraw
  214.  
  215.         dec     eax
  216.         jz      main_window_key
  217.  
  218.         dec     eax
  219.         jz      button
  220.  
  221.         cmp     al, 3
  222.         je      mouse
  223.  
  224.         call    process_network_event
  225.  
  226.         mov     edi, [window_active]
  227.         test    [edi + window.flags], FLAG_UPDATED
  228.         jz      .no_update
  229.         call    draw_channel_text
  230.         mov     edi, [window_active]
  231.         cmp     [edi + window.type], WINDOWTYPE_CHANNEL
  232.         jne     .no_update
  233.         call    draw_user_list
  234.   .no_update:
  235.         call    highlight_updated_tabs
  236.  
  237.         jmp     mainloop
  238.  
  239. button:
  240.  
  241.         mcall   17              ; get id
  242.         ror     eax, 8
  243.  
  244.         cmp     ax, 1           ; close program
  245.         je      quit
  246.  
  247.         cmp     ax, WINDOW_BTN_CLOSE
  248.         jne     @f
  249.         call    cmd_usr_close_window
  250.         jmp     mainloop
  251.  
  252.   @@:
  253.         cmp     ax, WINDOW_BTN_LIST
  254.         jne     @f
  255.  
  256.         push    eax
  257.  
  258.         mcall   37, 1           ; Get mouse position
  259.         sub     ax, TEXT_Y
  260.         mov     bl, FONT_HEIGHT
  261.         div     bl
  262.         and     eax, 0x000000ff
  263.         inc     eax
  264.         add     eax, [scroll1.position]
  265.         mov     ebx, [window_active]
  266.         mov     [ebx + window.selected], eax
  267.  
  268.         call    draw_user_list
  269.  
  270.         pop     eax
  271.         test    eax, 1 shl 25   ; Right mouse button pressed?
  272.         jz      mainloop
  273.  
  274. ; TODO: check if selected nick is my nick!
  275.  
  276. ; Right mouse BTN was pressed, open chat window
  277.         mov     ebx, [window_active]
  278.         mov     eax, [ebx + window.selected]
  279.         dec     eax
  280.         imul    eax, MAX_NICK_LEN
  281.         mov     ebx, [ebx + window.data_ptr]
  282.         lea     esi, [ebx + window_data.names + eax]
  283. ; Strip user prefixes
  284.         cmp     byte[esi], '~'
  285.         je      .inc
  286.         cmp     byte[esi], '&'
  287.         je      .inc
  288.         cmp     byte[esi], '@'
  289.         je      .inc
  290.         cmp     byte[esi], '%'
  291.         je      .inc
  292.         cmp     byte[esi], '+'
  293.         je      .inc
  294.   .open:
  295.         call    window_open
  296.         test    ebx, ebx
  297.         jz      mainloop
  298.         mov     [window_active], ebx
  299.         call    redraw
  300.  
  301.         jmp     mainloop
  302.   .inc:
  303.         inc     esi
  304.         jmp     .open
  305.  
  306.   @@:
  307.         sub     ax, WINDOW_BTN_START
  308.         jb      quit
  309.  
  310.         cmp     ax, MAX_WINDOWS
  311.         ja      quit
  312.  
  313. ; Save users scrollbar position
  314.         push    [scroll1.position]
  315.         mov     edx, [window_active]
  316.         pop     [edx + window.users_scroll]
  317.  
  318. ; OK, time to switch to another window.
  319.         mov     dx, sizeof.window
  320.         mul     dx
  321.         shl     edx, 16
  322.         mov     dx, ax
  323.         add     edx, windows
  324.         cmp     [edx + window.type], WINDOWTYPE_NONE
  325.         je      quit
  326.         mov     [window_active], edx
  327.  
  328.         push    [edx + window.text_line_print]
  329.         pop     [scroll2.position]
  330.  
  331.         push    [edx + window.users_scroll]
  332.         pop     [scroll1.position]
  333.  
  334.         call    draw_window
  335.         jmp     mainloop
  336.  
  337. quit:
  338.         cmp     [socketnum], 0
  339.         je      @f
  340.         mov     esi, quit_msg
  341.         call    quit_server
  342.   @@:
  343.  
  344. exit:
  345.  
  346. ; Close all open windows
  347.         call    window_close_all
  348.  
  349. ; Erase RAM areas which could contain the connection details
  350.         xor     eax, eax
  351.         mov     edi, irc_server_name
  352.         mov     ecx, MAX_SERVER_NAME
  353.         rep stosb
  354.  
  355.         mov     edi, user_nick
  356.         mov     ecx, MAX_NICK_LEN
  357.         rep stosb
  358.  
  359.         mov     edi, user_real_name
  360.         mov     ecx, MAX_REAL_LEN
  361.         rep stosb
  362.  
  363.         mov     edi, sockaddr1
  364.         mov     ecx, SOCKADDR1_SIZE
  365.         rep stosb
  366.  
  367.         mcall   -1
  368.  
  369.  
  370.  
  371. main_window_key:
  372.  
  373.         mcall   2
  374.  
  375.         push    dword edit1
  376.         call    [edit_box_key]
  377.  
  378. ;        cmp     ah, 178
  379. ;        jne     .no_up
  380. ;
  381. ;        jmp     mainloop
  382. ;
  383. ;
  384. ;  .no_up:
  385. ;        cmp     ah, 177
  386. ;        jne     .no_down
  387. ;
  388. ;        jmp     mainloop
  389. ;
  390. ;  .no_down:
  391.         cmp     ah, 13          ; enter
  392.         jne     no_send2
  393.  
  394.         call    user_parser
  395.  
  396.         mov     eax, [edit1.size]
  397.  
  398.         mov     [edit1.size], 0
  399.         mov     [edit1.pos], 0
  400.  
  401.         invoke  edit_box_draw, edit1
  402.  
  403.         call    draw_channel_text
  404.  
  405.         jmp     mainloop
  406.   no_send2:
  407.  
  408.         jmp     mainloop
  409.  
  410. mouse:
  411.         invoke  edit_box_mouse, edit1
  412.  
  413. ;        mcall   37, 7
  414. ;        movsx   eax, ax
  415. ;        add     [scroll2.position], eax
  416.  
  417. ; TODO: check if scrollbar is active?
  418.         mov     edi, [window_active]
  419.         cmp     [edi + window.type], WINDOWTYPE_CHANNEL
  420.         jne     @f
  421.         push    [scroll1.position]
  422.         invoke  scrollbar_mouse, scroll1
  423.         pop     eax
  424.         cmp     eax, [scroll1.position] ; did the scrollbar move?
  425.         je      @f
  426.         call    draw_user_list
  427.   @@:
  428.  
  429. ; TODO: check if scrollbar is active?
  430.         mov     edi, [window_active]
  431.         mov     eax, [edi + window.text_lines]
  432.         cmp     eax, [textbox_height]
  433.         jbe     @f
  434.         invoke  scrollbar_mouse, scroll2
  435.         mov     edi, [window_active]
  436.         and     [edi+window.flags], not FLAG_SCROLL_LOW
  437.         mov     edx, [scroll2.position]
  438.         add     edx, [scroll2.cur_area]
  439.         sub     edx, [scroll2.max_area]
  440.         jne     .not_low
  441.         or      [edi+window.flags], FLAG_SCROLL_LOW
  442.   .not_low:
  443.         mov     edx, [scroll2.position]
  444.         sub     edx, [edi + window.text_line_print]
  445.         je      @f
  446.         call    draw_channel_text.scroll_to_pos
  447.   @@:
  448.  
  449.         jmp     mainloop
  450.  
  451.  
  452. ; DATA AREA
  453.  
  454. encoding_text:
  455. db      'CP866 '
  456. db      'CP1251'
  457. db      'UTF-8 '
  458. encoding_text_len = 6
  459.  
  460. join_header             db 3, '3* ', 0
  461. quit_header             db 3, '5* ', 0
  462. nick_header             db 3, '2* ', 0
  463. kick_header             db 3, '5* ', 0
  464. mode_header             db 3, '2* ', 0
  465. part_header             db 3, '5* ', 0
  466. topic_header            db 3, '3* ', 0
  467. action_header           db 3, '6* ', 0
  468. ctcp_header             db 3, '13-> [', 0
  469. ctcp_header_recv        db 3, '13', 0
  470. msg_header              db 3, '7-> *', 0
  471. ctcp_version            db '] VERSION', 10, 0
  472. ctcp_ping               db '] PING', 10, 0
  473. ctcp_time               db '] TIME', 10, 0
  474.  
  475. has_left_channel        db ' has left ', 0
  476. joins_channel           db ' has joined ', 0
  477. is_now_known_as         db ' is now known as ', 0
  478. has_quit_irc            db ' has quit IRC', 10, 0
  479.  
  480. sets_mode               db ' sets mode ', 0
  481. str_kicked              db ' is kicked from ', 0
  482. str_by                  db ' by ', 0
  483. str_nickchange          db 'Nickname is now ', 0
  484. str_realchange          db 'Real name is now ', 0
  485. str_talking             db 'Now talking in ', 0
  486. str_topic               db 'Topic is "', 0
  487. str_topic_end           db '"', 10, 0
  488. str_setby               db 'Set by ', 0
  489.  
  490. str_connecting          db 3, '3* Connecting to ', 0
  491. str_sockerr             db 3, '5* Socket error', 10, 0
  492. str_dnserr              db 3, '5* Unable to resolve hostname', 10, 0
  493. str_refused             db 3, '5* Connection refused', 10, 0
  494. str_srv_disconnected    db 3, '5* Server disconnected', 10, 0
  495. str_disconnected        db 3, '5* Disconnected', 10, 0
  496. str_reconnect           db 3, '5* Connection reset by user', 10, 0
  497. str_notconnected        db 3, '5* You are not connected', 10, 0
  498. str_notchannel          db 3, '5* You are not on a channel', 10, 0
  499. str_notloggedin         db 3, '5* You are not logged in to the server', 10, 0
  500.  
  501. str_1                   db 3, '13 -', 0
  502. str_2                   db '- ', 0
  503.  
  504. str_list                db 'list', 0
  505.  
  506. str_help                db 'The following commands are available:', 10
  507.                         db 10
  508.                         db '/nick <nick>         : change nickname', 10
  509.                         db '/real <real name>    : change real name', 10
  510.                         db '/server <address>    : connect to server', 10
  511.                         db '/code <code>         : change codepage (cp866, cp1251, or utf8)', 10
  512.                         db '/join <channel>      : join a channel', 10
  513.                         db '/part <channel>      : part from a channel', 10
  514.                         db '/quit                : quit server', 10
  515.                         db '/msg <user>          : send a private message', 10
  516.                         db '/ctcp <user>         : send a message using client-to-client protocol', 10
  517.                         db 10
  518.                         db 'Other commands are sent straight to a server', 10
  519.                         db 10, 0
  520.  
  521. str_welcome             db 3, '3 ___', 3, '7__________', 3, '6_________  ', 3, '4         __   __               __', 10
  522.                         db 3, '3|   \', 3, '7______   \', 3, '6_   ___ \ ', 3, '4   ____ |  | |__| ____   _____/  |_', 10
  523.                         db 3, '3|   |', 3, '7|       _/', 3, '6    \  \/ ', 3, '4 _/ ___\|  | |  |/ __ \ /    \   __\', 10
  524.                         db 3, '3|   |', 3, '7|    |   \', 3, '6     \____', 3, '4 \  \___|  |_|  \  ___/|   |  \  |', 10
  525.                         db 3, '3|___|', 3, '7|____|_  /', 3, '6\______  /', 3, '4  \___  >____/__|\___  >___|  /__|', 10
  526.                         db 3, '3     ', 3, '7       \/ ', 3, '6       \/ ', 3, '4      \/             \/     \/', 10
  527.                         db 'Welcome to KolibriOS IRC client ', version, 10
  528.                         db 'Type /help for help', 10, 0
  529.  
  530. str_version             db 'VERSION KolibriOS '
  531. str_programname         db 'IRC client ', version, 0
  532.  
  533. str_user                db 'user', 0
  534. str_nick                db 'nick', 0
  535. str_real                db 'realname', 0
  536. str_email               db 'email', 0
  537. str_quitmsg             db 'quitmsg', 0
  538.  
  539. default_nick            db 'kolibri_user', 0
  540. default_real            db 'Kolibri User', 0
  541. default_quit            db 'KolibriOS forever', 0
  542.  
  543. closing_cross           db 'x',0
  544.  
  545. irc_colors              dd 0xffffff     ;  0 white
  546.                         dd 0x000000     ;  1 black
  547.                         dd 0x00007f     ;  2 blue (navy)
  548.                         dd 0x009300     ;  3 green
  549.                         dd 0xff0000     ;  4 red
  550.                         dd 0x7f0000     ;  5 brown (maroon)
  551.                         dd 0x9c009c     ;  6 purple
  552.                         dd 0xfc7f00     ;  7 olive
  553.                         dd 0xffff00     ;  8 yellow
  554.                         dd 0x00fc00     ;  9 light green
  555.                         dd 0x009393     ; 10 teal
  556.                         dd 0x00ffff     ; 11 cyan
  557.                         dd 0x0000fc     ; 12 royal blue
  558.                         dd 0xff00ff     ; 13 pink
  559.                         dd 0x7f7f7f     ; 14 grey
  560.                         dd 0xd4d0c4     ; 15 light grey (silver)
  561.  
  562. sockaddr1:
  563.         dw AF_INET4
  564. .port   dw 0x0b1a       ; 6667          FIXMEEEEEE
  565. .ip     dd 0
  566.         rb 10
  567.  
  568. SOCKADDR1_SIZE          = 18
  569.  
  570. status                  dd STATUS_DISCONNECTED
  571.  
  572. window_active           dd windows
  573. window_print            dd windows
  574.  
  575. align 4
  576. @IMPORT:
  577.  
  578. library network,        'network.obj',\
  579.         libini,         'libini.obj',\
  580.         boxlib,         'box_lib.obj'
  581.  
  582. import  network,\
  583.         getaddrinfo,    'getaddrinfo',\
  584.         freeaddrinfo,   'freeaddrinfo',\
  585.         inet_ntoa,      'inet_ntoa'
  586.  
  587. import  libini,\
  588.         ini.get_str,    'ini_get_str',\
  589.         ini.get_int,    'ini_get_int'
  590.  
  591. import  boxlib,\
  592.         edit_box_draw,  'edit_box',\
  593.         edit_box_key,   'edit_box_key',\
  594.         edit_box_mouse, 'edit_box_mouse',\
  595.         scrollbar_draw, 'scrollbar_v_draw',\
  596.         scrollbar_mouse,'scrollbar_v_mouse'
  597.  
  598.         ;         width, left, top
  599. edit1   edit_box  0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0x000000, USERCMD_MAX_SIZE, input_text, mouse_dd, ed_always_focus, 25, 25
  600.         ;         xsize, xpos, ysize, ypos, btn_height, max, cur, pos, bgcol, frcol, linecol
  601. scroll1 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
  602. scroll2 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1
  603.  
  604. input_text      db '/server irc.libera.chat', 0
  605.                 rb MAX_COMMAND_LEN
  606.  
  607. I_END:
  608.  
  609. user_command    rb MAX_COMMAND_LEN*4
  610. .size           dd ?
  611.  
  612. utf8_bytes_rest dd ?            ; bytes rest in current UTF8 sequence
  613. utf8_char       dd ?            ; first bits of current UTF8 character
  614.  
  615. packetbuf       rb PACKETBUF_SIZE         ; buffer for packets to server
  616. path            rb PATH_SIZE
  617. param           rb PARAM_SIZE
  618.  
  619. servercommand   rb SERVERCOMMAND_SIZE
  620.  
  621. thread_info     process_information
  622. xsize           dd ?
  623. ysize           dd ?
  624. mouse_dd        dd ?
  625.  
  626. textbox_height  dd ?            ; in characters
  627. textbox_width   dd ?            ; in characters, not pixels ;)
  628.  
  629. colors          system_colors
  630.  
  631. irc_server_name rb MAX_SERVER_NAME      ; TODO: move this server URL into window struct
  632. socketnum       dd ?                    ; TODO: same for socket
  633.  
  634. user_nick       rb MAX_NICK_LEN
  635. user_real_name  rb MAX_REAL_LEN
  636. quit_msg        rb QUIT_MSG_LEN
  637.  
  638. windows         rb MAX_WINDOWS*sizeof.window
  639.  
  640. IM_END: