|
|
1.1 ! root 1: .TH CIN 1 ! 2: .CT 1 prog_c ! 3: .SH NAME ! 4: cin \- C interpreter ! 5: .SH SYNOPSIS ! 6: .B cin ! 7: [ ! 8: .I option ... ! 9: ] ! 10: [ ! 11: .I file ... ! 12: ] ! 13: [ ! 14: .B -- ! 15: .I arg ... ! 16: ] ! 17: .SH DESCRIPTION ! 18: .I Cin ! 19: interprets a C program made of the named ! 20: .I files. ! 21: A single minus ! 22: .RB ( - ) ! 23: names the standard input. ! 24: Other ! 25: .I files ! 26: are as in ! 27: .IR cc (1). ! 28: Arguments ! 29: .I arg ! 30: are passed to the interpreted program as ! 31: .B cin_argv[1] ! 32: \&... ! 33: .PP ! 34: Options ! 35: .BI -D name = def , ! 36: .BI -D name , ! 37: .BI -U name , ! 38: .BI -I name , ! 39: .BI -l x , ! 40: and ! 41: .BI -u name ! 42: are as in ! 43: .IR cc . ! 44: Options ! 45: .B -O ! 46: and ! 47: .B -f ! 48: are ignored. ! 49: Other options are: ! 50: .TP \w'\f5-0\fIname\ \ 'u ! 51: .BI -0 name ! 52: Pass ! 53: .I name ! 54: to the interpreted program as ! 55: .BR cin_argv[0] . ! 56: .TP ! 57: .BI -V name : n ! 58: Function ! 59: .I name ! 60: has a variable number of arguments. ! 61: Check types of the first ! 62: .I n ! 63: arguments. ! 64: .TP ! 65: .B -c ! 66: Parse files but do not execute the program. ! 67: .TP ! 68: .B -d ! 69: Enable internal debugging output. ! 70: .TP ! 71: .B -i ! 72: Enter interactive mode; see below. ! 73: .TP ! 74: .BI -o name ! 75: Create ! 76: object code in file ! 77: .I name ! 78: before starting execution. ! 79: .TP ! 80: .B -r ! 81: Prohibit multiply-declared global variables. ! 82: .TP ! 83: .B -s ! 84: Do not catch signals. ! 85: .TP ! 86: .B -t ! 87: Print file name and line number of each C statement executed. ! 88: .TP ! 89: .B -v ! 90: Print the user and system times associated with loading files and executing ! 91: the program, as in ! 92: .IR time (1). ! 93: .PP ! 94: Under option ! 95: .BR -i , ! 96: .I cin ! 97: evaluates C statements immediately using local and global variables. ! 98: Non-void values are printed. ! 99: Function, variable, and C pre-processor declarations are stored ! 100: in the current `view'. ! 101: A function definition must include its return type. ! 102: Declarations and statements may appear in any order and ! 103: variables may be redeclared. ! 104: The functions and variables listed below are predefined; ! 105: the types of their arguments follow these conventions: ! 106: .IP ! 107: .BI "char *" name ", *" string , ! 108: .BI * file ; ! 109: .br ! 110: .BI "int " line ; ! 111: .br ! 112: .BI "long (*" func ")(), (*" func_mod ")(), ! 113: .BI (* func_ref )(); ! 114: .PP ! 115: .HP ! 116: .BI "void cin_bind(" name , " func" );\ ! 117: Set an alias of ! 118: .I name ! 119: for the function ! 120: .IR func . ! 121: .HP ! 122: .BI "int cin_break(" name , " line" );\ ! 123: Set a breakpoint in function ! 124: .I name ! 125: at line number ! 126: .I line ! 127: in the current view. ! 128: Return 0 if breakpoint cannot be set. ! 129: .HP ! 130: .BI "int cin_dump(" name );\ ! 131: Create an ! 132: .F a.out ! 133: and place it in the file ! 134: .IR name . ! 135: Return 0 if ! 136: .I name ! 137: cannot be created. ! 138: .HP ! 139: .BI "int cin_eval(" string );\ ! 140: Execute the ! 141: C statement ! 142: .I string ! 143: as if it were present in the program where the ! 144: .B cin_eval ! 145: is executed. ! 146: Return 0 if ! 147: .I string ! 148: could not be parsed. ! 149: .HP ! 150: .BI "int cin_load(" file );\ ! 151: Load ! 152: .I file ! 153: into a new view, ! 154: using the standard file-naming conventions for ! 155: .IR cc (1). ! 156: Return 0 if ! 157: .I file ! 158: can not be loaded. ! 159: .HP ! 160: .BI "int cin_log(" file );\ ! 161: Record the interactive mode session in ! 162: .IR file . ! 163: Return 0 if ! 164: .I file ! 165: cannot be created. ! 166: .HP ! 167: .BI "void cin_mstats(" string );\ ! 168: Print ! 169: .IR cin 's ! 170: memory usage with a banner of ! 171: .IR string . ! 172: .HP ! 173: .B void cin_return();\ ! 174: Return from a breakpoint. ! 175: .HP ! 176: .BI "int cin_spy(" name , " func_mod" , " func_ref\f5\^);\ ! 177: Call the function ! 178: .I func_mod ! 179: whenever the variable ! 180: .I name ! 181: is modified. ! 182: Call the function ! 183: .I func_ref ! 184: whenever the variable ! 185: .I name ! 186: is referenced. ! 187: Either ! 188: .I func_mod ! 189: or ! 190: .I func_ref ! 191: can be ! 192: .BR "(long (*)())0" . ! 193: Return 0 if there are no spies active. ! 194: .HP ! 195: .BI "void cin_system();\ ! 196: Enter interactive mode. ! 197: .HP ! 198: .BI "int cin_unbreak(" name , " line" );\ ! 199: Remove a breakpoint in function ! 200: .I name ! 201: at line number ! 202: .I line ! 203: in the current view. ! 204: Return 0 if the breakpoint was not set. ! 205: .HP ! 206: .BI "int cin_view(" name );\ ! 207: Change the current view to ! 208: .IR name . ! 209: Return 0 if the name ! 210: is not found. ! 211: .HP ! 212: .B void cin_views();\ ! 213: List the available views. ! 214: The current view ! 215: is starred ! 216: .RB ( * ). ! 217: .HP ! 218: .BI "void cin_whatis(" name );\ ! 219: Print the type of the named variable. ! 220: .HP ! 221: .B void cin_where();\ ! 222: Print a trace of subroutine calls. ! 223: .HP ! 224: .B void cin_quit();\ ! 225: Exit ! 226: .IR cin . ! 227: .HP ! 228: .B extern int cin_argc;\ ! 229: The number of elements passed to the interpreted program. ! 230: .HP ! 231: .B extern char **cin_argv;\ ! 232: An array of arguments passed to the interpreted program. ! 233: .HP ! 234: .B extern char *cin_libpath;\ ! 235: A colon-separated list of libraries to search for undefined routines ! 236: (by default the libraries specified on the command line plus ! 237: .BR -lc ). ! 238: .HP ! 239: .B extern char *cin_prompt;\ ! 240: The interactive mode prompt (by default the string ! 241: .LR cin> ). ! 242: .PD ! 243: .SH EXAMPLES ! 244: .TP ! 245: `Hello world' in interactive mode. ! 246: .EX ! 247: cin> printf("Hello world\en"); ! 248: Hello world ! 249: (int)12 ! 250: .EE ! 251: .TP ! 252: Setting breakpoints and tracing subroutine calls. ! 253: .EX ! 254: cin> int f(x) { return x <= 1 ? 1 : x * f(x-1); } ! 255: cin> cin_break("f", 1); ! 256: breakpoint in function f at line 1 ! 257: (int)1 ! 258: cin> f(2); ! 259: breakpoint in function 'f' at line 1 of file 'interactive mode' ! 260: cin> cin_return(); ! 261: breakpoint in function 'f' at line 1 of file 'interactive mode' ! 262: cin> (void)cin_where(); ! 263: cin_system() [interactive mode:4] ! 264: f(x = 1) [interactive mode:1] ! 265: f(x = 2) [interactive mode:1] ! 266: cin_system() [interactive mode:3] ! 267: cin> x; ! 268: (int)1 ! 269: cin> cin_return(); ! 270: (int)2 ! 271: .EE ! 272: .SH FILES ! 273: .TF $HOME/.cinit ! 274: .TP ! 275: .F /tmp/int* ! 276: temporary ! 277: .TP ! 278: .F $HOME/.cinit ! 279: interpreter startup file ! 280: .HP ! 281: other files as in;\ ! 282: .IR cc (1) ! 283: .SH "SEE ALSO" ! 284: .IR cc (1), ! 285: .IR lint (1) ! 286: .br ! 287: T. J. Kowalski, H. H. Goguen, and J. J. Puttress, ! 288: `The C Interpreter: ! 289: A Tutorial for Cin Version 0.18', ! 290: this manual, Volume 2 ! 291: .br ! 292: B. W. Kernighan and D. M. Ritchie, ! 293: .I The C Programming Language, ! 294: Prentice-Hall, ! 295: 1978
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.