/* hpfopen.macro.sieler 2001-01-12 */ /* Copyright (c) 2001 Allegro Consultants, Inc. */ macro get32 (xxx) { loc upper_16:s32 [u16 xxx]; loc lower_16:s32 [u16 xxx+2]; return bitd (upper_16, 0, #16, lower_16) } macro show_hpfopen { loc args r26; wl "PIN ", pin; wl "(arg0) # Parameters = ", r26:"#"; wl "(arg1) File# @ ", r25; wl "(arg2) Status @ ", r24; loc itemnum r23; loc args args - 2; loc nth 0; loc spminus sp-#56+#8; if (args > #50) then loc args #50; /* SS 2000-07-24 */ while args > 0 do { loc nth nth + 1; if nth > 1 then loc itemnum [spminus]; w "Item # ", nth:"DW2", " = ", itemnum:"#W2", ' '; if itemnum = 0 then { wl '(end-of-list)'; return 0; } else { loc itemval [spminus - 4]; loc item_str hop_to_str (itemnum); if strlen (item_str) < #20 then loc item_str = str (item_str + ' ', 1, #20); loc is_return_addr = ((itemnum = #18) or (itemnum = #21) or (itemnum = #87)); loc parmval itemval; env error 0; ignore quiet; loc parmval get32 (itemval); loc have_val = (error = 0); w item_str; w ": ", itemval; if is_return_addr then else if (not have_val) then w " (", itemval:"#", ')' else if itemnum = #43 then /* UFID w ' --> ', parmval:"W9", " ", get32 (itemval + 4):"W9", " ", get32 (itemval + #8):"W9", " ", get32 (itemval + #12):"W9", " ", get32 (itemval + #16):"W9", " " else if itemnum = #51 then w ' --> ', hop_get_string (itemval - 4) else { w ' --> ', parmval; if (parmval > #9) or (parmval < -#9) then w ' (', parmval:'#', ')'; }; if is_return_addr then else if itemnum <> #51 then { loc temp_str (hop_inum_val_str (itemnum, parmval)); if strlen (temp_str) > 0 then w " = ", temp_str; }; wl; if hop_is_ca (itemnum) then { w " "; dv itemval, #9, s; } }; loc args args - 2; loc spminus spminus - #8; } } macro hop_get_string (addr) { /* SS 000802 */ loc bytes [addr]; loc addr addr + 4; loc rslt ""; while (bytes > 0) do { loc rslt rslt + ascc ([addr]); loc bytes bytes - 4; loc addr addr + 4; }; return rslt; } macro hop_is_ca (inum) { if inum = 2 then return true; if inum = #8 then return true; if inum = #20 then return true; if inum = #22 then return true; if inum = #23 then return true; if inum = #25 then return true; if inum = #26 then return true; if inum = #28 then return true; if inum = #31 then return true; if inum = #32 then return true; if inum = #43 then return true; if inum = #45 then return true; if inum = #51 then return true; if inum = #52 then return true; if inum = #54 then return true; if inum = #55 then return true; if inum = #64 then return true; return false; } macro hop_is_i32 (inum) { if inum = 3 then return true; if (inum >= 5) and (inum <= 7) then return true; if (inum >= #9) and (inum <= #17) then return true; if (inum = #19) then return true; if (inum = #24) then return true; if (inum = #27) then return true; if (inum >= #29) and (inum <= #30) then return true; if (inum >= #33) and (inum <= #42) then return true; if (inum = #44) then return true; if (inum >= #46) and (inum <= #50) then return true; if (inum = #53) then return true; if (inum >= #56) and (inum <= #60) then return true; if (inum = #63) then return true; if (inum >= #67) and (inum <= #72) then return true; if (inum = #74) then return true; if (inum = #77) then return true; if (inum = #79) then return true; if (inum >= #81) and (inum <= #86) then return true; return false; } macro hop_to_str (hop : int) { loc temp_str = hop_to_str1 (hop); if strlen (temp_str) > 0 then return temp_str; loc temp_str = hop_to_str2 (hop); if strlen (temp_str) > 0 then return temp_str; return hop_to_str3 (hop); } macro hop_to_str1 (hop : int) { if hop = #1 then return "parse_string"; if hop = #2 then return "filename"; if hop = #3 then return "domain"; /* there is no 4 */ if hop = #5 then return "Designator"; if hop = #6 then return "format"; if hop = #7 then return "CCTL"; if hop = #8 then return "tape label"; if hop = #9 then return "fileeq"; if hop = #10 then return "file type"; if hop = #11 then return "access type"; if hop = #12 then return "Locking"; if hop = #13 then return "Exclusive"; if hop = #14 then return "multiaccess"; if hop = #15 then return "multiRecord"; if hop = #16 then return "nowait"; if hop = #17 then return "copy mode"; if hop = #18 then return "short mapped"; if hop = #19 then return "record size"; if hop = #20 then return "devicename"; if hop = #21 then return "Long mapped"; if hop = #22 then return "volumeclass"; if hop = #23 then return "volumename"; if hop = #24 then return "density"; if hop = #25 then return "printer environment"; if hop = #26 then return "remote environment"; if hop = #27 then return "output priority"; if hop = #28 then return "spooled message"; if hop = #29 then return "(temp) priv level"; if hop = #30 then return "labeled tape type"; if hop = #31 then return "labeled tape expiration"; if hop = #32 then return "labeled tape sequence"; if hop = #33 then return "# userlabels"; if hop = #34 then return "# spooler copies"; if hop = #35 then return "filesize"; if hop = #36 then return "initial allocation"; if hop = #37 then return "filecode"; if hop = #38 then return "file priv level"; if hop = #39 then return "will_access"; if hop = #40 then return "block factor"; if hop = #41 then return "Name semantics"; if hop = #42 then return "Device class"; if hop = #43 then return "UFID"; if hop = #44 then return "#buffers"; return ""} macro hop_to_str2 (hop : int) { if hop = #45 then return "fill character"; if hop = #46 then return "buffering"; if hop = #47 then return "# extents"; if hop = #48 then return "reverse VT"; if hop = #49 then return "pin# for owner of file"; if hop = #50 then return "final disposition"; if hop = #51 then return "filename_as_string"; if hop = #52 then return "file equation text"; if hop = #53 then return "ASCII/binary"; if hop = #54 then return "KSAM keys definition"; if hop = #55 then return "Raw mode"; if hop = #56 then return "user object class"; if hop = #57 then return "Variable access rights"; if hop = #58 then return "Unprotected"; if hop = #59 then return "System Object Class"; if hop = #60 then return "Use File PID"; if hop = #61 then return "Access Rights"; if hop = #62 then return "Unprotected Variable Access Rights"; if hop = #63 then return "Must Allocate Secondary Storage"; if hop = #64 then return "ACD"; if hop = #65 then return "Close Priv"; if hop = #66 then return "Link Device"; if hop = #67 then return "Internal Spool Files"; if hop = #68 then return "Link Spool File"; if hop = #69 then return "Private Spool File"; if hop = #70 then return "Keep Spool File"; if hop = #71 then return "Spool File Type"; if hop = #72 then return "Suppress Page E0ect"; if hop = #73 then return "Resv Device Ticket"; if hop = #74 then return "Header/Trailer"; if hop = #75 then return "Type Manager Address"; if hop = #76 then return "Form ID"; if hop = #77 then return "Read Format"; if hop = #78 then return "Raw operation"; if hop = #79 then return "POSIX Non-Block mode"; if hop = #80 then return "MPE/iX Device Type"; if hop = #81 then return "Symbolic Link traversal"; if hop = #82 then return "Standard Access"; if hop = #83 then return "Override Protection"; if hop = #84 then return "Rsvd File Descriptor"; return ""; } macro hop_to_str3 (hop : int) { /* new in 6.0 */ if hop = #85 then return "HSM_AUTO"; if hop = #86 then return "HSM_REMAIN"; /* new in 6.5 */ if hop = #87 then return "Large Mapped"; return ""; } macro hop_inum_3 (val) { if val = 0 then return "new"; if val = 1 then return "perm"; if val = 2 then return "temp"; if val = 3 then return "old"; if val = 4 then return "makePERM"; return ""} macro hop_inum_5 (val) { if val = 0 then return "(name)"; if val = 1 then return "$stdlist"; if val = 2 then return "$newpass"; if val = 3 then return "$oldpass"; if val = 4 then return "$stdin"; if val = 5 then return "$stdinx"; if val = 6 then return "$null"; if val = 7 then return "$stderr"; return ""} macro hop_inum_6 (val) { if val = 0 then return "fixed"; if val = 1 then return "variable"; if val = 2 then return "undefined"; if val = 3 then return "byte stream"; if val = 4 then return "root"; if val = 6 then return "acct"; if val = 7 then return "group"; if val =#9 then return "byte_stream9"; if val =#10 then return "hpdir"; return ""} macro hop_inum_7 (val) { if val = 0 then return "CCTL"; if val = 1 then return "noCCTL"; return ""} macro hop_inum_9 (val) { if val = 0 then return "FEQ"; if val = 1 then return "noFEQ"; return ""} macro hop_inum_10 (val) { if val = 0 then return "standard"; if val = 1 then return "old KSAM"; if val = 2 then return "RIO"; if val = 3 then return "KSAM/iX"; if val = 4 then return "CIR"; if val = 5 then return "Spool"; if val = 6 then return "MSG"; if val =#9 then return "DIR"; if val =#13 then return "fifo"; if val =#14 then return "symlink"; return ""} macro hop_inum_11 (val) { if val = 0 then return "read"; if val = 1 then return "write"; if val = 2 then return "writesave"; if val = 3 then return "append"; if val = 4 then return "I/O"; if val = 5 then return "update"; if val = 6 then return "eXexute"; if val = 7 then return "eXecuteRead"; if val =#8 then return "NoAccessCheck"; if val =#9 then return "DirectoryRead"; return ""} macro hop_inum_12 (val) { if val = 0 then return "nolock"; if val = 1 then return "LOCK"; return ""} macro hop_inum_13 (val) { if val = 0 then return "Read/share"; if val = 1 then return "EXClusive"; if val = 2 then return "SEMI"; if val = 3 then return "SHR"; return ""} macro hop_inum_14 (val) { if val = 0 then return "nomulti"; if val = 1 then return "MULTI"; if val = 2 then return "GMULTI"; return ""} macro hop_inum_15 (val) { if val = 0 then return "noMR"; if val = 1 then return "MR"; return ""} macro hop_inum_16 (val) { if val = 0 then return "wait"; if val = 1 then return "nowait"; return ""} macro hop_inum_30 (val) { if val = 0 then return "ANSI"; if val = 1 then return "IBM"; return ""} macro hop_inum_39 (val) { if val = 0 then return "Seq"; if val = 1 then return "Random"; return ""} macro hop_inum_41 (val) { if val = 0 then return "MPE-escaped"; if val = 1 then return "MPE-only"; if val = 2 then return "Posix"; if val = 3 then return "Program"; if val = 4 then return "Session"; return ""} macro hop_inum_46 (val) { if val = 0 then return "buf"; if val = 1 then return "NOBUF"; return ""} macro hop_inum_50 (val) { if val = 0 then return "no change"; if val = 1 then return "perm"; if val = 2 then return "temp job (rewound)"; if val = 3 then return "temp job (not rewound)"; if val = 4 then return "purge"; if val = 5 then return "perm -> temp"; return ""} macro hop_inum_53 (val) { if val = 0 then return "binary"; if val = 1 then return "ASCII"; return ""} macro hop_inum_71 (val) { if val = 0 then return "output"; if val = 1 then return "input"; if val = 2 then return "job"; if val = 3 then return "data"; return ""} macro hop_inum_74 (val) { if val = 0 then return "enable header, enable trailer"; if val = 1 then return "disable header, enable trailer"; if val = 2 then return "enable header, disable trailer"; if val = 3 then return "disable header, disable trailer"; return ""} macro hop_inum_77 (val) { if val = 0 then return "standard record view"; if val = 1 then return "HPDIRREAD returnd priv info"; if val = 2 then return "byte stream"; if val = 3 then return "HPDIRREAD 'split'"; return ""} macro hop_inum_78 (val) { if val = 0 then return "raw create"; if val = 1 then return "raw recover"; return ""} macro hop_inum_79 (val) { if val = 0 then return "false"; if val = 1 then return "true"; return ""} macro hop_inum_80 (val) { if val = 0 then return "disc"; if val = 7 then return "streams"; return ""} macro hop_inum_81 (val) { if val = 0 then return "follow sym link"; if val = 1 then return "don't follow sym link"; return ""} macro hop_inum_82 (val) { if val = 0 then return "use standard access"; if val = 1 then return "ignore standard access"; return ""} macro hop_inum_83 (val) { if val = 0 then return "no"; if val = 1 then return "yes"; return ""} macro hop_inum_84 (val) { if val = 0 then return "use default fd"; if val = 1 then return "use reserved fd"; if val = 2 then return "don't use reserved fd"; return ""} macro hop_inum_85 (val) { if val = 0 then return "auto"; if val = 1 then return "NOauto"; return ""} macro hop_inum_86 (val) { if val = 0 then return "change"; if val = 1 then return "remain"; return ""} macro hop_inum_val_str (hop : int, val : int) { if hop = #3 then return hop_inum_3 (val); if hop = #5 then return hop_inum_5 (val); if hop = #6 then return hop_inum_6 (val); if hop = #7 then return hop_inum_7 (val); if hop = #9 then return hop_inum_9 (val); if hop = #10 then return hop_inum_10 (val); if hop = #11 then return hop_inum_11 (val); if hop = #12 then return hop_inum_12 (val); if hop = #13 then return hop_inum_13 (val); if hop = #14 then return hop_inum_14 (val); if hop = #15 then return hop_inum_15 (val); if hop = #16 then return hop_inum_16 (val); if hop = #30 then return hop_inum_30 (val); if hop = #39 then return hop_inum_39 (val); if hop = #41 then return hop_inum_41 (val); if hop = #46 then return hop_inum_46 (val); if hop = #50 then return hop_inum_50 (val); if hop = #53 then return hop_inum_53 (val); if hop = #71 then return hop_inum_71 (val); if hop = #74 then return hop_inum_74 (val); if hop = #77 then return hop_inum_77 (val); if hop = #78 then return hop_inum_78 (val); if hop = #79 then return hop_inum_79 (val); if hop = #80 then return hop_inum_80 (val); if hop = #81 then return hop_inum_81 (val); if hop = #82 then return hop_inum_82 (val); if hop = #83 then return hop_inum_83 (val); if hop = #84 then return hop_inum_84 (val); if hop = #85 then return hop_inum_85 (val); if hop = #86 then return hop_inum_86 (val); return ""; } wl; wl "Trying to set breakpoint at HPFOPEN..."; {env error 0; ignore quiet; b HPFOPEN,,,show_hpfopen; if error = 0 then wl "ok"; }