COMPILATION LISTING OF SEGMENT tty_printer_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1740.0 mst Mon Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 /* format: style4,delnl,insnl,tree,ifthenstmt,indnoniterend */ 12 tty_printer_: 13 procedure; 14 15 16 /* tty_printer_: An I/O module for communicating with tty_ or syn_ from any remote_XXX_ I/O module */ 17 18 /* Coded 4/79 by J. C. Whitmore */ 19 /* Modified October 1981 by C. Hornig to not call dial_manager_. */ 20 21 /* Parameters */ 22 23 dcl a_iocbp ptr; 24 dcl a_option (*) char (*) var; /* Options for attach */ 25 dcl a_sw bit (1); /* com_err_ switch for attach */ 26 dcl a_code fixed bin (35); 27 dcl a_mode fixed bin; /* The open mode */ 28 dcl a_buf_ptr ptr; 29 dcl a_data_ptr ptr; 30 dcl a_buf_chars fixed bin (21); 31 dcl a_data_chars fixed bin (21); 32 dcl a_pos_type fixed bin; 33 dcl a_pos_value fixed bin (21); 34 dcl a_order char (*); 35 dcl a_infop ptr; 36 dcl a_new_modes char (*); 37 dcl a_old_modes char (*); 38 39 /* Automatic */ 40 41 dcl com_err_sw bit (1); /* Set if com_err_ sould be called on attach error */ 42 dcl attach_tag picture "99"; 43 dcl code fixed bin (35); 44 dcl iocbp ptr; 45 dcl mask bit (36) aligned; /* For setting ips mask */ 46 dcl i fixed bin (21); 47 dcl open_mode fixed bin; 48 dcl modes char (64); /* for setting initial modes or "reset" control */ 49 dcl old_modes char (256); 50 dcl order char (32); 51 dcl infop ptr; 52 dcl temp_ptr ptr; /* for the repeat loop chain search */ 53 dcl term_type char (32); 54 dcl my_attach_options char (256) var; 55 dcl next_attach_options char (256) var; 56 dcl next_attach_desc char (256) var; 57 dcl next_module char (32) var; 58 dcl target_device char (32) var; 59 60 /* Internal static */ 61 62 dcl attach_count fixed bin init (0) int static; 63 dcl first_dibp ptr int static init (null); /* pointer to first device info block in chain */ 64 dcl last_dibp ptr int static init (null); /* pointer to the tail of the info block chain */ 65 dcl areap ptr int static init (null); /* pointer to our area segment */ 66 dcl static_com_err_sw bit (1) int static init ("0"b); /* for testing only */ 67 68 /* Based variables */ 69 70 dcl my_area area (262144) based (areap); 71 72 dcl info_fixed fixed bin based (infop); /* fixed bin control argument */ 73 74 75 /* Constants */ 76 77 dcl my_device_name char (12) int static options (constant) init ("tty_printer_"); 78 dcl space char (1) static int init (" ") options (constant); 79 80 dcl error_table_$bad_conversion fixed bin (35) ext; 81 dcl error_table_$no_operation fixed bin (35) ext; 82 dcl error_table_$bad_mode ext fixed bin (35); 83 dcl error_table_$not_detached ext fixed bin (35); 84 dcl error_table_$not_attached ext fixed bin (35); 85 dcl error_table_$not_open ext fixed bin (35); 86 dcl error_table_$not_closed ext fixed bin (35); 87 dcl error_table_$wrong_no_of_args ext fixed bin (35); 88 dcl error_table_$noarg ext fixed bin (35); 89 dcl error_table_$badopt ext fixed bin (35); 90 91 92 /* External stuff */ 93 94 dcl ( 95 ioa_, 96 ioa_$rsnnl 97 ) entry options (variable); 98 dcl com_err_ entry options (variable); 99 dcl continue_to_signal_ entry (fixed bin (35)); 100 dcl get_temp_segment_ entry (char (*), ptr, fixed bin (35)); 101 dcl hcs_$reset_ips_mask entry (bit (36) aligned, bit (36) aligned); 102 dcl hcs_$set_ips_mask entry (bit (36) aligned, bit (36) aligned); 103 dcl convert_ipc_code_ entry (fixed bin (35)); 104 dcl ipc_$block entry (ptr, ptr, fixed bin (35)); 105 dcl iox_$attach_name entry (char (*), ptr, char (*), ptr, fixed bin (35)); 106 dcl iox_$close entry (ptr, fixed bin (35)); 107 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); 108 dcl iox_$detach_iocb entry (ptr, fixed bin (35)); 109 dcl iox_$err_no_operation entry; 110 dcl iox_$get_chars entry (ptr, ptr, fixed bin (21), fixed bin (21), fixed bin (35)); 111 dcl iox_$get_line entry (ptr, ptr, fixed bin (21), fixed bin (21), fixed bin (35)); 112 dcl iox_$modes entry (ptr, char (*), char (*), fixed bin (35)); 113 dcl iox_$open entry (ptr, fixed bin, bit (36), fixed bin (35)); 114 dcl iox_$position entry (ptr, fixed bin, fixed bin (21), fixed bin (35)); 115 dcl iox_$propagate entry (ptr); 116 dcl iox_$put_chars entry (ptr, ptr, fixed bin (21), fixed bin (35)); 117 118 119 120 /* External Variables */ 121 122 dcl tty_printer_conv_$send_vt fixed bin ext; 123 dcl tty_printer_conv_$send_ht fixed bin ext; 124 125 126 /* Internal PL/I Stuff */ 127 128 dcl (addr, bin, codeptr, hbound, null, rtrim, empty, unspec, max, fixed) builtin; 129 130 dcl conversion condition; 131 dcl any_other condition; 132 dcl cleanup condition; 133 134 dcl adp ptr; /* local copy of pointer to attach data */ 135 136 dcl 1 ad aligned based (adp), 137 2 fixed, 138 3 phys_line_length fixed bin, 139 2 bits unal, 140 3 ht bit (1), /* on if caller wants to send tabs */ 141 3 vt bit (1), /* on if caller wants to send VT chars */ 142 2 ptrs, 143 3 dibp ptr, /* device info block pointer for this attachment */ 144 3 iocbp ptr, /* for easy debugging, ptr back to our iocb */ 145 2 chars, 146 3 device_type char (32), /* device type using this switch (e.g. printer, teleprinter) */ 147 3 term_type char (32), /* the -ttp option for this attachment */ 148 3 attach_desc char (256) var, /* how this switch was attached */ 149 3 open_description char (24) var; /* and how it was opened */ 150 151 152 dcl dibp ptr; /* pointer to device info block */ 153 154 dcl 1 dib aligned based (dibp), /* device info block for per target device data */ 155 2 term_type, /* info for the set_term_type control order */ 156 3 version fixed bin, /* version if this structure (=1) */ 157 3 name char (32) unal, /* terminal type name */ 158 3 flags, 159 4 initial_string bit (1) unal, /* TRUE - if initial string should be sent (tab set) */ 160 4 modes bit (1) unal, /* TRUE - if default initial modes are to be set */ 161 4 ignore_line_type bit (1) unal, /* always FALSE for us, we want the cross check */ 162 4 MBZ bit (33) unal, /* Must Be Zero */ 163 2 device char (32), /* name of the target device or switch */ 164 2 module char (32), /* name of the next IO module */ 165 2 output_switch char (32) unaligned, /* what we are attached to (sw name) */ 166 2 next_iocbp ptr, /* iocb ptr for output_switch */ 167 2 fwd_ptr ptr, /* forward pointer in chain of info blocks */ 168 2 back_ptr ptr, /* backwards pointer to previous block */ 169 2 wait_list, /* list for ipc_$block, must start on even word */ 170 3 n_chan fixed bin, /* number of channels in list (Must Be 1) */ 171 3 wait_pad fixed bin, 172 3 channel fixed bin (71), /* IPC channel to get wakeup */ 173 2 flags, 174 3 attached bit (1) unal, /* device is ready to be opened */ 175 3 open bit (1) unal, /* device is ready to do I/O */ 176 2 n_attached fixed bin, /* number of switches attached to this device */ 177 2 max_line_length fixed bin; /* the longest phys_line_length requested */ 178 179 dcl 1 event_info aligned like event_wait_info; 180 181 dcl 1 write_info aligned, 182 2 channel fixed bin (71), 183 2 write_pending bit (1); 184 185 /* Attach entry point */ 186 187 tty_printer_attach: 188 entry (a_iocbp, a_option, a_sw, a_code); 189 190 iocbp = a_iocbp; 191 com_err_sw = a_sw; 192 code, a_code = 0; 193 194 adp, dibp = null; /* these will be checked by abort_attach */ 195 196 if iocbp -> iocb.attach_descrip_ptr ^= null then do; 197 code = error_table_$not_detached; 198 call abort_attach ("^a", iocbp -> iocb.name); 199 end; 200 201 if areap = null then do; /* make an area once per process */ 202 call get_temp_segment_ (my_device_name, areap, code); 203 if code ^= 0 then call abort_attach ("Unable to allocate temp segment.", ""); 204 my_area = empty (); /* initialize the area */ 205 end; 206 207 on cleanup call clean_up; /* save the area, please */ 208 209 allocate ad in (my_area) set (adp); /* make an attach data structure allocation */ 210 211 /* Initialize variables */ 212 213 ad.bits = "0"b; 214 ad.ptrs = null; 215 ad.chars = ""; 216 ad.phys_line_length = 0; 217 ad.iocbp = iocbp; /* so we can find the IOCB for debugging */ 218 219 next_attach_desc, next_attach_options = ""; 220 target_device, next_module, term_type = ""; 221 my_attach_options = ""; 222 223 /* Are there enough attach options specified? */ 224 225 if hbound (a_option, 1) < 4 then do; /* Must be at least -tty XX and -comm YY */ 226 code = error_table_$wrong_no_of_args; 227 call abort_attach ("Bad attach description.", ""); 228 end; 229 230 /* Process options */ 231 232 do i = 1 to hbound (a_option, 1); 233 if a_option (i) ^= "-comm" then my_attach_options = my_attach_options || space || a_option (i); 234 if /* case */ a_option (i) = "-terminal_type" | a_option (i) = "-ttp" then do; 235 term_type = get_arg (); 236 end; 237 else if a_option (i) = "-physical_line_length" | a_option (i) = "-pll" 238 then ad.phys_line_length = cv_dec_arg (); 239 else if a_option (i) = "-horizontal_tab" | a_option (i) = "-htab" then ad.ht = "1"b; 240 else if a_option (i) = "-vtab" then ad.vt = "1"b; 241 else if a_option (i) = "-device" then ad.device_type = get_arg (); 242 else if a_option (i) = "-auto_call" 243 then next_attach_options = next_attach_options || " -destination " || get_arg (); 244 else if a_option (i) = "-tty" then target_device = get_arg (); 245 else if a_option (i) = "-comm" then do; 246 i = i + 1; 247 if i > hbound (a_option, 1) then goto no_arg; 248 next_module = a_option (i); 249 end; 250 else next_attach_options = next_attach_options || space || a_option (i); 251 end; 252 253 if target_device = "" then do; 254 code = error_table_$badopt; 255 call abort_attach ("No ""-tty"" option given.", ""); 256 end; 257 258 if next_module = "" then do; 259 code = error_table_$badopt; 260 call abort_attach ("No ""-comm"" option given.", ""); 261 end; 262 263 /* find a device info block for the target device */ 264 265 do temp_ptr = first_dibp repeat (temp_ptr -> dib.fwd_ptr) while (temp_ptr ^= null & dibp = null); 266 if temp_ptr -> dib.device = target_device 267 then /* previously defined? */ 268 dibp = temp_ptr; 269 end; 270 271 if dibp = null then do; /* first for this device */ 272 call make_dib (dibp); /* create a device info block for the target device */ 273 dib.device = target_device; 274 dib.module = next_module; 275 dib.term_type.name = term_type; /* ready to give set_term_type control */ 276 dib.term_type.initial_string = "1"b; /* send the initial tab string if it exists */ 277 dib.term_type.modes = "1"b; /* we always want the default modes set */ 278 end; 279 280 ad.dibp = dibp; /* point this back to its device info block */ 281 ad.term_type = term_type; /* record the -ttp option */ 282 283 /* Before attaching, finish the attach data by checking for default values of optional attach options */ 284 285 if ad.device_type = "" then ad.device_type = "teleprinter"; 286 /* the default */ 287 288 if ad.phys_line_length = 0 289 then /* if not given */ 290 if ad.device_type = "printer" 291 then ad.phys_line_length = 136; 292 else ad.phys_line_length = 118; /* for a terminet */ 293 294 ad.attach_desc = my_device_name || space || next_module || space || my_attach_options; 295 296 /* If we need to attach, attach through next_module to target_device (which may be a switch) */ 297 298 if ^dib.attached then do; /* just once per target device */ 299 attach_count = attach_count + 1; 300 attach_tag = attach_count; 301 dib.output_switch = my_device_name || attach_tag; 302 /* make up a new switch name for the next level */ 303 next_attach_desc = next_module || space || target_device || space || next_attach_options; 304 305 call iox_$attach_name (dib.output_switch, dib.next_iocbp, (next_attach_desc), codeptr (tty_printer_attach), 306 code); 307 if code ^= 0 then call abort_attach ("Unable to attach to target device/switch", ""); 308 309 dib.attached = "1"b; /* we have a new attachment */ 310 dib.open = "0"b; /* don't forget to open it */ 311 end; 312 313 /* Set up the target device modes via the next IO module */ 314 315 if ^dib.open then do; /* if not open, do it */ 316 call iox_$open (dib.next_iocbp, Stream_input_output, "0"b, code); 317 if code ^= 0 318 then /* OOPS */ 319 if code ^= error_table_$not_closed 320 then /* if open, let it go */ 321 call abort_attach ("Unable to open target device stream.", ""); 322 323 if dib.term_type.name ^= "" then do; /* set the terminal type if specified */ 324 call iox_$control (dib.next_iocbp, "set_term_type", addr (dib.term_type), code); 325 if code ^= 0 then call abort_attach ("Unable to set terminal type.", ""); 326 end; 327 328 call iox_$control (dib.next_iocbp, "quit_enable", null, (0)); 329 330 call iox_$control (dib.next_iocbp, "write_status", addr (write_info), code); 331 if code = 0 then do; /* if OK, set up wait list for runout control */ 332 dib.n_chan = 1; 333 dib.channel = write_info.channel; 334 end; 335 else do; /* can't block for output completion */ 336 code = 0; /* this is OK */ 337 dib.wait_list = 0; /* clear the list */ 338 end; 339 340 tty_printer_conv_$send_ht = fixed (ad.ht); 341 tty_printer_conv_$send_vt = fixed (ad.vt); 342 343 dib.open = "1"b; 344 end; 345 346 dib.max_line_length = max (dib.max_line_length, ad.phys_line_length); 347 348 call ioa_$rsnnl ("^^edited^[,vertsp^],ll^d^[,tabs^]", modes, i, ad.vt, dib.max_line_length, ad.ht); 349 350 old_modes = ""; 351 call iox_$modes (dib.next_iocbp, modes, old_modes, code); 352 /* don't abort now, just try the set up */ 353 if code ^= 0 & (com_err_sw | static_com_err_sw) 354 then call com_err_ (code, my_device_name, "Modes error: ^a From: ^a", rtrim (modes), rtrim (old_modes)); 355 356 /* Mask and complete the iocb */ 357 358 mask = "0"b; 359 on any_other call handler; 360 361 call hcs_$set_ips_mask ("0"b, mask); 362 363 iocbp -> iocb.attach_descrip_ptr = addr (ad.attach_desc); 364 iocbp -> iocb.attach_data_ptr = adp; 365 iocbp -> iocb.open = tty_printer_open; 366 iocbp -> iocb.detach_iocb = tty_printer_detach; 367 368 dib.n_attached = dib.n_attached + 1; /* bump the number of switches to this device */ 369 370 call iox_$propagate (iocbp); 371 372 revert cleanup; /* it is good from here on */ 373 374 call hcs_$reset_ips_mask (mask, mask); 375 376 revert any_other; 377 378 379 380 381 382 attach_return: 383 return; 384 no_arg: 385 code = error_table_$noarg; 386 call abort_attach ("No argument after ^a.", (a_option (i - 1))); 387 388 /* Detach entry point */ 389 390 tty_printer_detach: 391 entry (a_iocbp, a_code); 392 393 iocbp = a_iocbp; 394 a_code = 0; 395 adp = iocbp -> iocb.attach_data_ptr; 396 397 if iocbp -> iocb.open_descrip_ptr ^= null then do;/* not closed? */ 398 a_code = error_table_$not_closed; 399 return; 400 end; 401 402 if adp ^= null then do; 403 dibp = ad.dibp; /* find the device info block */ 404 dib.n_attached = dib.n_attached - 1; /* this one is gone! */ 405 if dib.n_attached < 1 then do; /* when the last, take the block and attachment too */ 406 if dib.next_iocbp ^= null then do; 407 call iox_$close (dib.next_iocbp, (0)); 408 /* force the issue */ 409 call iox_$detach_iocb (dib.next_iocbp, (0)); 410 end; 411 call delete_dib (dibp); 412 end; 413 iocbp -> iocb.attach_data_ptr = null; /* this is about to become invalid */ 414 free adp -> ad in (my_area); /* drop the attach data structure for sure */ 415 end; 416 417 mask = "0"b; 418 on any_other call handler; 419 420 call hcs_$set_ips_mask ("0"b, mask); 421 422 iocbp -> iocb.attach_descrip_ptr = null; 423 iocbp -> iocb.open = iox_$err_no_operation; /* remaining invalid functions */ 424 iocbp -> iocb.close = iox_$err_no_operation; 425 426 call iox_$propagate (iocbp); 427 428 call hcs_$reset_ips_mask (mask, mask); 429 430 revert any_other; 431 432 return; 433 434 /* Open entry point */ 435 436 tty_printer_open: 437 entry (a_iocbp, a_mode, a_sw, a_code); 438 439 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 440 a_code = 0; 441 adp = iocbp -> iocb.attach_data_ptr; 442 443 if iocbp -> iocb.open_descrip_ptr ^= null then do;/* already open? */ 444 a_code = error_table_$not_closed; 445 return; 446 end; 447 448 if adp = null then do; /* must be valid */ 449 a_code = error_table_$not_attached; 450 return; 451 end; 452 453 open_mode = a_mode; 454 if ^((open_mode = Stream_input) | (open_mode = Stream_output) | (open_mode = Stream_input_output)) then do; 455 bad_mode: 456 a_code = error_table_$bad_mode; 457 return; 458 end; 459 460 ad.open_description = rtrim (iox_modes (open_mode)); 461 462 mask = "0"b; 463 on any_other call handler; 464 465 call hcs_$set_ips_mask ("0"b, mask); 466 467 if ((open_mode = Stream_input) | (open_mode = Stream_input_output)) then do; 468 iocbp -> iocb.get_chars = tty_printer_get_chars; 469 iocbp -> iocb.get_line = tty_printer_get_line; 470 end; 471 472 if ((open_mode = Stream_output) | (open_mode = Stream_input_output)) then do; 473 iocbp -> iocb.put_chars = tty_printer_put_chars; 474 end; 475 476 iocbp -> iocb.control = tty_printer_control; 477 iocbp -> iocb.position = tty_printer_position; 478 iocbp -> iocb.modes = tty_printer_modes; 479 iocbp -> iocb.close = tty_printer_close; 480 iocbp -> iocb.detach_iocb = tty_printer_detach; 481 iocbp -> iocb.open_descrip_ptr = addr (ad.open_description); 482 483 call iox_$propagate (iocbp); 484 485 call hcs_$reset_ips_mask (mask, mask); 486 487 revert any_other; 488 489 return; 490 491 /* Close entry point */ 492 493 tty_printer_close: 494 entry (a_iocbp, a_code); 495 496 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 497 a_code = 0; 498 499 if iocbp -> iocb.open_descrip_ptr = null then do; /* already closed? */ 500 a_code = error_table_$not_open; 501 return; 502 end; 503 504 mask = "0"b; 505 on any_other call handler; 506 507 call hcs_$set_ips_mask ("0"b, mask); 508 509 iocbp -> iocb.open_descrip_ptr = null; 510 iocbp -> iocb.open = tty_printer_open; 511 iocbp -> iocb.detach_iocb = tty_printer_detach; 512 iocbp -> iocb.control = iox_$err_no_operation; 513 iocbp -> iocb.position = iox_$err_no_operation; 514 iocbp -> iocb.modes = iox_$err_no_operation; 515 iocbp -> iocb.put_chars = iox_$err_no_operation; 516 iocbp -> iocb.get_chars = iox_$err_no_operation; 517 iocbp -> iocb.get_line = iox_$err_no_operation; 518 519 call iox_$propagate (iocbp); 520 521 call hcs_$reset_ips_mask (mask, mask); 522 523 revert any_other; 524 525 return; 526 527 /* Put_chars entry point */ 528 529 tty_printer_put_chars: 530 entry (a_iocbp, a_data_ptr, a_data_chars, a_code); 531 532 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 533 adp = iocbp -> iocb.attach_data_ptr; 534 535 if adp = null then do; /* must be valid */ 536 a_code = error_table_$not_attached; 537 return; 538 end; 539 540 if iocbp -> iocb.open_descrip_ptr = null then do; /* is it open? */ 541 a_code = error_table_$not_open; 542 return; 543 end; 544 545 a_code = 0; 546 dibp = ad.dibp; /* find the device info block */ 547 548 call iox_$put_chars (dib.next_iocbp, a_data_ptr, a_data_chars, a_code); 549 550 return; 551 552 /* Get_chars entry point */ 553 554 tty_printer_get_chars: 555 entry (a_iocbp, a_buf_ptr, a_buf_chars, a_data_chars, a_code); 556 557 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 558 adp = iocbp -> iocb.attach_data_ptr; 559 560 if adp = null then do; /* must be valid */ 561 a_code = error_table_$not_attached; 562 return; 563 end; 564 565 if iocbp -> iocb.open_descrip_ptr = null then do; /* is it open? */ 566 a_code = error_table_$not_open; 567 return; 568 end; 569 570 a_code = 0; 571 dibp = ad.dibp; /* find the device info block */ 572 573 call iox_$get_chars (dib.next_iocbp, a_buf_ptr, a_buf_chars, a_data_chars, a_code); 574 575 return; 576 577 578 579 580 581 582 /* Get_line entry point */ 583 584 tty_printer_get_line: 585 entry (a_iocbp, a_buf_ptr, a_buf_chars, a_data_chars, a_code); 586 587 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 588 adp = iocbp -> iocb.attach_data_ptr; 589 590 if adp = null then do; /* must be valid */ 591 a_code = error_table_$not_attached; 592 return; 593 end; 594 595 if iocbp -> iocb.open_descrip_ptr = null then do; /* is it open? */ 596 a_code = error_table_$not_open; 597 return; 598 end; 599 600 a_code = 0; 601 dibp = ad.dibp; /* find the device info block */ 602 603 call iox_$get_line (dib.next_iocbp, a_buf_ptr, a_buf_chars, a_data_chars, a_code); 604 605 return; 606 607 /* Control entry point */ 608 609 tty_printer_control: 610 entry (a_iocbp, a_order, a_infop, a_code); 611 612 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 613 adp = iocbp -> iocb.attach_data_ptr; 614 615 if adp = null then do; /* must be valid */ 616 a_code = error_table_$not_attached; 617 return; 618 end; 619 620 if iocbp -> iocb.open_descrip_ptr = null then do; /* is it open? */ 621 a_code = error_table_$not_open; 622 return; 623 end; 624 625 code, a_code = 0; 626 dibp = ad.dibp; 627 628 infop = a_infop; 629 order = a_order; 630 631 if order = "io_call" then do; /* we can use a simple mapping for this */ 632 io_call_infop = infop; 633 order = io_call_info.order_name; 634 infop = null; /* can't have an info ptr with io_call */ 635 end; 636 637 if /* case */ order = "select_device" then do; 638 if ad.term_type ^= dib.term_type.name then do; 639 dib.term_type.name = ad.term_type; /* establish the other terminal type */ 640 if dib.term_type.name ^= "" 641 then /* set the terminal type if specified */ 642 call iox_$control (dib.next_iocbp, "set_term_type", addr (dib.term_type), code); 643 end; 644 645 tty_printer_conv_$send_ht = fixed (ad.ht); 646 tty_printer_conv_$send_vt = fixed (ad.vt); 647 648 call ioa_$rsnnl ("^^edited^[,vertsp^],ll^d^[,tabs^]", modes, i, ad.vt, dib.max_line_length, ad.ht); 649 call iox_$modes (dib.next_iocbp, modes, old_modes, (0)); 650 /* don't abort now, just try the set up */ 651 end; 652 else if order = "runout" then do; /* here we wait for the output to complete */ 653 if dib.n_chan = 0 then return; /* in case we can't block */ 654 write_info.write_pending = "0"b; /* clear the flag */ 655 656 call iox_$control (dib.next_iocbp, "write_status", addr (write_info), code); 657 if write_info.write_pending then do; 658 659 call ipc_$block (addr (dib.wait_list), addr (event_info), code); 660 if code ^= 0 then call convert_ipc_code_ (code); 661 end; 662 end; 663 else if order = "hangup" & dib.module = "syn_" then do; 664 /* trap this order here */ 665 /* so we don't hangup user_i/o */ 666 end; 667 else if order = "reset" then do; 668 call ioa_$rsnnl ("^^edited^[,vertsp^],ll^d^[,tabs^]", modes, i, ad.vt, dib.max_line_length, ad.ht); 669 call iox_$modes (dib.next_iocbp, modes, old_modes, (0)); 670 /* don't abort now, just try the set up */ 671 end; 672 else if order = "get_error_count" then do; 673 if infop = null then go to no_op; /* not for io_call or a bad ptr */ 674 infop -> info_fixed = 0; /* return a count of zero for now */ 675 end; 676 else do; 677 call iox_$control (dib.next_iocbp, a_order, a_infop, code); 678 end; 679 680 a_code = code; 681 return; 682 683 no_op: 684 a_code = error_table_$no_operation; /* it couldn't be done as called */ 685 return; 686 687 /* Position entry point */ 688 689 tty_printer_position: 690 entry (a_iocbp, a_pos_type, a_pos_value, a_code); 691 692 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 693 adp = iocbp -> iocb.attach_data_ptr; 694 695 if adp = null then do; /* must be valid */ 696 a_code = error_table_$not_attached; 697 return; 698 end; 699 700 if iocbp -> iocb.open_descrip_ptr = null then do; /* is it open? */ 701 a_code = error_table_$not_open; 702 return; 703 end; 704 705 a_code = 0; 706 dibp = ad.dibp; /* find the device info block */ 707 708 call iox_$position (dib.next_iocbp, a_pos_type, a_pos_value, a_code); 709 710 return; 711 712 tty_printer_modes: 713 entry (a_iocbp, a_new_modes, a_old_modes, a_code); 714 715 iocbp = a_iocbp -> iocb.actual_iocb_ptr; 716 adp = iocbp -> iocb.attach_data_ptr; 717 718 if adp = null then do; /* must be valid */ 719 a_code = error_table_$not_attached; 720 return; 721 end; 722 723 if iocbp -> iocb.open_descrip_ptr = null then do; /* is it open? */ 724 a_code = error_table_$not_open; 725 return; 726 end; 727 728 a_code = 0; 729 dibp = ad.dibp; /* find the device info block */ 730 731 call iox_$modes (dib.next_iocbp, a_new_modes, a_old_modes, a_code); 732 733 return; 734 735 cv_dec_arg: 736 proc returns (fixed bin); 737 738 /* This proc picks up the next arg in the attach option array and returns it as fixed bin */ 739 740 i = i + 1; /* Advance to next arg */ 741 if i > hbound (a_option, 1) then goto no_arg; 742 my_attach_options = my_attach_options || space || a_option (i); 743 on conversion go to bad_dec_arg; 744 return (bin ((a_option (i)))); 745 bad_dec_arg: 746 code = error_table_$bad_conversion; 747 call abort_attach ("Invalid decimal number. ^a", ((a_option (i)))); 748 749 end cv_dec_arg; 750 751 752 753 754 755 get_arg: 756 proc returns (char (*) var); 757 758 /* This proc picks up the next arg in the attach option array and returns it as a character string */ 759 760 i = i + 1; 761 if i > hbound (a_option, 1) then goto no_arg; 762 my_attach_options = my_attach_options || space || a_option (i); 763 return ((a_option (i))); 764 765 end get_arg; 766 767 make_dib: 768 proc (new_dibp); 769 770 dcl new_dibp ptr; /* pointer to new info block in chain (output) */ 771 772 773 allocate dib in (my_area) set (new_dibp); 774 unspec (new_dibp -> dib) = "0"b; /* set it all to zero */ 775 new_dibp -> dib.fwd_ptr = null; /* chain ends here */ 776 new_dibp -> dib.device = ""; /* for string compares */ 777 new_dibp -> dib.module = ""; 778 new_dibp -> dib.output_switch = ""; 779 new_dibp -> dib.back_ptr = last_dibp; /* if the first, this is null */ 780 new_dibp -> dib.next_iocbp = null; 781 new_dibp -> dib.term_type.version = 1; /* be sure we give the right version */ 782 new_dibp -> dib.term_type.name = ""; /* not defined yet */ 783 784 if first_dibp = null 785 then first_dibp = new_dibp; /* set the head of the chain */ 786 else last_dibp -> dib.fwd_ptr = new_dibp; /* otherwise, link it into the list */ 787 last_dibp = new_dibp; /* record the new end of of the chain */ 788 789 end make_dib; 790 791 792 793 794 795 delete_dib: 796 proc (dibp); 797 798 dcl dibp ptr; /* pointer to the info block to be deleted */ 799 800 801 if dibp -> dib.back_ptr = null 802 then /* it was the head of the chain */ 803 first_dibp = dibp -> dib.fwd_ptr; 804 else dibp -> dib.back_ptr -> dib.fwd_ptr = dibp -> dib.fwd_ptr; 805 /* move our fwd ptr to previous block */ 806 807 if dibp -> dib.fwd_ptr = null 808 then /* if the tail of the chain */ 809 last_dibp = dibp -> dib.back_ptr; 810 else dibp -> dib.fwd_ptr -> dib.back_ptr = dibp -> dib.back_ptr; 811 /* move our back ptr to next block */ 812 813 free dibp -> dib in (my_area); 814 dibp = null; 815 816 return; 817 818 end delete_dib; 819 820 abort_attach: 821 proc (str1, str2); 822 dcl (str1, str2) char (*) aligned; 823 824 /* This proc handles attach errors */ 825 826 if com_err_sw | static_com_err_sw then call com_err_ (code, my_device_name, str1, str2); 827 a_code = code; 828 829 call clean_up; /* free things up */ 830 831 go to attach_return; 832 833 end abort_attach; 834 835 836 clean_up: 837 procedure; 838 839 /* clean up procedure for cleanup condition and abort_attach, kills the attempted attachment */ 840 841 if adp ^= null then free adp -> ad in (my_area); 842 843 if dibp ^= null 844 then if dib.n_attached < 1 then do; 845 if dib.next_iocbp ^= null then do; 846 call iox_$close (dib.next_iocbp, (0)); 847 /* just in case */ 848 call iox_$detach_iocb (dib.next_iocbp, (0)); 849 end; 850 851 call delete_dib (dibp); /* drop it */ 852 end; 853 854 iocbp -> iocb.attach_descrip_ptr = null; 855 iocbp -> iocb.attach_data_ptr = null; 856 857 return; 858 859 end clean_up; 860 861 862 handler: 863 procedure; 864 865 /* This proc handles faults that occur while masked */ 866 867 if mask then call hcs_$reset_ips_mask (mask, mask); 868 mask = "0"b; 869 870 call continue_to_signal_ (code); 871 return; 872 873 end handler; 874 875 flip_com_err_sw: 876 entry; 877 878 /* this entry is for testing so the state of the static com_err_sw can be changed */ 879 880 static_com_err_sw = ^static_com_err_sw; 881 882 call ioa_ ("The static switch is now ^[on^;off^].", static_com_err_sw); 883 884 return; 885 1 1 /* BEGIN INCLUDE FILE ..... iocb.incl.pl1 ..... 13 Feb 1975, M. Asherman */ 1 2 /* format: style2 */ 1 3 1 4 dcl 1 iocb aligned based, /* I/O control block. */ 1 5 2 version character (4) aligned, 1 6 2 name char (32), /* I/O name of this block. */ 1 7 2 actual_iocb_ptr ptr, /* IOCB ultimately SYNed to. */ 1 8 2 attach_descrip_ptr ptr, /* Ptr to printable attach description. */ 1 9 2 attach_data_ptr ptr, /* Ptr to attach data structure. */ 1 10 2 open_descrip_ptr ptr, /* Ptr to printable open description. */ 1 11 2 open_data_ptr ptr, /* Ptr to open data structure (old SDB). */ 1 12 2 reserved bit (72), /* Reserved for future use. */ 1 13 2 detach_iocb entry (ptr, fixed (35)),/* detach_iocb(p,s) */ 1 14 2 open entry (ptr, fixed, bit (1) aligned, fixed (35)), 1 15 /* open(p,mode,not_used,s) */ 1 16 2 close entry (ptr, fixed (35)),/* close(p,s) */ 1 17 2 get_line entry (ptr, ptr, fixed (21), fixed (21), fixed (35)), 1 18 /* get_line(p,bufptr,buflen,actlen,s) */ 1 19 2 get_chars entry (ptr, ptr, fixed (21), fixed (21), fixed (35)), 1 20 /* get_chars(p,bufptr,buflen,actlen,s) */ 1 21 2 put_chars entry (ptr, ptr, fixed (21), fixed (35)), 1 22 /* put_chars(p,bufptr,buflen,s) */ 1 23 2 modes entry (ptr, char (*), char (*), fixed (35)), 1 24 /* modes(p,newmode,oldmode,s) */ 1 25 2 position entry (ptr, fixed, fixed (21), fixed (35)), 1 26 /* position(p,u1,u2,s) */ 1 27 2 control entry (ptr, char (*), ptr, fixed (35)), 1 28 /* control(p,order,infptr,s) */ 1 29 2 read_record entry (ptr, ptr, fixed (21), fixed (21), fixed (35)), 1 30 /* read_record(p,bufptr,buflen,actlen,s) */ 1 31 2 write_record entry (ptr, ptr, fixed (21), fixed (35)), 1 32 /* write_record(p,bufptr,buflen,s) */ 1 33 2 rewrite_record entry (ptr, ptr, fixed (21), fixed (35)), 1 34 /* rewrite_record(p,bufptr,buflen,s) */ 1 35 2 delete_record entry (ptr, fixed (35)),/* delete_record(p,s) */ 1 36 2 seek_key entry (ptr, char (256) varying, fixed (21), fixed (35)), 1 37 /* seek_key(p,key,len,s) */ 1 38 2 read_key entry (ptr, char (256) varying, fixed (21), fixed (35)), 1 39 /* read_key(p,key,len,s) */ 1 40 2 read_length entry (ptr, fixed (21), fixed (35)); 1 41 /* read_length(p,len,s) */ 1 42 1 43 declare iox_$iocb_version_sentinel 1 44 character (4) aligned external static; 1 45 1 46 /* END INCLUDE FILE ..... iocb.incl.pl1 ..... */ 886 2 1 /* Begin include file ..... iox_modes.incl.pl1 */ 2 2 2 3 /* Written by C. D. Tavares, 03/17/75 */ 2 4 /* Updated 10/31/77 by CDT to include short iox mode strings */ 2 5 2 6 dcl iox_modes (13) char (24) int static options (constant) aligned initial 2 7 ("stream_input", "stream_output", "stream_input_output", 2 8 "sequential_input", "sequential_output", "sequential_input_output", "sequential_update", 2 9 "keyed_sequential_input", "keyed_sequential_output", "keyed_sequential_update", 2 10 "direct_input", "direct_output", "direct_update"); 2 11 2 12 dcl short_iox_modes (13) char (4) int static options (constant) aligned initial 2 13 ("si", "so", "sio", "sqi", "sqo", "sqio", "squ", "ksqi", "ksqo", "ksqu", "di", "do", "du"); 2 14 2 15 dcl (Stream_input initial (1), 2 16 Stream_output initial (2), 2 17 Stream_input_output initial (3), 2 18 Sequential_input initial (4), 2 19 Sequential_output initial (5), 2 20 Sequential_input_output initial (6), 2 21 Sequential_update initial (7), 2 22 Keyed_sequential_input initial (8), 2 23 Keyed_sequential_output initial (9), 2 24 Keyed_sequential_update initial (10), 2 25 Direct_input initial (11), 2 26 Direct_output initial (12), 2 27 Direct_update initial (13)) fixed bin int static options (constant); 2 28 2 29 /* End include file ..... iox_modes.incl.pl1 */ 887 3 1 /* Begin include file ..... io_call_info.incl.pl1 */ 3 2 3 3 /* This include file defines the info_structure used by an I/O module to perform an "io_call" order 3 4* on behalf of the io_call command. */ 3 5 /* Coded April 1976 by Larry Johnson */ 3 6 /* Changed June 1977 by Larry Johnson for "io_call_af" order */ 3 7 3 8 dcl io_call_infop ptr; 3 9 3 10 dcl 1 io_call_info aligned based (io_call_infop), 3 11 2 version fixed bin, 3 12 2 caller_name char (32), /* Caller name for error messages */ 3 13 2 order_name char (32), /* Actual name of the order to be performed */ 3 14 2 report entry variable options (variable), 3 15 /* Entry to ioa_ like procedure to report results */ 3 16 2 error entry variable options (variable), 3 17 /* Entry to com_err_ like procedure to report results */ 3 18 2 af_returnp ptr, /* Pointer to return string if "io_call_af" order */ 3 19 2 af_returnl fixed bin, /* Length of string */ 3 20 2 fill (5) bit (36) aligned, 3 21 2 nargs fixed bin, /* Number of additional command arguments provided */ 3 22 2 max_arglen fixed bin, /* Length of longest argument (used to define array) */ 3 23 2 args (0 refer (io_call_info.nargs)) char (0 refer (io_call_info.max_arglen)) varying; 3 24 3 25 dcl io_call_af_ret char (io_call_info.af_returnl) based (io_call_info.af_returnp) varying; 3 26 /* Return string for active function */ 3 27 3 28 /* End include file ..... io_call_info.incl.pl1 */ 888 4 1 /* BEGIN INCLUDE FILE event_wait_info.incl.pl1 */ 4 2 4 3 /* T. Casey, May 1978 */ 4 4 4 5 dcl event_wait_info_ptr ptr; 4 6 4 7 dcl 1 event_wait_info aligned based (event_wait_info_ptr), /* argument structure filled in on return from ipc_$block */ 4 8 2 channel_id fixed bin (71), /* event channel on which wakeup occurred */ 4 9 2 message fixed bin (71), /* 72 bits of information passed by sender of wakeup */ 4 10 2 sender bit (36), /* process id of sender */ 4 11 2 origin, 4 12 3 dev_signal bit (18) unaligned, /* "1"b if device signal */ 4 13 3 ring fixed bin (17) unaligned, /* ring from which sent */ 4 14 2 channel_index fixed bin; /* index of this channel in the event wait list */ 4 15 4 16 /* END INCLUDE FILE event_wait_info.incl.pl1 */ 889 890 891 end tty_printer_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1523.5 tty_printer_.pl1 >dumps>old>recomp>tty_printer_.pl1 886 1 07/28/81 1333.4 iocb.incl.pl1 >ldd>include>iocb.incl.pl1 887 2 02/02/78 1229.7 iox_modes.incl.pl1 >ldd>include>iox_modes.incl.pl1 888 3 07/19/79 1547.1 io_call_info.incl.pl1 >ldd>include>io_call_info.incl.pl1 889 4 06/29/79 1727.8 event_wait_info.incl.pl1 >ldd>include>event_wait_info.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. Stream_input constant fixed bin(17,0) initial dcl 2-15 ref 454 467 Stream_input_output 000160 constant fixed bin(17,0) initial dcl 2-15 set ref 316* 454 467 472 Stream_output constant fixed bin(17,0) initial dcl 2-15 ref 454 472 a_buf_chars parameter fixed bin(21,0) dcl 30 set ref 554 573* 584 603* a_buf_ptr parameter pointer dcl 28 set ref 554 573* 584 603* a_code parameter fixed bin(35,0) dcl 26 set ref 187 192* 390 394* 398* 436 440* 444* 449* 455* 493 497* 500* 529 536* 541* 545* 548* 554 561* 566* 570* 573* 584 591* 596* 600* 603* 609 616* 621* 625* 680* 683* 689 696* 701* 705* 708* 712 719* 724* 728* 731* 827* a_data_chars parameter fixed bin(21,0) dcl 31 set ref 529 548* 554 573* 584 603* a_data_ptr parameter pointer dcl 29 set ref 529 548* a_infop parameter pointer dcl 35 set ref 609 628 677* a_iocbp parameter pointer dcl 23 ref 187 190 390 393 436 439 493 496 529 532 554 557 584 587 609 612 689 692 712 715 a_mode parameter fixed bin(17,0) dcl 27 ref 436 453 a_new_modes parameter char unaligned dcl 36 set ref 712 731* a_old_modes parameter char unaligned dcl 37 set ref 712 731* a_option parameter varying char array dcl 24 ref 187 225 232 233 233 234 234 237 237 239 239 240 241 242 244 245 247 248 250 386 741 742 744 747 761 762 763 a_order parameter char unaligned dcl 34 set ref 609 629 677* a_pos_type parameter fixed bin(17,0) dcl 32 set ref 689 708* a_pos_value parameter fixed bin(21,0) dcl 33 set ref 689 708* a_sw parameter bit(1) unaligned dcl 25 ref 187 191 436 actual_iocb_ptr 12 based pointer level 2 dcl 1-4 ref 439 496 532 557 587 612 692 715 ad based structure level 1 dcl 136 set ref 209 414 841 addr builtin function dcl 128 ref 324 324 330 330 363 481 640 640 656 656 659 659 659 659 adp 000620 automatic pointer dcl 134 set ref 194* 209* 213 214 215 216 217 237 239 240 241 280 281 285 285 288 288 288 292 294 340 341 346 348 348 363 364 395* 402 403 414 441* 448 460 481 533* 535 546 558* 560 571 588* 590 601 613* 615 626 638 639 645 646 648 648 668 668 693* 695 706 716* 718 729 841 841 any_other 000604 stack reference condition dcl 131 ref 359 376 418 430 463 487 505 523 areap 000016 internal static pointer initial dcl 65 set ref 201 202* 204 209 414 773 813 841 attach_count 000010 internal static fixed bin(17,0) initial dcl 62 set ref 299* 299 300 attach_data_ptr 16 based pointer level 2 dcl 1-4 set ref 364* 395 413* 441 533 558 588 613 693 716 855* attach_desc 26 based varying char(256) level 3 dcl 136 set ref 294* 363 attach_descrip_ptr 14 based pointer level 2 dcl 1-4 set ref 196 363* 422* 854* attach_tag 000101 automatic picture(2) unaligned dcl 42 set ref 300* 301 attached 54 based bit(1) level 3 packed unaligned dcl 154 set ref 298 309* back_ptr 46 based pointer level 2 dcl 154 set ref 779* 801 804 807 810* 810 bin builtin function dcl 128 ref 744 bits 1 based structure level 2 packed unaligned dcl 136 set ref 213* channel 52 based fixed bin(71,0) level 3 in structure "dib" dcl 154 in procedure "tty_printer_" set ref 333* channel 000634 automatic fixed bin(71,0) level 2 in structure "write_info" dcl 181 in procedure "tty_printer_" set ref 333 chars 6 based structure level 2 dcl 136 set ref 215* cleanup 000612 stack reference condition dcl 132 ref 207 372 close 36 based entry variable level 2 dcl 1-4 set ref 424* 479* code 000102 automatic fixed bin(35,0) dcl 43 set ref 192* 197* 202* 203 226* 254* 259* 305* 307 316* 317 317 324* 325 330* 331 336* 351* 353 353* 384* 625* 640* 656* 659* 660 660* 677* 680 745* 826* 827 870* codeptr builtin function dcl 128 ref 305 305 com_err_ 000052 constant entry external dcl 98 ref 353 826 com_err_sw 000100 automatic bit(1) unaligned dcl 41 set ref 191* 353 826 continue_to_signal_ 000054 constant entry external dcl 99 ref 870 control 66 based entry variable level 2 dcl 1-4 set ref 476* 512* conversion 000000 stack reference condition dcl 130 ref 743 convert_ipc_code_ 000064 constant entry external dcl 103 ref 660 detach_iocb 26 based entry variable level 2 dcl 1-4 set ref 366* 480* 511* device 12 based char(32) level 2 dcl 154 set ref 266 273* 776* device_type 6 based char(32) level 3 dcl 136 set ref 241* 285 285* 288 dib based structure level 1 dcl 154 set ref 773 774* 813 dibp parameter pointer dcl 798 in procedure "delete_dib" set ref 795 801 801 804 804 807 807 810 810 813 814* dibp 2 based pointer level 3 in structure "ad" dcl 136 in procedure "tty_printer_" set ref 280* 403 546 571 601 626 706 729 dibp 000622 automatic pointer dcl 152 in procedure "tty_printer_" set ref 194* 265 266* 271 272* 273 274 275 276 277 280 298 301 305 305 309 310 315 316 323 324 324 324 328 330 332 333 337 343 346 346 348 351 368 368 403* 404 404 405 406 407 409 411* 546* 548 571* 573 601* 603 626* 638 639 640 640 640 640 648 649 653 656 659 659 663 668 669 677 706* 708 729* 731 843 843 845 846 848 851* empty builtin function dcl 128 ref 204 error_table_$bad_conversion 000022 external static fixed bin(35,0) dcl 80 ref 745 error_table_$bad_mode 000026 external static fixed bin(35,0) dcl 82 ref 455 error_table_$badopt 000044 external static fixed bin(35,0) dcl 89 ref 254 259 error_table_$no_operation 000024 external static fixed bin(35,0) dcl 81 ref 683 error_table_$noarg 000042 external static fixed bin(35,0) dcl 88 ref 384 error_table_$not_attached 000032 external static fixed bin(35,0) dcl 84 ref 449 536 561 591 616 696 719 error_table_$not_closed 000036 external static fixed bin(35,0) dcl 86 ref 317 398 444 error_table_$not_detached 000030 external static fixed bin(35,0) dcl 83 ref 197 error_table_$not_open 000034 external static fixed bin(35,0) dcl 85 ref 500 541 566 596 621 701 724 error_table_$wrong_no_of_args 000040 external static fixed bin(35,0) dcl 87 ref 226 event_info 000624 automatic structure level 1 dcl 179 set ref 659 659 event_wait_info based structure level 1 dcl 4-7 first_dibp 000012 internal static pointer initial dcl 63 set ref 265 784 784* 801* fixed based structure level 2 in structure "ad" dcl 136 in procedure "tty_printer_" fixed builtin function dcl 128 in procedure "tty_printer_" ref 340 341 645 646 flags 11 based structure level 3 in structure "dib" dcl 154 in procedure "tty_printer_" flags 54 based structure level 2 in structure "dib" dcl 154 in procedure "tty_printer_" fwd_ptr 44 based pointer level 2 dcl 154 set ref 269 775* 786* 801 804* 804 807 810 get_chars 46 based entry variable level 2 dcl 1-4 set ref 468* 516* get_line 42 based entry variable level 2 dcl 1-4 set ref 469* 517* get_temp_segment_ 000056 constant entry external dcl 100 ref 202 hbound builtin function dcl 128 ref 225 232 247 741 761 hcs_$reset_ips_mask 000060 constant entry external dcl 101 ref 374 428 485 521 867 hcs_$set_ips_mask 000062 constant entry external dcl 102 ref 361 420 465 507 ht 1 based bit(1) level 3 packed unaligned dcl 136 set ref 239* 340 348* 645 648* 668* i 000107 automatic fixed bin(21,0) dcl 46 set ref 232* 233 233 234 234 237 237 239 239 240 241 242 244 245 246* 246 247 248 250* 348* 386 648* 668* 740* 740 741 742 744 747 760* 760 761 762 763 info_fixed based fixed bin(17,0) dcl 72 set ref 674* infop 000242 automatic pointer dcl 51 set ref 628* 632 634* 673 674 initial_string 11 based bit(1) level 4 packed unaligned dcl 154 set ref 276* io_call_info based structure level 1 dcl 3-10 io_call_infop 000640 automatic pointer dcl 3-8 set ref 632* 633 ioa_ 000046 constant entry external dcl 94 ref 882 ioa_$rsnnl 000050 constant entry external dcl 94 ref 348 648 668 iocb based structure level 1 dcl 1-4 iocbp 000104 automatic pointer dcl 44 in procedure "tty_printer_" set ref 190* 196 198 217 363 364 365 366 370* 393* 395 397 413 422 423 424 426* 439* 441 443 468 469 473 476 477 478 479 480 481 483* 496* 499 509 510 511 512 513 514 515 516 517 519* 532* 533 540 557* 558 565 587* 588 595 612* 613 620 692* 693 700 715* 716 723 854 855 iocbp 4 based pointer level 3 in structure "ad" dcl 136 in procedure "tty_printer_" set ref 217* iox_$attach_name 000070 constant entry external dcl 105 ref 305 iox_$close 000072 constant entry external dcl 106 ref 407 846 iox_$control 000074 constant entry external dcl 107 ref 324 328 330 640 656 677 iox_$detach_iocb 000076 constant entry external dcl 108 ref 409 848 iox_$err_no_operation 000100 constant entry external dcl 109 ref 423 424 512 513 514 515 516 517 iox_$get_chars 000102 constant entry external dcl 110 ref 573 iox_$get_line 000104 constant entry external dcl 111 ref 603 iox_$modes 000106 constant entry external dcl 112 ref 351 649 669 731 iox_$open 000110 constant entry external dcl 113 ref 316 iox_$position 000112 constant entry external dcl 114 ref 708 iox_$propagate 000114 constant entry external dcl 115 ref 370 426 483 519 iox_$put_chars 000116 constant entry external dcl 116 ref 548 iox_modes 000000 constant char(24) initial array dcl 2-6 ref 460 ipc_$block 000066 constant entry external dcl 104 ref 659 last_dibp 000014 internal static pointer initial dcl 64 set ref 779 786 787* 807* mask 000106 automatic bit(36) dcl 45 set ref 358* 361* 374* 374* 417* 420* 428* 428* 462* 465* 485* 485* 504* 507* 521* 521* 867 867* 867* 868* max builtin function dcl 128 ref 346 max_line_length 56 based fixed bin(17,0) level 2 dcl 154 set ref 346* 346 348* 648* 668* modes 000111 automatic char(64) unaligned dcl 48 in procedure "tty_printer_" set ref 348* 351* 353 353 648* 649* 668* 669* modes 56 based entry variable level 2 in structure "iocb" dcl 1-4 in procedure "tty_printer_" set ref 478* 514* modes 11(01) based bit(1) level 4 in structure "dib" packed unaligned dcl 154 in procedure "tty_printer_" set ref 277* module 22 based char(32) level 2 dcl 154 set ref 274* 663 777* my_area based area(262144) dcl 70 set ref 204* 209 414 773 813 841 my_attach_options 000256 automatic varying char(256) dcl 54 set ref 221* 233* 233 294 742* 742 762* 762 my_device_name 000116 constant char(12) initial unaligned dcl 77 set ref 202* 294 301 353* 826* n_attached 55 based fixed bin(17,0) level 2 dcl 154 set ref 368* 368 404* 404 405 843 n_chan 50 based fixed bin(17,0) level 3 dcl 154 set ref 332* 653 name 1 based char(32) level 3 in structure "dib" packed unaligned dcl 154 in procedure "tty_printer_" set ref 275* 323 638 639* 640 782* name 1 based char(32) level 2 in structure "iocb" dcl 1-4 in procedure "tty_printer_" set ref 198* new_dibp parameter pointer dcl 770 set ref 767 773* 774 775 776 777 778 779 780 781 782 784 786 787 next_attach_desc 000460 automatic varying char(256) dcl 56 set ref 219* 303* 305 next_attach_options 000357 automatic varying char(256) dcl 55 set ref 219* 242* 242 250* 250 303 next_iocbp 42 based pointer level 2 dcl 154 set ref 305* 316* 324* 328* 330* 351* 406 407* 409* 548* 573* 603* 640* 649* 656* 669* 677* 708* 731* 780* 845 846* 848* next_module 000561 automatic varying char(32) dcl 57 set ref 220* 248* 258 274 294 303 null builtin function dcl 128 ref 194 196 201 214 265 265 271 328 328 397 402 406 413 422 443 448 499 509 535 540 560 565 590 595 615 620 634 673 695 700 718 723 775 780 784 801 807 814 841 843 845 854 855 old_modes 000131 automatic char(256) unaligned dcl 49 set ref 350* 351* 353 353 649* 669* open 54(01) based bit(1) level 3 in structure "dib" packed unaligned dcl 154 in procedure "tty_printer_" set ref 310* 315 343* open 32 based entry variable level 2 in structure "iocb" dcl 1-4 in procedure "tty_printer_" set ref 365* 423* 510* open_descrip_ptr 20 based pointer level 2 dcl 1-4 set ref 397 443 481* 499 509* 540 565 595 620 700 723 open_description 127 based varying char(24) level 3 dcl 136 set ref 460* 481 open_mode 000110 automatic fixed bin(17,0) dcl 47 set ref 453* 454 454 454 460 467 467 472 472 order 000231 automatic char(32) unaligned dcl 50 set ref 629* 631 633* 637 652 663 667 672 order_name 11 based char(32) level 2 dcl 3-10 ref 633 output_switch 32 based char(32) level 2 packed unaligned dcl 154 set ref 301* 305* 778* phys_line_length based fixed bin(17,0) level 3 dcl 136 set ref 216* 237* 288 288* 292* 346 position 62 based entry variable level 2 dcl 1-4 set ref 477* 513* ptrs 2 based structure level 2 dcl 136 set ref 214* put_chars 52 based entry variable level 2 dcl 1-4 set ref 473* 515* rtrim builtin function dcl 128 ref 353 353 353 353 460 space 005604 constant char(1) initial unaligned dcl 78 ref 233 250 294 294 303 303 742 762 static_com_err_sw 000020 internal static bit(1) initial unaligned dcl 66 set ref 353 826 880* 880 882* str1 parameter char dcl 822 set ref 820 826* str2 parameter char dcl 822 set ref 820 826* target_device 000572 automatic varying char(32) dcl 58 set ref 220* 244* 253 266 273 303 temp_ptr 000244 automatic pointer dcl 52 set ref 265* 265* 266 266* 269 term_type 16 based char(32) level 3 in structure "ad" dcl 136 in procedure "tty_printer_" set ref 281* 638 639 term_type 000246 automatic char(32) unaligned dcl 53 in procedure "tty_printer_" set ref 220* 235* 275 281 term_type based structure level 2 in structure "dib" dcl 154 in procedure "tty_printer_" set ref 324 324 640 640 tty_printer_conv_$send_ht 000122 external static fixed bin(17,0) dcl 123 set ref 340* 645* tty_printer_conv_$send_vt 000120 external static fixed bin(17,0) dcl 122 set ref 341* 646* unspec builtin function dcl 128 set ref 774* version based fixed bin(17,0) level 3 dcl 154 set ref 781* vt 1(01) based bit(1) level 3 packed unaligned dcl 136 set ref 240* 341 348* 646 648* 668* wait_list 50 based structure level 2 dcl 154 set ref 337* 659 659 write_info 000634 automatic structure level 1 dcl 181 set ref 330 330 656 656 write_pending 2 000634 automatic bit(1) level 2 dcl 181 set ref 654* 657 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. Direct_input internal static fixed bin(17,0) initial dcl 2-15 Direct_output internal static fixed bin(17,0) initial dcl 2-15 Direct_update internal static fixed bin(17,0) initial dcl 2-15 Keyed_sequential_input internal static fixed bin(17,0) initial dcl 2-15 Keyed_sequential_output internal static fixed bin(17,0) initial dcl 2-15 Keyed_sequential_update internal static fixed bin(17,0) initial dcl 2-15 Sequential_input internal static fixed bin(17,0) initial dcl 2-15 Sequential_input_output internal static fixed bin(17,0) initial dcl 2-15 Sequential_output internal static fixed bin(17,0) initial dcl 2-15 Sequential_update internal static fixed bin(17,0) initial dcl 2-15 event_wait_info_ptr automatic pointer dcl 4-5 io_call_af_ret based varying char dcl 3-25 iox_$iocb_version_sentinel external static char(4) dcl 1-43 short_iox_modes internal static char(4) initial array dcl 2-12 NAMES DECLARED BY EXPLICIT CONTEXT. abort_attach 005352 constant entry internal dcl 820 ref 198 203 227 255 260 307 317 325 386 747 attach_return 002551 constant label dcl 382 set ref 831 bad_dec_arg 005042 constant label dcl 745 set ref 743 bad_mode 003105 constant label dcl 455 clean_up 005441 constant entry internal dcl 836 ref 207 829 cv_dec_arg 004671 constant entry internal dcl 735 ref 237 delete_dib 005305 constant entry internal dcl 795 ref 411 851 flip_com_err_sw 004634 constant entry external dcl 875 get_arg 005121 constant entry internal dcl 755 ref 235 241 242 244 handler 005540 constant entry internal dcl 862 ref 359 418 463 505 make_dib 005223 constant entry internal dcl 767 ref 272 no_arg 002552 constant label dcl 384 ref 247 741 761 no_op 004431 constant label dcl 683 ref 673 tty_printer_ 000442 constant entry external dcl 12 tty_printer_attach 000455 constant entry external dcl 187 ref 305 305 tty_printer_close 003277 constant entry external dcl 493 ref 479 tty_printer_control 003706 constant entry external dcl 609 ref 476 tty_printer_detach 002632 constant entry external dcl 390 ref 366 480 511 tty_printer_get_chars 003527 constant entry external dcl 554 ref 468 tty_printer_get_line 003615 constant entry external dcl 584 ref 469 tty_printer_modes 004527 constant entry external dcl 712 ref 478 tty_printer_open 003035 constant entry external dcl 436 ref 365 510 tty_printer_position 004442 constant entry external dcl 689 ref 477 tty_printer_put_chars 003440 constant entry external dcl 529 ref 473 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 6430 6554 5605 6440 Length 7170 5605 124 377 622 12 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tty_printer_ 515 external procedure is an external procedure. on unit on line 207 64 on unit on unit on line 359 64 on unit on unit on line 418 64 on unit on unit on line 463 64 on unit on unit on line 505 64 on unit cv_dec_arg 248 internal procedure enables or reverts conditions. on unit on line 743 64 on unit get_arg 67 internal procedure uses returns(char(*)) or returns(bit(*)). make_dib internal procedure shares stack frame of external procedure tty_printer_. delete_dib 64 internal procedure is called by several nonquick procedures. abort_attach 84 internal procedure is called during a stack extension. clean_up 72 internal procedure is called by several nonquick procedures. handler 70 internal procedure is called by several nonquick procedures. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 attach_count tty_printer_ 000012 first_dibp tty_printer_ 000014 last_dibp tty_printer_ 000016 areap tty_printer_ 000020 static_com_err_sw tty_printer_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tty_printer_ 000100 com_err_sw tty_printer_ 000101 attach_tag tty_printer_ 000102 code tty_printer_ 000104 iocbp tty_printer_ 000106 mask tty_printer_ 000107 i tty_printer_ 000110 open_mode tty_printer_ 000111 modes tty_printer_ 000131 old_modes tty_printer_ 000231 order tty_printer_ 000242 infop tty_printer_ 000244 temp_ptr tty_printer_ 000246 term_type tty_printer_ 000256 my_attach_options tty_printer_ 000357 next_attach_options tty_printer_ 000460 next_attach_desc tty_printer_ 000561 next_module tty_printer_ 000572 target_device tty_printer_ 000620 adp tty_printer_ 000622 dibp tty_printer_ 000624 event_info tty_printer_ 000634 write_info tty_printer_ 000640 io_call_infop tty_printer_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_e_as alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out call_int_this_desc call_int_this call_int_other_desc call_int_other return tra_ext signal enable shorten_stack ext_entry ext_entry_desc int_entry int_entry_desc return_chars_eis any_to_any_tr alloc_based free_based empty THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ continue_to_signal_ convert_ipc_code_ get_temp_segment_ hcs_$reset_ips_mask hcs_$set_ips_mask ioa_ ioa_$rsnnl iox_$attach_name iox_$close iox_$control iox_$detach_iocb iox_$err_no_operation iox_$get_chars iox_$get_line iox_$modes iox_$open iox_$position iox_$propagate iox_$put_chars ipc_$block THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_conversion error_table_$bad_mode error_table_$badopt error_table_$no_operation error_table_$noarg error_table_$not_attached error_table_$not_closed error_table_$not_detached error_table_$not_open error_table_$wrong_no_of_args tty_printer_conv_$send_ht tty_printer_conv_$send_vt LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 12 000441 187 000447 190 000473 191 000477 192 000504 194 000506 196 000511 197 000515 198 000517 201 000535 202 000542 203 000562 204 000603 207 000607 209 000631 213 000637 214 000643 215 000646 216 000656 217 000657 219 000661 220 000663 221 000670 225 000671 226 000676 227 000701 232 000723 233 000734 234 001012 235 001027 236 001044 237 001046 239 001067 240 001105 241 001116 242 001142 244 001217 245 001250 246 001256 247 001257 248 001263 249 001300 250 001301 251 001336 253 001341 254 001346 255 001351 258 001373 259 001400 260 001403 265 001425 266 001440 269 001447 271 001452 272 001456 273 001460 274 001465 275 001471 276 001474 277 001476 280 001500 281 001503 285 001506 288 001515 292 001526 294 001530 298 001600 299 001604 300 001606 301 001616 303 001631 305 001707 307 001751 309 001773 310 001776 315 002000 316 002003 317 002022 323 002046 324 002053 325 002105 328 002126 330 002163 331 002216 332 002220 333 002223 334 002225 336 002226 337 002227 340 002234 341 002241 343 002245 346 002247 348 002254 350 002316 351 002321 353 002347 358 002453 359 002455 361 002477 363 002512 364 002516 365 002517 366 002523 368 002526 370 002530 372 002537 374 002540 376 002550 382 002551 384 002552 386 002555 390 002624 393 002642 394 002646 395 002647 397 002651 398 002655 399 002660 402 002661 403 002665 404 002667 405 002671 406 002674 407 002700 409 002712 411 002725 413 002733 414 002736 417 002740 418 002741 420 002763 422 002776 423 003001 424 003006 426 003010 428 003016 430 003026 432 003027 436 003030 439 003045 440 003052 441 003053 443 003055 444 003061 445 003064 448 003065 449 003071 450 003074 453 003075 454 003077 455 003105 457 003110 460 003111 462 003141 463 003142 465 003164 467 003177 468 003206 469 003213 472 003216 473 003223 476 003230 477 003235 478 003240 479 003243 480 003246 481 003251 483 003254 485 003263 487 003273 489 003274 493 003275 496 003307 497 003314 499 003315 500 003321 501 003324 504 003325 505 003326 507 003350 509 003363 510 003366 511 003372 512 003375 513 003401 514 003403 515 003405 516 003407 517 003411 519 003413 521 003421 523 003431 525 003432 529 003433 532 003452 533 003457 535 003461 536 003465 537 003470 540 003471 541 003475 542 003500 545 003501 546 003502 548 003504 550 003521 554 003522 557 003541 558 003546 560 003550 561 003554 562 003557 565 003560 566 003564 567 003567 570 003570 571 003571 573 003573 575 003612 584 003613 587 003627 588 003634 590 003636 591 003642 592 003645 595 003646 596 003652 597 003655 600 003656 601 003657 603 003661 605 003700 609 003701 612 003724 613 003731 615 003733 616 003737 617 003742 620 003743 621 003747 622 003752 625 003753 626 003755 628 003757 629 003762 631 003767 632 003773 633 003774 634 004000 637 004002 638 004006 639 004014 640 004017 645 004055 646 004062 648 004066 649 004127 651 004156 652 004157 653 004163 654 004166 656 004167 657 004221 659 004223 660 004243 662 004254 663 004255 666 004266 667 004267 668 004273 669 004336 671 004365 672 004366 673 004372 674 004376 675 004377 677 004400 680 004426 681 004430 683 004431 685 004434 689 004435 692 004452 693 004457 695 004461 696 004465 697 004470 700 004471 701 004475 702 004500 705 004501 706 004502 708 004504 710 004521 712 004522 715 004552 716 004557 718 004561 719 004565 720 004570 723 004571 724 004575 725 004600 728 004601 729 004602 731 004604 733 004632 875 004633 880 004641 882 004650 884 004667 735 004670 740 004676 741 004700 742 004710 743 004762 744 005002 745 005042 747 005046 749 005113 755 005120 760 005126 761 005130 762 005140 763 005212 767 005223 773 005225 774 005234 775 005237 776 005241 777 005246 778 005251 779 005254 780 005257 781 005262 782 005265 784 005271 786 005277 787 005300 789 005303 795 005304 801 005312 804 005324 807 005327 810 005340 813 005343 814 005345 816 005350 820 005351 826 005372 827 005425 829 005430 831 005435 836 005440 841 005446 843 005455 845 005466 846 005472 848 005504 851 005520 854 005530 855 005534 857 005536 862 005537 867 005545 868 005557 870 005561 871 005570 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved