DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T t ┃
Length: 3482 (0xd9a) Types: TextFile Names: »trace.c«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6 └─ ⟦0c25cb74a⟧ »DATA« └─⟦038380b96⟧ └─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7 └─ ⟦f494b5154⟧ »DATA« └─⟦038380b96⟧ └─ ⟦this⟧ »trace.c« └─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6 └─ ⟦0c25cb74a⟧ »DATA« └─⟦0732ea0cf⟧ └─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7 └─ ⟦f494b5154⟧ »DATA« └─⟦0732ea0cf⟧ └─ ⟦this⟧ »../../dtia/release_apollo_2.1/trace.c« └─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6 └─ ⟦0c25cb74a⟧ »DATA« └─⟦25fab149a⟧ └─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7 └─ ⟦f494b5154⟧ »DATA« └─⟦25fab149a⟧ └─ ⟦this⟧ »../../dtia/release_sun_2.1/trace.c« └─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6 └─ ⟦0c25cb74a⟧ »DATA« └─⟦be254d495⟧ └─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7 └─ ⟦f494b5154⟧ »DATA« └─⟦be254d495⟧ └─ ⟦this⟧ »../../dtia/release_aix_2.1/trace.c« └─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6 └─ ⟦0c25cb74a⟧ »DATA« └─⟦c67979795⟧ └─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7 └─ ⟦f494b5154⟧ »DATA« └─⟦c67979795⟧ └─ ⟦this⟧ »../../dtia/release_hp_2.1/trace.c«
#ifndef lint #ifndef DEBUG static char SCCS_id[] = "@(#)trace.c 2.1 90/08/13 09:43:50 Copyright(c) 1990 by Rational."; #else static char SCCS_id[] = "@(#)trace.c DEBUG 2.1 90/08/13 09:43:50 Copyright(c) 1990 by Rational."; #endif #endif #define TRACE #include "talk.h" #undef TRACE #ifdef DEBUG static struct _t { int err; char *msg; } errors[] = { {E_OK,"OK"}, {E_CONNECTION,"CONNECTION"}, {E_INTERNAL_ERROR,"INTERNAL_ERROR"}, {E_BAD_USER,"BAD_USER"}, {E_ACCESS_ERROR,"ACCESS_ERROR"}, {E_DEVICE_ERROR,"DEVICE_ERROR"}, {E_LOCK_ERROR,"LOCK_ERROR"}, {E_NAME_ERROR,"NAME_ERROR"}, {E_POLICY_ERROR,"POLICY_ERROR"}, {E_STATUS_ERROR,"STATUS_ERROR"}, {E_STORAGE_ERROR,"STORAGE_ERROR"}, {E_UNSUPPORTED,"UNSUPPORTED"}, {E_USE_ERROR,"USE_ERROR"}, {E_COMMAND_ERROR,"COMMAND_ERROR"}, {E_COMMAND_TERMINATED,"COMMAND_TERMINATED"}, {E_COMMAND_TIMED_OUT,"COMMAND_TIMED_OUT"}, {E_RESOURCE_LIMIT,"RESOURCE_LIMIT"} }; static char *image(e) int e; { int i; for ( i = 0 ; i < (sizeof(errors) / sizeof(struct _t)) ; i++) { if (e == errors[i].err) return errors[i].msg; } return "Unknown"; } static FILE *tr_file = NULL; int trace_file_name(f) char *f; { tr_file = fopen(f,"w"); } int trace_msg(s) char *s; { if (tr_file) (void)fprintf(tr_file,s); if (tr_file) (void)fflush(tr_file); } int trace_msg2(s,o) char *s,*o; { if (tr_file) (void)fprintf(tr_file,s,o); if (tr_file) (void)fflush(tr_file); } int trace_request(r) char *r; { if (tr_file) (void)fprintf(tr_file,"REQUEST %s\n",r); if (tr_file) (void)fflush(tr_file); } int trace_bool(in_out,p,v) char *in_out; /* in or out */ char *p; int v; { if (tr_file) (void)fprintf(tr_file," %s boolean %s <%s>\n", in_out,p,v?"true":"false"); if (tr_file) (void)fflush(tr_file); } int trace_int(in_out,p,v) char *in_out; /* in or out */ char *p; int v; { if (tr_file) (void)fprintf(tr_file," %s integer %s <%d>\n", in_out,p,v); if (tr_file) (void)fflush(tr_file); } static char *hexa(c) char c; { int i; static char s[3]; i = (c & 0xF0) >> 4; if (i<10) s[0] = i + '0'; else s[0] = i - 10 + 'A'; i = c & 0x0F; if (i<10) s[1] = i + '0'; else s[1] = i - 10 + 'A'; s[2] = '\0'; return s; } static int pr_char(c) char c; { if (tr_file) { if ( (c>=' ') && (c<='z') ) { (void)fprintf(tr_file,"%c",c); } else { (void)fprintf(tr_file,"[%s]",hexa(c)); } } if (tr_file) (void)fflush(tr_file); } static int pr_str(s,l) char *s; int l; { char *p; #ifndef DEBUG1 if (tr_file) (void)fprintf(tr_file," length(%d)\n",l); #else if (tr_file) (void)fprintf(tr_file," length(%d) <",l); if (l>15) { for (p=s;p<s+5;p++) pr_char(*p); if (tr_file) (void)fprintf(tr_file,"> ... <"); for (p=s+l-5;p<s+l;p++) pr_char(*p); } else { for (p=s;p<s+l;p++) pr_char(*p); } if (tr_file) (void)fprintf(tr_file,">\n"); #endif if (tr_file) (void)fflush(tr_file); } int trace_bnd_string(in_out,p,v,l) char *in_out; /* in or out */ char *p; char *v; int l; { if (tr_file) (void)fprintf(tr_file," %s string %s",in_out,p); pr_str(v,l); } int trace_string(in_out,p,v) char *in_out; /* in or out */ char *p; char *v; { if (tr_file) (void)fprintf(tr_file," %s string %s",in_out,p); pr_str(v,strlen(v)); } int trace_end() { if (tr_file) (void)fprintf(tr_file,"OK\n\n"); if (tr_file) (void)fflush(tr_file); } int trace_error(e,s) int e; char *s; { if (tr_file) (void)fprintf(tr_file,"ERROR %s <%s>\n\n",image(e),s); if (tr_file) (void)fflush(tr_file); } #endif