Headers and library sources from all versions of Lightspeed C and THINK C

Import Lightspeed C 2.15

+3288 -1971
+49
C Libraries/headers/math.h
··· 1 + /**************************************************************************** 2 + 3 + Standard math library header for LightspeedC. 4 + 5 + (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. 6 + 7 + *****************************************************************************/ 8 + 9 + #ifndef _math_ 10 + 11 + #define _math_ /* show symbols defined */ 12 + double acos(double x); 13 + double asin(double x); 14 + double atan(double x); 15 + double atan2(double y, double x); 16 + double ceil(double x); 17 + double cos(double x); 18 + double cosh(double x); 19 + double exp(double x); 20 + double fabs(double x); 21 + double floor(double x); 22 + double fmod(double x, double y); 23 + double frexp(double x, int *i); 24 + long labs(long l); 25 + double ldexp(double x, int n); 26 + double log(double x); 27 + double log10(double x); 28 + double modf(double x, int *i); 29 + double pow(double x, double y); 30 + double sin(double x); 31 + double sinh(double x); 32 + double sqrt(double x); 33 + double tan(double x); 34 + double tanh(double x); 35 + 36 + #define PI (3.14159265358979323846) 37 + #define PI2 (1.57079632679489661923) 38 + #define PI4 (0.78539816339744830966) 39 + 40 + #define E (2.71828182845904523536) 41 + 42 + typedef enum{ 43 + EDOM=33, 44 + ERANGE=34 45 + }; 46 + 47 + extern int errno; /* actually defined in stdio */ 48 + 49 + #endif
+611
C Libraries/sources/math.c
··· 1 + 2 + /* 3 + 4 + Math library for LightspeedC 5 + 6 + (C) Copyright 1986 THINK Technologies. All rights reserved. 7 + 8 + For details, refer to Harbison & Steele's "C: A Reference Manual", 9 + Chapter 11. 10 + 11 + */ 12 + 13 + 14 + #include "math.h" 15 + #include "sane.h" 16 + 17 + /* useful constants */ 18 + static double Zero = 0.0; 19 + static double One = 1.0; 20 + static double Two = 2.0; 21 + static double MinusOne = -1.0; 22 + static double MinusTwo = -2.0; 23 + static double PointFive = 0.5; 24 + static double PointTwoFive = 0.25; 25 + static double Pi = PI; 26 + static double Pi2 = PI2; 27 + static double Log2Ten = 3.321928094887362348; 28 + 29 + 30 + /* seed for pseudo-random number generator */ 31 + static unsigned long seed = 1; 32 + 33 + 34 + /* environment word masks */ 35 + #define ROUND 0x6000 36 + #define ROUND_UP 0x2000 37 + #define ROUND_DOWN 0x4000 38 + #define ERROR 0x0F00 39 + 40 + 41 + /* ---------- error checking ---------- */ 42 + 43 + 44 + #define ERRORCHECK 45 + 46 + /* 47 + Error checking will be suppressed if ERRORCHECK is not #defined. 48 + 49 + To conform to standard C, error checking must be enabled. If 50 + the "stdio" library is not included in the project, the integer 51 + variable "errno" must be defined somewhere else. 52 + 53 + Without error checking, the math functions will execute somewhat 54 + faster, and no references to "errno" will result. 55 + */ 56 + 57 + #ifdef ERRORCHECK 58 + 59 + #define DomainCheck(test, result) if (test) { \ 60 + errno = EDOM; \ 61 + return(result); \ 62 + } 63 + #define RangeCheck(target) if (GetState() & ERROR) { \ 64 + errno = ERANGE; \ 65 + target = Max; \ 66 + } 67 + static short _Max[] = { 0x7FFE, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF }; 68 + static short _MinusMax[] = { 0xFFFE, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF }; 69 + #define Max (* (double *) _Max) 70 + #define MinusMax (* (double *) _MinusMax) 71 + 72 + #else ERRORCHECK 73 + 74 + #define ClearExceptions() 75 + #define DomainCheck(test, result) 76 + #define RangeCheck(target) 77 + 78 + #endif ERRORCHECK 79 + 80 + 81 + /* ---------- environment ---------- */ 82 + 83 + 84 + /* 85 + * GetState - query environment word 86 + * 87 + */ 88 + 89 + static 90 + GetState() 91 + { 92 + int state; 93 + 94 + GetEnvironment(&state); 95 + return(state); 96 + } 97 + 98 + 99 + /* 100 + * SetState - define environment word 101 + * 102 + */ 103 + 104 + static 105 + SetState(state) 106 + { 107 + SetEnvironment(&state); 108 + } 109 + 110 + 111 + /* 112 + * ClearExceptions - clear error conditions 113 + * 114 + * This must be called if RangeCheck is to be used. 115 + * 116 + */ 117 + 118 + #ifdef ERRORCHECK 119 + static 120 + ClearExceptions() 121 + { 122 + int state; 123 + 124 + GetEnvironment(&state); 125 + state &= ~ERROR; 126 + SetEnvironment(&state); 127 + } 128 + #endif ERRORCHECK 129 + 130 + 131 + /* 132 + * SetRound - define rounding direction 133 + * 134 + * The previous environment word is returned. The rounding direction can 135 + * be restored by passing this value to SetState. 136 + * 137 + */ 138 + 139 + static 140 + SetRound(direction) 141 + { 142 + int state; 143 + 144 + GetEnvironment(&state); 145 + SetState((state & ~ROUND) | direction); 146 + return(state); 147 + } 148 + 149 + 150 + /* 151 + * xfersign - transfer sign from one floating number to another 152 + * 153 + */ 154 + 155 + static 156 + xfersign(x, yp) 157 + double x, *yp; 158 + { 159 + asm { 160 + movea.l yp,a0 161 + bclr #7,(a0) 162 + tst.w x 163 + bpl.s @1 164 + bset #7,(a0) 165 + @1 } 166 + } 167 + 168 + 169 + /* ---------- math functions (alphabetically) ---------- */ 170 + 171 + 172 + /* 173 + * abs - absolute value of an integer 174 + * 175 + */ 176 + 177 + int abs(x) 178 + int x; 179 + { 180 + return(x < 0 ? -x : x); 181 + } 182 + 183 + 184 + /* 185 + * acos - inverse circular cosine 186 + * 187 + */ 188 + 189 + double acos(x) 190 + double x; 191 + { 192 + DomainCheck(x > One || x < MinusOne, Zero); 193 + if (x == MinusOne) 194 + return(Pi); 195 + return(Two * atan(sqrt((One - x) / (One + x)))); 196 + } 197 + 198 + 199 + /* 200 + * asin - inverse circular sine 201 + * 202 + */ 203 + 204 + double asin(x) 205 + double x; 206 + { 207 + double y = fabs(x); 208 + 209 + DomainCheck(y > One, Zero); 210 + if (y == One) { 211 + y = Pi2; 212 + xfersign(x, &y); 213 + return(y); 214 + } 215 + if (y > PointFive) { 216 + y = One - y; 217 + y = Two * y - y * y; 218 + } 219 + else 220 + y = One - y * y; 221 + return(atan(x / sqrt(y))); 222 + } 223 + 224 + 225 + /* 226 + * atan - inverse circular tangent 227 + * 228 + */ 229 + 230 + double atan(x) 231 + double x; 232 + { 233 + elems68k(&x, FOATANX); 234 + return(x); 235 + } 236 + 237 + 238 + /* 239 + * atan2 - inverse circular tangent (y/x) 240 + * 241 + */ 242 + 243 + double atan2(y, x) 244 + double y, x; 245 + { 246 + double z; 247 + 248 + if (x == 0) { 249 + DomainCheck(y == 0, Zero); 250 + z = Pi2; 251 + } 252 + else { 253 + z = atan(fabs(y / x)); 254 + if (x < 0) 255 + z = Pi - z; 256 + } 257 + xfersign(y, &z); 258 + return(z); 259 + } 260 + 261 + 262 + /* 263 + * ceil - round up to an integer 264 + * 265 + */ 266 + 267 + double ceil(x) 268 + double x; 269 + { 270 + int state = SetRound(ROUND_UP); 271 + 272 + fp68k(&x, FORTI); 273 + SetState(state); 274 + return(x); 275 + } 276 + 277 + 278 + /* 279 + * cos - circular cosine 280 + * 281 + */ 282 + 283 + double cos(x) 284 + double x; 285 + { 286 + elems68k(&x, FOCOSX); 287 + return(x); 288 + } 289 + 290 + 291 + /* 292 + * cosh - hyperbolic cosine 293 + * 294 + */ 295 + 296 + double cosh(x) 297 + double x; 298 + { 299 + ClearExceptions(); 300 + x = PointFive * exp(fabs(x)); 301 + x += PointTwoFive / x; 302 + RangeCheck(x); 303 + return(x); 304 + } 305 + 306 + 307 + /* 308 + * exp - exponential function 309 + * 310 + */ 311 + 312 + double exp(x) 313 + double x; 314 + { 315 + ClearExceptions(); 316 + elems68k(&x, FOEXPX); 317 + RangeCheck(x); 318 + return(x); 319 + } 320 + 321 + 322 + /* 323 + * fabs - absolute value of a floating number 324 + * 325 + */ 326 + 327 + double fabs(x) 328 + double x; 329 + { 330 + fp68k(&x, FOABS); 331 + return(x); 332 + } 333 + 334 + 335 + /* 336 + * floor - round down to an integer 337 + * 338 + */ 339 + 340 + double floor(x) 341 + double x; 342 + { 343 + int state = SetRound(ROUND_DOWN); 344 + 345 + fp68k(&x, FORTI); 346 + SetState(state); 347 + return(x); 348 + } 349 + 350 + 351 + /* 352 + * fmod - remainder function 353 + * 354 + * This computes a value z, with the same sign as x, such that for some 355 + * integer k, k*y + z == x. 356 + * 357 + */ 358 + 359 + double fmod(x, y) 360 + double x, y; 361 + { 362 + double z = x; 363 + 364 + fp68k(&y, FOABS); 365 + fp68k(&y, &z, FOREM); 366 + if (x > 0 && z < 0) 367 + z += y; 368 + else if (x < 0 && z > 0) 369 + z -= y; 370 + return(z); 371 + } 372 + 373 + 374 + /* 375 + * frexp - split floating number into fraction/exponent 376 + * 377 + * This computes a value z, where 0.5 <= fabs(z) < 1.0, and an integer n such 378 + * that z*(2^n) == x. 379 + * 380 + */ 381 + 382 + double frexp(x, nptr) 383 + double x; 384 + register int *nptr; 385 + { 386 + double y = fabs(x), z = Two; 387 + 388 + if (y == 0) { 389 + *nptr = 0; 390 + return(Zero); 391 + } 392 + elems68k(&y, FOLOG2X); 393 + y -= *nptr = y; 394 + elems68k(&y, &z, FOPWRY); 395 + if (z >= One) { 396 + z *= PointFive; 397 + ++*nptr; 398 + } 399 + else if (z < PointFive) { 400 + z += z; 401 + --*nptr; 402 + } 403 + xfersign(x, &z); 404 + return(z); 405 + } 406 + 407 + 408 + /* 409 + * labs - absolute value of a long integer 410 + * 411 + */ 412 + 413 + long labs(x) 414 + long x; 415 + { 416 + return(x < 0 ? -x : x); 417 + } 418 + 419 + 420 + /* 421 + * ldexp - combine fraction/exponent into a floating number 422 + * 423 + */ 424 + 425 + double ldexp(x, n) 426 + double x; 427 + int n; 428 + { 429 + fp68k(&n, &x, FOSCALB); 430 + return(x); 431 + } 432 + 433 + 434 + /* 435 + * log - natural logarithm 436 + * 437 + */ 438 + 439 + double log(x) 440 + double x; 441 + { 442 + DomainCheck(x <= 0, MinusMax); 443 + elems68k(&x, FOLNX); 444 + return(x); 445 + } 446 + 447 + 448 + /* 449 + * log10 - logarithm base 10 450 + * 451 + */ 452 + 453 + double log10(x) 454 + double x; 455 + { 456 + DomainCheck(x <= 0, MinusMax); 457 + elems68k(&x, FOLOG2X); /* LOG2 is much faster than LN */ 458 + return(x / Log2Ten); 459 + } 460 + 461 + 462 + /* 463 + * modf - split a floating number into fraction/integer 464 + * 465 + */ 466 + 467 + double modf(x, nptr) 468 + double x; 469 + register int *nptr; 470 + { 471 + if (abs(*nptr = x) > fabs(x)) { 472 + if (*nptr > 0) 473 + --*nptr; 474 + else 475 + ++*nptr; 476 + } 477 + return(x - *nptr); 478 + } 479 + 480 + 481 + /* 482 + * pow - power function (exponentiation) 483 + * 484 + */ 485 + 486 + double pow(x, y) 487 + double x, y; 488 + { 489 + int exactint = 0; 490 + 491 + ClearExceptions(); 492 + if (x == 0) { 493 + DomainCheck(y <= 0, MinusMax); 494 + return(Zero); 495 + } 496 + if (y == 0) 497 + return(One); 498 + if (x < 0) { 499 + DomainCheck(modf(y, &exactint), MinusMax); 500 + x = -x; 501 + } 502 + elems68k(&y, &x, FOPWRY); 503 + RangeCheck(x); 504 + return((exactint & 1) ? -x : x); 505 + } 506 + 507 + 508 + /* 509 + * rand - pseudo-random number generator (ANSI C standard) 510 + * 511 + */ 512 + 513 + int rand() 514 + { 515 + seed = seed * 1103515245 + 12345; 516 + asm { 517 + move.w seed,d0 ; high word of long 518 + andi.w #0x7FFF,d0 ; remove high bit 519 + } 520 + } 521 + 522 + 523 + /* 524 + * sin - circular sine 525 + * 526 + */ 527 + 528 + double sin(x) 529 + double x; 530 + { 531 + elems68k(&x, FOSINX); 532 + return(x); 533 + } 534 + 535 + 536 + /* 537 + * sinh - hyperbolic sine 538 + * 539 + */ 540 + 541 + double sinh(x) 542 + double x; 543 + { 544 + double y = fabs(x); 545 + 546 + ClearExceptions(); 547 + elems68k(&y, FOEXP1X); 548 + y += y / (y + One); 549 + y *= PointFive; 550 + RangeCheck(y); 551 + xfersign(x, &y); 552 + return(y); 553 + } 554 + 555 + 556 + /* 557 + * sqrt - square root 558 + * 559 + */ 560 + 561 + double sqrt(x) 562 + double x; 563 + { 564 + DomainCheck(x < 0, Zero); 565 + fp68k(&x, FOSQRT); 566 + return(x); 567 + } 568 + 569 + 570 + /* 571 + * srand - seed pseudo-random number generator 572 + * 573 + */ 574 + 575 + void srand(n) 576 + unsigned n; 577 + { 578 + seed = n; 579 + } 580 + 581 + 582 + /* 583 + * tan - circular tangent 584 + * 585 + */ 586 + 587 + double tan(x) 588 + double x; 589 + { 590 + ClearExceptions(); 591 + elems68k(&x, FOTANX); 592 + RangeCheck(x); 593 + return(x); 594 + } 595 + 596 + 597 + /* 598 + * tanh - hyperbolic tangent 599 + * 600 + */ 601 + 602 + double tanh(x) 603 + double x; 604 + { 605 + double y = MinusTwo * fabs(x); 606 + 607 + elems68k(&y, FOEXP1X); 608 + y = -y / (y + Two); 609 + xfersign(x, &y); 610 + return(y); 611 + }
C Libraries/sources/stdio .c files/Dec2Str.Lib

This is a binary file and will not be displayed.

C Libraries/sources/stdio .c files/Str2Dec.Lib

This is a binary file and will not be displayed.

+351
Mac #includes/Color.h
··· 1 + 2 + /* 3 + * Color.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _Color_ 12 + #define _Color_ 13 + 14 + #ifndef _Quickdraw_ 15 + #include "Quickdraw.h" 16 + #endif 17 + 18 + 19 + #define invalColReq -1 /* invalid color table request */ 20 + 21 + /* VALUES FOR GDType */ 22 + 23 + #define clutType 0 24 + #define fixedType 1 25 + #define directType 2 26 + 27 + /* BIT ASSIGNMENTS FOR GDFlags */ 28 + 29 + #define gdDevType 0 30 + #define ramInit 10 31 + #define mainScrn 11 32 + #define allInit 12 33 + #define screenDevice 13 34 + #define noDriver 14 35 + #define scrnActive 15 36 + 37 + #define hiliteBit 7 38 + 39 + #define defQDColors 127 40 + 41 + 42 + typedef struct RGBColor{ 43 + unsigned short red; 44 + unsigned short green; 45 + unsigned short blue; 46 + } RGBColor; 47 + 48 + typedef struct ColorSpec{ 49 + short value; 50 + RGBColor rgb; 51 + } ColorSpec; 52 + 53 + typedef ColorSpec CSpecArray[1]; /* array [0..0] of ColorSpec */ 54 + 55 + typedef struct ColorTable{ 56 + long ctSeed; 57 + short transIndex; 58 + short ctSize; 59 + CSpecArray ctTable; 60 + } ColorTable, *CTabPtr, **CTabHandle; 61 + 62 + typedef struct MatchRec{ 63 + unsigned short red; 64 + unsigned short green; 65 + unsigned short blue; 66 + long matchData; 67 + } MatchRec; 68 + 69 + typedef struct PixMap{ 70 + Ptr baseAddr; 71 + short rowBytes; 72 + Rect bounds; 73 + short pmVersion; 74 + short packType; 75 + long packSize; 76 + Fixed hRes; 77 + Fixed vRes; 78 + short pixelType; 79 + short pixelSize; 80 + short cmpCount; 81 + short cmpSize; 82 + long planeBytes; 83 + CTabHandle pmTable; 84 + long pmReserved; 85 + } PixMap, *PixMapPtr, **PixMapHandle; 86 + 87 + typedef struct PixPat{ 88 + short patType; 89 + PixMapHandle patMap; 90 + Handle patData; 91 + Handle patXData; 92 + short patXValid; 93 + Handle patXMap; 94 + Pattern pat1Data; 95 + } PixPat, *PixPatPtr, **PixPatHandle; 96 + 97 + typedef struct CCrsr{ 98 + short crsrType; 99 + PixMapHandle crsrMap; 100 + Handle crsrData; 101 + Handle crsrXData; 102 + short crsrXValid; 103 + Handle crsrXHandle; 104 + Bits16 crsr1Data; 105 + Bits16 crsrMask; 106 + Point crsrHotSpot; 107 + long crsrXTable; 108 + long crsrID; 109 + } CCrsr, *CCrsrPtr, **CCrsrHandle; 110 + 111 + typedef struct CIcon{ 112 + PixMap iconPMap; 113 + BitMap iconMask; 114 + BitMap iconBMap; 115 + Handle iconData; 116 + short iconMaskData[1]; 117 + } CIcon, *CIconPtr, **CIconHandle; 118 + 119 + typedef struct GammaTbl{ 120 + short gVersion; 121 + short gType; 122 + short gFormulaSize; 123 + short gChanCnt; 124 + short gDataCnt; 125 + short gDataWidth; 126 + short gFormulaData[1]; 127 + } GammaTbl, *GammaTblPtr, **GammaTblHandle; 128 + 129 + typedef struct ITab{ 130 + long iTabSeed; 131 + short iTabRes; 132 + char iTTable[1]; 133 + } ITab, *ITabPtr, **ITabHandle; 134 + 135 + typedef struct SProcRec{ 136 + struct SProcRec **nxtSrch; 137 + ProcPtr srchProc; 138 + } SProcRec, *SProcPtr, **SProcHndl; 139 + 140 + typedef struct CProcRec{ 141 + struct CProcRec **nxtComp; 142 + ProcPtr compProc; 143 + } CProcRec, *CProcPtr, **CProcHndl; 144 + 145 + typedef struct GDevice{ 146 + short gdRefNum; 147 + short gdID; 148 + short gdType; 149 + ITabHandle gdITable; 150 + short gdResPref; 151 + SProcHndl gdSearchProc; 152 + CProcHndl gdCompProc; 153 + short gdFlags; 154 + PixMapHandle gdPMap; 155 + long gdRefCon; 156 + struct GDevice **gdNextGD; 157 + Rect gdRect; 158 + long gdMode; 159 + short gdCCBytes; 160 + short gdCCDepth; 161 + Handle gdCCXData; 162 + Handle gdCCXMask; 163 + long gdReserved; 164 + } GDevice, *GDPtr, **GDHandle; 165 + 166 + typedef struct CGrafPort{ 167 + short device; 168 + PixMapHandle portPixMap; 169 + short portVersion; 170 + Handle grafVars; 171 + short chExtra; 172 + short pnLocHFrac; 173 + Rect portRect; 174 + RgnHandle visRgn; 175 + RgnHandle clipRgn; 176 + PixPatHandle bkPixPat; 177 + RGBColor rgbFgColor; 178 + RGBColor rgbBkColor; 179 + Point pnLoc; 180 + Point pnSize; 181 + short pnMode; 182 + PixPatHandle pnPixPat; 183 + PixPatHandle fillPixPat; 184 + short pnVis; 185 + short txFont; 186 + Style txFace; 187 + short txMode; 188 + short txSize; 189 + Fixed spExtra; 190 + long fgColor; 191 + long bkColor; 192 + short colrBit; 193 + short patStretch; 194 + QDHandle picSave; 195 + QDHandle rgnSave; 196 + QDHandle polySave; 197 + QDProcsPtr grafProcs; 198 + } CGrafPort, *CGrafPtr; 199 + 200 + typedef struct GrafVars{ 201 + RGBColor rgbOpColor; 202 + RGBColor rgbHiliteColor; 203 + Handle pmFgColor; 204 + short pmFgIndex; 205 + Handle pmBkColor; 206 + short pmBkIndex; 207 + short pmFlags; 208 + } GrafVars; 209 + 210 + 211 + typedef struct CQDProcs { 212 + Ptr textProc; 213 + Ptr lineProc; 214 + Ptr rectProc; 215 + Ptr rRectProc; 216 + Ptr ovalProc; 217 + Ptr arcProc; 218 + Ptr polyProc; 219 + Ptr rgnProc; 220 + Ptr bitsProc; 221 + Ptr commentProc; 222 + Ptr txMeasProc; 223 + Ptr getPicProc; 224 + Ptr putPicProc; 225 + Ptr opcodeProc; /* fields added to QDProcs */ 226 + Ptr newProc1; 227 + Ptr newProc2; 228 + Ptr newProc3; 229 + Ptr newProc4; 230 + Ptr newProc5; 231 + Ptr newProc6; 232 + } CQDProcs,*CQDProcsPtr; 233 + 234 + typedef short QDErr; 235 + 236 + typedef struct ReqListRec{ 237 + short reqLSize; 238 + short reqLData[1]; 239 + } ReqListRec; 240 + 241 + 242 + /* Palette Manager */ 243 + 244 + /* Usage constants */ 245 + #define pmCourteous 0 246 + #define pmTolerant 2 247 + #define pmAnimated 4 248 + #define pmExplicit 8 249 + 250 + /* CUpdates constants */ 251 + #define pmAllCUpdates 0xC000 252 + #define pmBackCUpdates 0x8000 253 + #define pmFrontCUpdates 0x4000 254 + 255 + typedef struct ColorInfo{ 256 + RGBColor ciRGB; 257 + short ciUsage; 258 + short ciTolerance; 259 + short ciFlags; 260 + long ciPrivate; 261 + } ColorInfo; 262 + 263 + typedef struct Palette{ 264 + short pmEntries; 265 + GrafPtr pmWindow; 266 + short pmPrivate; 267 + long pmDevices; 268 + long pmSeeds; 269 + ColorInfo pmInfo[1]; 270 + } Palette, *PalettePtr, **PaletteHandle; 271 + 272 + 273 + /* Color Picker Package */ 274 + 275 + #define MaxSmallFract 0x0000FFFFL 276 + 277 + typedef short SmallFract; /* Unsigned fraction between 0 and 1 */ 278 + 279 + 280 + typedef struct HSVColor { 281 + SmallFract hue; 282 + SmallFract saturation; 283 + SmallFract value; 284 + } HSVColor; 285 + 286 + typedef struct HSLColor { 287 + SmallFract hue; 288 + SmallFract saturation; 289 + SmallFract lightness; 290 + } HSLColor; 291 + 292 + typedef struct CMYColor { 293 + SmallFract cyan; 294 + SmallFract magenta; 295 + SmallFract yellow; 296 + } CMYColor; 297 + 298 + 299 + /* error codes */ 300 + 301 + enum { 302 + cResErr = -156, 303 + cDevErr, 304 + cProtectErr, 305 + cRangeErr, 306 + cNoMemErr, 307 + cTempMemErr, 308 + cMatchErr, 309 + updPixMemErr = -125, 310 + seNoMemErr = -21, 311 + seInvRequest, 312 + reRangeErr, 313 + gdBadDev, 314 + i2CRangeErr, 315 + seProtErr, 316 + seOutOfRange, 317 + noRoomErr, 318 + overRun, 319 + tblAllocErr, 320 + qAllocErr, 321 + noColMatch, 322 + iTabPurgErr 323 + }; 324 + 325 + 326 + /* functions returning non-integral values */ 327 + pascal PixMapHandle NewPixMap(); 328 + pascal PixPatHandle NewPixPat(); 329 + pascal PixPatHandle GetPixPat(); 330 + pascal CTabHandle GetCTable(); 331 + pascal CCrsrHandle GetCCursor(); 332 + pascal CIconHandle GetCIcon(); 333 + pascal GDHandle GetMaxDevice(); 334 + pascal GDHandle GetDeviceList(); 335 + pascal GDHandle GetMainDevice(); 336 + pascal GDHandle GetNextDevice(); 337 + pascal GDHandle NewGDevice(); 338 + pascal GDHandle GetGDevice(); 339 + pascal PaletteHandle NewPalette(); 340 + pascal PaletteHandle GetNewPalette(); 341 + pascal PaletteHandle GetPalette(); 342 + 343 + 344 + /* low-memory globals */ 345 + extern char HiliteMode : 0x938; 346 + extern GDHandle MainDevice : 0x8A4; 347 + extern GDHandle DeviceList : 0x8A8; 348 + extern GDHandle TheGDevice : 0xCC8; 349 + 350 + 351 + #endif _Color_
+122
Mac #includes/ColorToolbox.h
··· 1 + 2 + /* 3 + * ColorToolbox.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _ColorToolbox_ 12 + #define _ColorToolbox_ 13 + 14 + #ifndef _Color_ 15 + #include "Color.h" 16 + #endif 17 + 18 + #ifndef _ControlMgr_ 19 + #include "ControlMgr.h" 20 + #endif 21 + 22 + 23 + /* ---------- Control Manager ---------- */ 24 + 25 + 26 + /* Constants for the colors of control parts */ 27 + 28 + enum { 29 + cFrameColor, 30 + cBodyColor, 31 + cTextColor, 32 + cThumbColor 33 + }; 34 + 35 + 36 + typedef struct CtlCTab{ 37 + long ccSeed; 38 + short ccRider; 39 + short ctSize; 40 + ColorSpec ctTable[4]; 41 + } CtlCTab, *CCTabPtr, **CCTabHandle; 42 + 43 + 44 + typedef struct AuxCtlRec{ 45 + Handle acNext; 46 + ControlHandle acOwner; 47 + CCTabHandle acCTable; 48 + short acFlags; 49 + long acReserved; 50 + long acRefCon; 51 + } AuxCtlRec, *AuxCtlPtr, **AuxCtlHndl; 52 + 53 + 54 + /* ---------- Menu Manager ---------- */ 55 + 56 + 57 + #define mctAllItems -98 58 + #define mctLastIDIndic -99 59 + 60 + 61 + typedef struct MCEntry{ 62 + short mctID; 63 + short mctItem; 64 + RGBColor mctRGB1; 65 + RGBColor mctRGB2; 66 + RGBColor mctRGB3; 67 + RGBColor mctRGB4; 68 + short mctReserved; 69 + } MCEntry, *MCEntryPtr; 70 + 71 + typedef MCEntry MCTable[1], *MCTablePtr, **MCTableHandle; 72 + 73 + 74 + /* ---------- Window Manager ---------- */ 75 + 76 + 77 + /* color table entries */ 78 + enum { 79 + wContentColor, 80 + wFrameColor, 81 + wTextColor, 82 + wHiliteColor, 83 + wTitleBarColor 84 + }; 85 + 86 + typedef struct AuxWinRec{ 87 + struct AuxWinRec **awNext; 88 + WindowPtr awOwner; 89 + CTabHandle awCTable; 90 + Handle dialogCTable; 91 + long awFlags; 92 + long awResrv; 93 + long awRefCon; 94 + } AuxWinRec, *AuxWinPtr, **AuxWinHndl; 95 + 96 + typedef struct WinCTab{ 97 + long wCSeed; 98 + short wCReserved; 99 + short ctSize; 100 + ColorSpec ctTable[5]; 101 + } WinCTab, *WCTabPtr, **WCTabHandle; 102 + 103 + 104 + /* ---------- */ 105 + 106 + 107 + /* functions returning non-integral values */ 108 + pascal WindowPtr NewCDialog(); /* DialogPtr */ 109 + pascal MCTableHandle GetMCInfo(); 110 + pascal MCEntryPtr GetMCEntry(); 111 + pascal WindowPtr NewCWindow(); 112 + pascal WindowPtr GetNewCWindow(); 113 + pascal RgnHandle GetGrayRgn(); 114 + 115 + 116 + /* low-memory globals */ 117 + extern AuxWinHndl AuxWinHead : 0xCD0; 118 + extern AuxCtlHndl AuxCtlHead : 0xCD4; 119 + extern MCTableHandle MenuCInfo : 0xD50; 120 + 121 + 122 + #endif _ColorToolbox_
+39
Mac #includes/DeskBus.h
··· 1 + 2 + /* 3 + * DeskBus.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _DeskBus_ 12 + #define _DeskBus_ 13 + 14 + #ifndef _MacTypes_ 15 + #include "MacTypes.h" 16 + #endif 17 + 18 + 19 + typedef struct ADBOpBlock{ 20 + Ptr dataBuffPtr; 21 + Ptr opServiceRtPtr; 22 + Ptr opDataAreaPtr; 23 + } ADBOpBlock, *ADBOpBPtr; 24 + 25 + typedef struct ADBDataBlock{ 26 + char devType; 27 + char origADBAddr; 28 + Ptr dbServiceRtPtr; 29 + Ptr dbDataAreaAddr; 30 + } ADBDataBlock, *ADBDBlkPtr; 31 + 32 + typedef struct ADBSetInfoBlock{ 33 + Ptr siServiceRtPtr; 34 + Ptr siDataAreaAddr; 35 + } ADBSetInfoBlock, *ADBSInfoPtr; 36 + 37 + typedef char ADBAddress; 38 + 39 + #endif _DeskBus_
+22
Mac #includes/DeskMgr.h
··· 1 + 2 + /* 3 + * DeskMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _DeskMgr_ 12 + #define _DeskMgr_ 13 + 14 + enum { 15 + undoCmd, 16 + cutCmd = 2, 17 + copyCmd, 18 + pasteCmd, 19 + clearCmd 20 + }; 21 + 22 + #endif _DeskMgr_
+82
Mac #includes/DiskDvr.h
··· 1 + 2 + /* 3 + * DiskDvr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _DiskDvr_ 12 + #define _DiskDvr_ 13 + 14 + /* positioning */ 15 + #define currPos 0 /* fsAtMark */ 16 + #define absPos 1 /* fsFromStart */ 17 + #define relPos 3 /* fsFromMark */ 18 + 19 + typedef struct DrvSts { 20 + int track; 21 + char writeProt; 22 + char diskInPlace; 23 + char installed; 24 + char sides; 25 + struct QElem *qLink; 26 + int qType; 27 + int dQDrive; 28 + int dQRefNum; 29 + int dQFSID; 30 + char twoSideFmt; 31 + char needsFlush; 32 + int diskErrs; 33 + } DrvSts; 34 + 35 + typedef struct DrvSts2 { /* HD-20 */ 36 + int track; 37 + char writeProt; 38 + char diskInPlace; 39 + char installed; 40 + char sides; 41 + struct QElem *qLink; 42 + int qType; 43 + int dQDrive; 44 + int dQRefNum; 45 + int dQFSID; 46 + int driveSize; 47 + int driveS1; 48 + int driveType; 49 + int driveManf; 50 + char driveChar; 51 + char driveMisc; 52 + } DrvSts2; 53 + 54 + /* result codes */ 55 + #define firstDskErr (-84) 56 + enum { 57 + verErr = -84, 58 + fmt2Err, 59 + fmt1Err, 60 + sectNFErr, 61 + seekErr, 62 + spdAdjErr, 63 + twoSideErr, 64 + initIWMErr, 65 + tk0BadErr, 66 + cantStepErr, 67 + wrUnderrun, 68 + badDBtSlp, 69 + badDCksum, 70 + noDtaMkErr, 71 + badBtSlpErr, 72 + badCksmErr, 73 + dataVerErr, 74 + noAdrMkErr, 75 + noNybErr, 76 + offLinErr, 77 + noDriveErr 78 + }; 79 + #define lastDskErr (-64) 80 + 81 + 82 + #endif _DiskDvr_
+186
Mac #includes/OSUtil.h
··· 1 + 2 + /* 3 + * OSUtil.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _OSUtil_ 12 + #define _OSUtil_ 13 + 14 + #ifndef _MacTypes_ 15 + #include "MacTypes.h" 16 + #endif 17 + 18 + /* result codes */ 19 + enum { 20 + prInitErr = -88, 21 + prWrErr, 22 + clkWrErr, 23 + clkRdErr, 24 + seNoDB = -8, 25 + unimpErr = -4, 26 + corErr, 27 + vTypErr, 28 + qErr 29 + }; 30 + 31 + /* queue types */ 32 + enum { 33 + vType = 1, 34 + ioQType, 35 + drvQType, 36 + evType, 37 + fsQType 38 + }; 39 + 40 + /* machine types */ 41 + enum { macXLMachine, macMachine }; 42 + 43 + /* trap types */ 44 + enum { OSTrap, ToolTrap }; 45 + 46 + /* serial port use */ 47 + enum { useFree, useATalk, useASync }; 48 + 49 + typedef struct 50 + { 51 + Byte valid; 52 + Byte aTalkA; 53 + Byte aTalkB; 54 + Byte config; 55 + int portA; 56 + int portB; 57 + long alarm; 58 + int font; 59 + int kbdPrint; 60 + int volClik; 61 + int misc; 62 + } SysParmType,* SysPPtr ; 63 + 64 + typedef struct QElem 65 + { 66 + struct QElem *qLink; 67 + int qType; 68 + char qData[]; 69 + } QElem, *QElemPtr; 70 + 71 + typedef struct QHdr 72 + { 73 + int qFlags; 74 + QElemPtr qHead; 75 + QElemPtr qTail; 76 + } QHdr,* QHdrPtr ; 77 + 78 + typedef struct 79 + { 80 + int year; 81 + int month; 82 + int day; 83 + int hour; 84 + int minute; 85 + int second; 86 + int dayOfWeek; 87 + } DateTimeRec ; 88 + 89 + 90 + enum { false32b, true32b }; 91 + 92 + 93 + /* access A5 from interrupt level */ 94 + #define SetUpA5() asm { move.l a5,-(sp) \ 95 + move.l 0x904,a5 } 96 + #define RestoreA5() asm { move.l (sp)+,a5 } 97 + 98 + 99 + /* ---------- SysEnvirons ---------- */ 100 + 101 + 102 + typedef struct SysEnvRec { 103 + short environsVersion; 104 + short machineType; 105 + short systemVersion; 106 + short processor; 107 + Boolean hasFPU; 108 + Boolean hasColorQD; 109 + short keyBoardType; 110 + short atDrvrVersNum; 111 + short sysVRefNum; 112 + } SysEnvRec; 113 + 114 + /* machine types */ 115 + enum { 116 + envXL = -2, 117 + envMac, 118 + envMachUnknown, 119 + env512KE, 120 + envMacPlus, 121 + envSE, 122 + envMacII 123 + }; 124 + 125 + /* CPU types */ 126 + enum { 127 + envCPUUnknown, 128 + env68000, 129 + env68010, 130 + env68020 131 + }; 132 + 133 + /* keyboard types */ 134 + enum { 135 + envUnknownKbd, 136 + envMacKbd, 137 + envMacAndPad, 138 + envMacPlusKbd, 139 + envAExtendKbd, 140 + envStandADBKbd 141 + }; 142 + 143 + /* error codes */ 144 + enum { 145 + envSelTooBig = -5502, 146 + envBadSel, 147 + envNotPresent 148 + }; 149 + 150 + 151 + /* ---------- Deferred Task Manager ---------- */ 152 + 153 + 154 + typedef struct DeferredTask { 155 + QElemPtr qLink; 156 + short qType; 157 + short dtFlags; 158 + ProcPtr dtAddr; 159 + long dtParm; 160 + long dtReserved; 161 + } DeferredTask; 162 + 163 + 164 + /* ---------- ShutDown Manager ---------- */ 165 + 166 + 167 + #define sdOnPowerOff 1 168 + #define sdOnRestart 2 169 + #define sdOnUnmount 4 170 + #define sdOnDrivers 8 171 + #define sdRestartOrPower (sdOnRestart+sdOnPowerOff) 172 + 173 + 174 + /* ---------- */ 175 + 176 + 177 + /* functions returning non-integral values */ 178 + pascal SysPPtr GetSysPPtr(); 179 + 180 + /* low-memory globals */ 181 + extern int SysVersion : 0x15A; 182 + extern SysParmType SysParam : 0x1F8; 183 + extern long Time : 0x20C; 184 + 185 + 186 + #endif _OSUtil_
+33
Mac #includes/PackageMgr.h
··· 1 + 2 + /* 3 + * PackageMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _PackageMgr_ 12 + #define _PackageMgr_ 13 + 14 + #ifndef _MacTypes_ 15 + #include "MacTypes.h" 16 + #endif 17 + 18 + /* package IDs */ 19 + enum { 20 + listMgr, 21 + dskInit = 2, 22 + stdFile, 23 + flPoint, 24 + trFunc, 25 + intUtil, 26 + bdConv 27 + }; 28 + 29 + /* low-memory globals */ 30 + extern Handle AppPacks[] : 0xAB8; 31 + 32 + 33 + #endif _PackageMgr_
+88
Mac #includes/SCSIMgr.h
··· 1 + 2 + /* 3 + * SCSIMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _SCSIMgr_ 12 + #define _SCSIMgr_ 13 + 14 + 15 + /* transfer instruction op codes */ 16 + enum { 17 + scInc = 1, 18 + scNoInc, 19 + scAdd, 20 + scMove, 21 + scLoop, 22 + scNop, 23 + scStop, 24 + scComp 25 + }; 26 + 27 + /* result codes */ 28 + enum { 29 + scCommErr = 2, 30 + scArbNBErr, 31 + scBadParmsErr, 32 + scPhaseErr, 33 + scCompareErr, 34 + scMgrBusyErr, 35 + scSequenceErr, 36 + scBusTOErr, 37 + scComplPhaseErr 38 + }; 39 + 40 + #define sbSIGWord 0x4552 41 + #define pMapSIG 0x504D 42 + 43 + 44 + typedef struct SCSIInstr { 45 + int scOpcode; 46 + long scParam1; 47 + long scParam2; 48 + } SCSIInstr; 49 + 50 + 51 + typedef struct Block0 { 52 + unsigned short sbSig; 53 + unsigned short sbBlkSize; 54 + unsigned long sbBlkCount; 55 + unsigned short sbDevType; 56 + unsigned short sbDevId; 57 + unsigned long sbData; 58 + unsigned short sbDrvrCount; 59 + unsigned long ddBlock; 60 + unsigned short ddSize; 61 + unsigned short ddType; 62 + unsigned short ddPad[243]; /* to make size be 512 */ 63 + }Block0; 64 + 65 + typedef struct Partition { 66 + unsigned short pmSig; 67 + unsigned short pmSigPad; 68 + unsigned long pmMapBlkCnt; 69 + unsigned long pmPyPartStart; 70 + unsigned long pmPartBlkCnt; 71 + unsigned char pmPartName[32]; 72 + unsigned char pmParType[32]; 73 + unsigned long pmLgDataStart; 74 + unsigned long pmDataCnt; 75 + unsigned long pmPartStatus; 76 + unsigned long pmLgBootStart; 77 + unsigned long pmBootSize; 78 + unsigned long pmBootAddr; 79 + unsigned long pmBootAddr2; 80 + unsigned long pmBootEntry; 81 + unsigned long pmBootEntry2; 82 + unsigned long pmBootCksum; 83 + unsigned char pmProcessor[16]; 84 + unsigned short pmPad[188]; /* to make size be 512 */ 85 + }Partition; 86 + 87 + 88 + #endif _SCSIMgr_
+288
Mac #includes/ScriptMgr.h
··· 1 + 2 + /* 3 + * ScriptMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _ScriptMgr_ 12 + #define _ScriptMgr_ 13 + 14 + 15 + #define smgrVers 0x0155 16 + 17 + 18 + /* Script interface identification numbers */ 19 + 20 + enum { 21 + smRoman, 22 + smJapanese, 23 + smChinese, 24 + smKorean, 25 + smArabic, 26 + smHebrew, 27 + smGreek, 28 + smRussian, 29 + smRSymbol, 30 + smDevanagari, 31 + smGurmukhi, 32 + smGujarati, 33 + smOriya, 34 + smBengali, 35 + smTamil, 36 + smTelugu, 37 + smKannada, 38 + smMalayalam, 39 + smSinhalese, 40 + smBurmese, 41 + smKhmer, 42 + smThai, 43 + smLaotian, 44 + smGeorgian, 45 + smArmenian, 46 + smMaldivian, 47 + smTibetan, 48 + smMongolian, 49 + smAmharic, 50 + smSlavic, 51 + smVietnamese, 52 + smSindhi, 53 + smReserved2 54 + }; 55 + 56 + /* Language Codes */ 57 + 58 + enum { 59 + langEnglish, 60 + langFrench, 61 + langGerman, 62 + langItalian, 63 + langDutch, 64 + langSwedish, 65 + langSpanish, 66 + langDanish, 67 + langPortugese, 68 + langNorwegian, 69 + langHebrew, 70 + langJapanese, 71 + langArabic, 72 + langFinish, 73 + langGreek, 74 + langIcelandic, 75 + langMalta, 76 + langTurkish, 77 + langYugoslavian, 78 + langChinese, 79 + langUrdu, 80 + langHindi, 81 + langThai 82 + }; 83 + 84 + /* Calendar Codes */ 85 + 86 + enum { 87 + calGregorian, 88 + calArabicCivil, 89 + calArabicLunar, 90 + calJapanese, 91 + calJewish, 92 + calCoptic 93 + }; 94 + 95 + /* Integer Format Codes */ 96 + 97 + enum { 98 + intWestern, 99 + intArabic, 100 + intRoman, 101 + intJapanese 102 + }; 103 + 104 + /* CharByte return values. */ 105 + 106 + enum { 107 + smFirstByte = -1, 108 + smSingleByte, 109 + smLastByte, 110 + smMiddleByte 111 + }; 112 + 113 + /* CharType field masks */ 114 + 115 + #define smcTypeMask 0x000F 116 + #define smcReserved 0x00F0 117 + #define smcClassMask 0x0F00 118 + #define smcReserved12 0x1000 119 + #define smcRightMask 0x2000 120 + #define smcUpperMask 0x4000 121 + #define smcDoubleMask 0x8000 122 + 123 + /* CharType character types. */ 124 + 125 + enum { 126 + smCharPunct, 127 + smCharAscii, 128 + smCharEuro = 7 129 + }; 130 + 131 + /* CharType punctuation types. */ 132 + 133 + #define smPunctNormal 0x0000 134 + #define smPunctNumber 0x0100 135 + #define smPunctSymbol 0x0200 136 + #define smPunctBlank 0x0300 137 + 138 + /* CharType case modifers. */ 139 + 140 + #define smCharLower 0x0000 141 + #define smCharUpper 0x4000 142 + 143 + /* CharType character size modifiers (1 or 2 bytes). */ 144 + 145 + #define smChar1byte 0x0000 146 + #define smChar2byte 0x8000 147 + 148 + 149 + /* Char2Pixel directions. */ 150 + enum { 151 + smRightCaret = -1, 152 + smLeftCaret, 153 + smHilite 154 + }; 155 + 156 + 157 + /* Transliterate target types. */ 158 + 159 + enum { 160 + smTransAscii, 161 + smTransNative 162 + }; 163 + 164 + /* Transliterate target modifiers. */ 165 + 166 + #define smTransLower 0x4000 167 + #define smTransUpper 0x8000 168 + 169 + /* Transliterate source masks. */ 170 + 171 + #define smMaskAscii 0x0001 172 + #define smMaskNative 0x0002 173 + 174 + 175 + /* Result values from GetEnvirons, SetEnvirons, GetScript and SetScript calls. */ 176 + 177 + enum { 178 + smBadScript = -2, 179 + smBadVerb, 180 + smNotInstalled 181 + }; 182 + 183 + /* GetEnvirons/SetEnvirons verbs. */ 184 + 185 + enum { 186 + smVersion = 0, 187 + smMunged = 2, 188 + smEnabled = 4, 189 + smBidirect = 6, 190 + smFontForce = 8, 191 + smIntlForce = 10, 192 + smForced = 12, 193 + smDefault = 14, 194 + smPrint = 16, 195 + smSysScript = 18, 196 + smLastScript = 20, 197 + smKeyScript = 22, 198 + smSysRef = 24, 199 + smKeyCache = 26, 200 + smKeySwap = 28 201 + }; 202 + 203 + 204 + /* GetScript/SetScript verbs. */ 205 + 206 + enum { 207 + smScriptVersion = 0, 208 + smScriptMunged = 2, 209 + smScriptEnabled = 4, 210 + smScriptRight = 6, 211 + smScriptJust = 8, 212 + smScriptRedraw = 10, 213 + smScriptSysFond = 12, 214 + smScriptAppFond = 14, 215 + smScriptBundle = 16, 216 + smScriptNumber = 16, 217 + smScriptDate = 18, 218 + smScriptSort = 20, 219 + smScriptRsvd1 = 22, 220 + smScriptRsvd2 = 24, 221 + smScriptRsvd3 = 26, 222 + smScriptRsvd4 = 28, 223 + smScriptRsvd5 = 30, 224 + smScriptKeys = 32, 225 + smScriptIcon = 34, 226 + smScriptPrint = 36, 227 + smScriptTrap = 38, 228 + smScriptCreator = 40, 229 + smScriptFile = 42, 230 + smScriptName = 44 231 + }; 232 + 233 + /* Bits in the smScriptFlags word */ 234 + 235 + enum { 236 + smsfIntellCP, 237 + smsfSingByte, 238 + smsfNatCase, 239 + smsfContext 240 + }; 241 + 242 + /* Roman script constants */ 243 + 244 + #define romanVers 1 245 + #define romanSysFond $3FFF 246 + #define romanAppFond 3 247 + 248 + /* Script Manager font equates. */ 249 + 250 + #define smFondStart $4000 251 + #define smFondEnd $C000 252 + 253 + 254 + 255 + typedef short OffsetTable[6]; 256 + 257 + typedef struct BreakTable { 258 + char charTypes[256]; 259 + short tripleLength; 260 + short triples[1]; 261 + } BreakTable, *BreakTablePtr; 262 + 263 + 264 + /* Bundle declarations */ 265 + 266 + typedef struct ItlcRecord { 267 + short itlcSystem; 268 + short itlcReserved; 269 + char itlcFontForce; 270 + char itlcIntlForce; 271 + } ItlcRecord; 272 + 273 + typedef struct ItlbRecord { 274 + short itlbNumber; 275 + short itlbDate; 276 + short itlbSort; 277 + short itlbReserved1; 278 + short itlbReserved2; 279 + short itlbReserved3; 280 + short itlbLang; 281 + char itlbNumRep; 282 + char itlbDateRep; 283 + short itlbKeys; 284 + short itlbIcon; 285 + } ItlbRecord; 286 + 287 + 288 + #endif _ScriptMgr_
+247
Mac #includes/SlotMgr.h
··· 1 + 2 + /* 3 + * SlotMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _SlotMgr_ 12 + #define _SlotMgr_ 13 + 14 + #ifndef _MacTypes_ 15 + #include "MacTypes.h" 16 + #endif 17 + 18 + #ifndef _OSUtil_ 19 + #include "OSUtil.h" 20 + #endif 21 + 22 + 23 + /* StatusFlags constants */ 24 + #define fCardIsChanged 1 25 + #define fCkForSame 0 26 + #define fCkForNext 1 27 + #define fWarmStart 2 28 + 29 + /* State constants */ 30 + enum { 31 + stateNil, 32 + stateSDMInit, 33 + statePRAMInit, 34 + statePInit, 35 + stateSInit 36 + }; 37 + 38 + 39 + /* DCE extension for slots */ 40 + 41 + typedef struct AuxDCE { 42 + Ptr dCtlDriver; /* original DCE */ 43 + short dCtlFlags; 44 + QHdr dCtlQHdr; 45 + long dCtlPosition; 46 + Handle dCtlStorage; 47 + short dCtlRefNum; 48 + long dCtlCurTicks; 49 + struct GrafPort *dCtlWindow; 50 + short dCtlDelay; 51 + short dCtlEMask; 52 + short dCtlMenu; 53 + unsigned char dCtlSlot; /* new fields */ 54 + unsigned char dCtlSlotId; 55 + long dCtlDevBase; 56 + Ptr dCtlOwner; 57 + unsigned char dCtlExtDev; 58 + unsigned char fillByte; 59 + } AuxDCE,*AuxDCEPtr,**AuxDCEHandle; 60 + 61 + 62 + /* PBs for opening slot devices */ 63 + 64 + typedef struct SlotDevParam { 65 + struct QElem *qLink; 66 + short qType; 67 + short ioTrap; 68 + Ptr ioCmdAddr; 69 + ProcPtr ioCompletion; 70 + OsErr ioResult; 71 + StringPtr ioNamePtr; 72 + short ioVRefNum; 73 + short ioRefNum; 74 + char ioVersNum; 75 + char ioPermssn; 76 + Ptr ioMix; 77 + short ioFlags; 78 + char ioSlot; 79 + char ioID; 80 + } SlotDevParam; 81 + 82 + 83 + typedef struct MultiDevParam { 84 + struct QElem *qLink; 85 + short qType; 86 + short ioTrap; 87 + Ptr ioCmdAddr; 88 + ProcPtr ioCompletion; 89 + OsErr ioResult; 90 + StringPtr ioNamePtr; 91 + short ioVRefNum; 92 + short ioRefNum; 93 + char ioVersNum; 94 + char ioPermssn; 95 + Ptr ioMix; 96 + short ioFlags; 97 + Ptr ioSEBlkPtr; 98 + } MultiDevParam; 99 + 100 + 101 + /* Device Manager Slot Support */ 102 + 103 + typedef struct SlotIntQElement{ 104 + Ptr sqLink; 105 + short sqType; 106 + short sqPrio; 107 + ProcPtr sqAddr; 108 + long sqParm; 109 + } SlotIntQElement, *SQElemPtr; 110 + 111 + 112 + /* Slot Declaration Manager */ 113 + 114 + typedef struct SpBlock{ 115 + long spResult; 116 + Ptr spsPointer; 117 + long spSize; 118 + long spOffsetData; 119 + Ptr spIOFileName; 120 + Ptr spsExecPBlk; 121 + Ptr spStackPtr; 122 + long spMisc; 123 + long spReserved; 124 + short spIOReserved; 125 + short spRefNum; 126 + short spCategory; 127 + short spCType; 128 + short spDrvrSW; 129 + short spDrvrHW; 130 + char spTBMask; 131 + char spSlot; 132 + char spID; 133 + char spExtDev; 134 + char spHwDev; 135 + char spByteLanes; 136 + char spFlags; 137 + char spKey; 138 + } SpBlock, *SpBlockPtr; 139 + 140 + typedef struct SInfoRecord{ 141 + Ptr siDirPtr; 142 + short siInitStatusA; 143 + short siInitStatusV; 144 + char siState; 145 + char siCPUByteLanes; 146 + char siTopOfROM; 147 + char siStatusFlags; 148 + short siTOConst; 149 + char siReserved[2]; 150 + } SInfoRecord, *SInfoRecPtr; 151 + 152 + 153 + typedef struct SDMRecord{ 154 + ProcPtr sdBEVSave; 155 + ProcPtr sdBusErrProc; 156 + ProcPtr sdErrorEntry; 157 + long sdReserved; 158 + } SDMRecord; 159 + 160 + 161 + typedef struct FHeaderRec{ 162 + long fhDirOffset; 163 + long fhLength; 164 + long fhCRC; 165 + char fhROMRev; 166 + char fhFormat; 167 + long fhTstPat; 168 + short fhReserved; 169 + char fhByteLanes; 170 + } FHeaderRec, *FHeaderRecPtr; 171 + 172 + 173 + typedef struct SEBlock{ 174 + char seSlot; 175 + char sesRsrcId; 176 + short seStatus; 177 + char seFlags; 178 + char seFiller0; 179 + char seFiller1; 180 + char seFiller2; 181 + long seResult; 182 + long seIOFileName; 183 + char seDevice; 184 + char sePartition; 185 + char seOSType; 186 + char seReserved; 187 + char seRefNum; 188 + char seNumDevices; 189 + char seBootState; 190 + } SEBlock; 191 + 192 + 193 + /* error codes */ 194 + 195 + enum { 196 + slotNumErr = -360, 197 + smRecNotFnd = -351, 198 + smSRTOvrFlErr, 199 + smNoGoodOpens, 200 + smOffsetErr, 201 + smByteLanesErr, 202 + smBadsPtrErr, 203 + smsGetDrvrErr, 204 + smNoMoresRsrcs, 205 + smDisDrvrNamErr, 206 + smGetDrvrNamErr, 207 + smCkStatusErr, 208 + smBlkMoveErr, 209 + smNewPErr, 210 + smSelOOBErr, 211 + smSlotOOBErr, 212 + smNilsBlockErr, 213 + smsPointerNil, 214 + smCPUErr, 215 + smCodeRevErr, 216 + smReservedErr, 217 + smBadsList, 218 + smBadRefId, 219 + smBusErrTO = -320, 220 + smBadBoardId, 221 + smNoJmpTbl, 222 + smIntTblVErr, 223 + smIntStatVErr, 224 + smNoBoardId, 225 + smGetPRErr, 226 + smNoBoardsRsrc, 227 + smDisposePErr, 228 + smFHBlkDispErr, 229 + smFHBlockRdErr, 230 + smBLFieldBad, 231 + smUnExBusErr, 232 + smResrvErr, 233 + smNosInfoArray, 234 + smLWTstBad, 235 + smNoDir, 236 + smRevisionErr, 237 + smFormatErr, 238 + smCRCFail, 239 + smEmptySlot, 240 + smPriInitErr = -293, 241 + smPRAMInitErr, 242 + smSRTInitErr, 243 + smSDMInitErr 244 + }; 245 + 246 + 247 + #endif _SlotMgr_
+138
Mac #includes/SoundMgr.h
··· 1 + 2 + /* 3 + * SoundMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _SoundMgr_ 12 + #define _SoundMgr_ 13 + 14 + #ifndef _MacTypes_ 15 + #include "MacTypes.h" 16 + #endif 17 + 18 + 19 + #define synthCodeRsrc 'snth' 20 + #define soundListRsrc 'snd ' 21 + 22 + enum { 23 + noteSynth = 2, 24 + waveTableSynth, 25 + midiSynth, 26 + sampledSynth 27 + }; 28 + 29 + #define twelfthRootTwo 1.05946309434 30 + 31 + 32 + enum { 33 + nullCmd, 34 + initCmd, 35 + freeCmd, 36 + quietCmd, 37 + flushCmd, 38 + waitCmd = 10, 39 + pauseCmd, 40 + resumeCmd, 41 + callBackCmd, 42 + syncCmd, 43 + emptyCmd, 44 + tickleCmd = 20, 45 + requestNextCmd, 46 + howOftenCmd, 47 + wakeUpCmd, 48 + availableCmd, 49 + noteCmd = 40, 50 + restCmd, 51 + freqCmd, 52 + ampCmd, 53 + timbreCmd, 54 + waveTableCmd = 60, 55 + phaseCmd, 56 + soundCmd = 80, 57 + bufferCmd, 58 + rateCmd, 59 + midiDataCmd = 100 60 + }; 61 + 62 + #define setPtrBit 0x8000 63 + #define stdQLength 128 64 + 65 + 66 + /* Error codes */ 67 + enum { 68 + badFormat = -206, 69 + badChannel, 70 + resProblem, 71 + queueFull, 72 + notEnoughHardware = -201, 73 + noHardware 74 + }; 75 + 76 + 77 + /* Wave Table Synthesizer */ 78 + #define initChanLeft 0x02 79 + #define initChanRight 0x03 80 + #define initChan0 0x04 81 + #define initChan1 0x05 82 + #define initChan2 0x06 83 + #define initChan3 0x07 84 + #define initSRate22k 0x20 85 + #define initSRate44k 0x30 86 + #define initMono 0x80 87 + #define initStereo 0xC0 88 + 89 + 90 + /*typedef long Time; /* in half milliseconds */ 91 + #define infiniteTime 0x7FFFFFFF 92 + 93 + 94 + typedef struct SndCommand { 95 + short cmd; 96 + short param1; 97 + long param2; 98 + } SndCommand; 99 + 100 + 101 + typedef struct ModifierStub { 102 + struct ModifierStub *nextStub; 103 + ProcPtr code; 104 + long userInfo; 105 + long /* Time */ count; 106 + long /* Time */ every; 107 + char flags; 108 + char hState; 109 + } ModifierStub, *ModifierStubPtr; 110 + 111 + 112 + typedef struct SndChannel { 113 + struct SndChannel *nextChan; 114 + ModifierStubPtr firstMod; 115 + ProcPtr callBack; 116 + long userInfo; 117 + long /* Time */ wait; 118 + SndCommand cmdInProgress; 119 + short flags; 120 + short qLength; 121 + short qHead; 122 + short qTail; 123 + SndCommand queue[stdQLength]; 124 + } SndChannel, *SndChannelPtr; 125 + 126 + 127 + typedef struct SoundHeader { 128 + Ptr samplePtr; 129 + long length; 130 + Fixed sampleRate; 131 + long loopStart; 132 + long loopEnd; 133 + short baseNote; 134 + char sampleArea[]; 135 + } SoundHeader, *SoundHeaderPtr; 136 + 137 + 138 + #endif _SoundMgr_
+45
Mac #includes/StartMgr.h
··· 1 + 2 + /* 3 + * StartMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _StartMgr_ 12 + #define _StartMgr_ 13 + 14 + 15 + typedef struct SlotDev{ 16 + char sdExtDevID; 17 + char sdPartition; 18 + char sdSlotNum; 19 + char sdSRsrcID; 20 + } SlotDev; 21 + 22 + typedef struct SCSIDev{ 23 + char sdReserved1; 24 + char sdReserved2; 25 + short sdRefNum; 26 + } SCSIDev; 27 + 28 + typedef union DefStartRec { 29 + SlotDev slotDev; 30 + SCSIDev scsiDev; 31 + } DefStartRec, *DefStartPtr; 32 + 33 + 34 + typedef struct DefVideoRec{ 35 + char sdSlot; 36 + char sdSResource; 37 + } DefVideoRec, *DefVideoPtr; 38 + 39 + typedef struct DefOSRec{ 40 + char sdReserved; 41 + char sdOSType; 42 + } DefOSRec, *DefOSPtr; 43 + 44 + 45 + #endif _StartMgr_
+159
Mac #includes/TextEdit.h
··· 1 + 2 + /* 3 + * TextEdit.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _TextEdit_ 12 + #define _TextEdit_ 13 + 14 + #ifndef _Quickdraw_ 15 + #include "Quickdraw.h" 16 + #endif 17 + 18 + /* justifications */ 19 + enum { teForceLeft = -2, teJustRight, teJustLeft, teJustCenter }; 20 + 21 + typedef char Chars[1], *CharsPtr, **CharsHandle; 22 + 23 + typedef struct 24 + { 25 + Rect destRect ; 26 + Rect viewRect ; 27 + Rect selRect ; 28 + int lineHeight ; 29 + int fontAscent ; 30 + Point selPoint ; 31 + int selStart ; 32 + int selEnd ; 33 + int active ; 34 + ProcPtr wordBreak ; 35 + ProcPtr clikLoop ; 36 + long clickTime ; 37 + int clickLoc ; 38 + long caretTime ; 39 + int caretState ; 40 + int just ; 41 + int teLength ; 42 + Handle hText ; 43 + int recalBack ; 44 + int recalLines; 45 + int clikStuff ; 46 + int crOnly ; 47 + int txFont ; 48 + char txFace ; 49 + int txMode ; 50 + int txSize ; 51 + GrafPtr inPort ; 52 + ProcPtr highHook ; 53 + ProcPtr caretHook ; 54 + int nLines ; 55 + int lineStarts[]; 56 + } TERec, *TEPtr, **TEHandle ; 57 + 58 + 59 + /* ---------- new TE stuff ("with style") ---------- */ 60 + 61 + 62 + #define doFont 1 63 + #define doFace 2 64 + #define doSize 4 65 + #define doColor 8 66 + #define doAll 15 67 + #define addSize 16 68 + 69 + 70 + /* avoid having to bring in all of Color Quickdraw */ 71 + typedef struct _RGBColor{ 72 + unsigned short red; 73 + unsigned short green; 74 + unsigned short blue; 75 + } _RGBColor; 76 + 77 + 78 + typedef struct StyleRun{ 79 + short startChar; 80 + short styleIndex; 81 + } StyleRun; 82 + 83 + typedef struct STElement{ 84 + short stCount; 85 + short stHeight; 86 + short stAscent; 87 + short stFont; 88 + Style stFace; 89 + short stSize; 90 + _RGBColor stColor; 91 + } STElement; 92 + 93 + typedef STElement TEStyleTable[1777], *STPtr, **STHandle; 94 + 95 + typedef struct LHElement{ 96 + short lhHeight; 97 + short lhAscent; 98 + } LHElement; 99 + 100 + typedef LHElement LHTable[8001], *LHPtr, **LHHandle; 101 + 102 + typedef struct ScrpSTElement{ 103 + long scrpStartChar; 104 + short scrpHeight; 105 + short scrpAscent; 106 + short scrpFont; 107 + Style scrpFace; 108 + short scrpSize; 109 + _RGBColor scrpColor; 110 + } ScrpSTElement; 111 + 112 + typedef ScrpSTElement ScrpSTTable[1601]; 113 + 114 + typedef struct StScrpRec{ 115 + short scrpNStyles; 116 + ScrpSTTable scrpStyleTab; 117 + } StScrpRec, *StScrpPtr, **StScrpHandle; 118 + 119 + typedef struct NullStRec{ 120 + long teReserved; 121 + StScrpHandle nullScrap; 122 + } NullStRec, *NullStPtr, **NullStHandle; 123 + 124 + typedef struct TEStyleRec{ 125 + short nRuns; 126 + short nStyles; 127 + STHandle styleTab; 128 + LHHandle lhTab; 129 + long teRefCon; 130 + NullStHandle nullStyle; 131 + StyleRun runs[8001]; 132 + } TEStyleRec, *TEStylePtr, **TEStyleHandle; 133 + 134 + typedef struct TextStyle{ 135 + short tsFont; 136 + Style tsFace; 137 + short tsSize; 138 + _RGBColor tsColor; 139 + } TextStyle; 140 + 141 + 142 + /* ---------- */ 143 + 144 + 145 + /* functions returning non-integral values */ 146 + pascal TEHandle TENew(); 147 + pascal CharsHandle TEGetText(); 148 + pascal Handle TEScrapHandle(); 149 + pascal TEHandle TEStylNew(); 150 + pascal TEStyleHandle GetStylHandle(); 151 + pascal StScrpHandle GetStylScrap(); 152 + /*pascal Point TEGetPoint(); -- actually returns a long */ 153 + 154 + /* low-memory globals */ 155 + extern int TEScrpLength : 0xAB0; 156 + extern Handle TEScrpHandle : 0xAB4; 157 + 158 + 159 + #endif _TextEdit_
+27
Mac #includes/TimeMgr.h
··· 1 + 2 + /* 3 + * TimeMgr.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _TimeMgr_ 12 + #define _TimeMgr_ 13 + 14 + #ifndef _MacTypes_ 15 + #include "MacTypes.h" 16 + #endif 17 + 18 + 19 + typedef struct TMTask { 20 + struct QElem *qLink; 21 + int qType; 22 + ProcPtr tmAddr; 23 + long tmCount; 24 + } TMTask; 25 + 26 + 27 + #endif _TimeMgr_
+428
Mac #includes/nAppletalk.h
··· 1 + 2 + /* 3 + * nAppletalk.h 4 + * 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 8 + * 9 + */ 10 + 11 + #ifndef _nAppletalk_ 12 + #define _nAppletalk_ 13 + 14 + #ifndef _Appletalk_ 15 + #include "AppleTalk.h" 16 + #endif 17 + 18 + 19 + #define xppLoadedBit 5 20 + #define xppUnitNum 40 21 + #define xppRefNum -41 22 + 23 + #define scbMemSize 0xC0 24 + 25 + #define xppFlagClr 0x00 26 + #define xppFlagSet 0x80 27 + 28 + #define atpXOvalue 32 29 + #define atpEOMvalue 16 30 + #define atpSTSvalue 8 31 + #define atpTIDValidvalue 2 32 + #define atpSendChkvalue 1 33 + 34 + 35 + /* AFP command codes */ 36 + 37 + enum { 38 + afpByteRangeLock = 1, 39 + afpVolClose, 40 + afpDirClose, 41 + afpForkClose, 42 + afpCopyFile, 43 + afpDirCreate, 44 + afpFileCreate, 45 + afpDelete, 46 + afpEnumerate, 47 + afpFlush, 48 + afpForkFlush, 49 + afpGetDirParms, 50 + afpGetFileParms, 51 + afpGetForkParms, 52 + afpGetSInfo, 53 + afpGetSParms, 54 + afpGetVolParms, 55 + afpLogin, 56 + afpContLogin, 57 + afpLogout, 58 + afpMapID, 59 + afpMapName, 60 + afpMove, 61 + afpOpenVol, 62 + afpOpenDir, 63 + afpOpenFork, 64 + afpRead, 65 + afpRename, 66 + afpSetDirParms, 67 + afpSetFileParms, 68 + afpSetForkParms, 69 + afpSetVolParms, 70 + afpWrite, 71 + afpGetFlDrParms, 72 + afpSetFlDrParms, 73 + afpDTOpen = 48, 74 + afpDTClose, 75 + afpGetIcon = 51, 76 + afpGtIcnInfo, 77 + afpAddAPPL, 78 + afpRmvAPPL, 79 + afpGetAPPL, 80 + afpAddCmt, 81 + afpRmvCmt, 82 + afpGetCmt, 83 + afpPAddIcon = 192 84 + }; 85 + 86 + 87 + /* ASP error codes */ 88 + 89 + enum { 90 + aspNoAck = -1075, 91 + aspTooMany, 92 + aspSizeErr, 93 + aspSessClosed, 94 + aspServerBusy, 95 + aspParamErr, 96 + aspNoServers, 97 + aspNoMoreSess, 98 + aspBufTooSmall, 99 + aspBadVersNum 100 + }; 101 + 102 + 103 + /* AFP error codes */ 104 + 105 + enum { 106 + afpIconTypeError = -5030, 107 + afpDirNotFound, 108 + afpCantRename, 109 + afpServerGoingDown, 110 + afpTooManyFilesOpen, 111 + afpObjectTypeErr, 112 + afpCallNotSupported, 113 + afpUserNotAuth, 114 + afpSessClosed, 115 + afpRangeOverlap, 116 + afpRangeNotLocked, 117 + afpParmErr, 118 + afpObjectNotFound, 119 + afpObjectExists, 120 + afpNoServer, 121 + afpNoMoreLocks, 122 + afpMiscErr, 123 + afpLockErr, 124 + afpItemNotFound, 125 + afpFlatVol, 126 + afpFileBusy, 127 + afpEofError, 128 + afpDiskFull, 129 + afpDirNotEmpty, 130 + afpDenyConflict, 131 + afpCantMove, 132 + afpBitmapErr, 133 + afpBadVersNum, 134 + afpBadUAM, 135 + afpAuthContinue, 136 + afpAccessDenied 137 + }; 138 + 139 + 140 + /* ---------- MPP parameter block ---------- */ 141 + 142 + 143 + typedef struct MPPParamBlock { 144 + struct QElem *qLink; 145 + short qType; 146 + short ioTrap; 147 + Ptr ioCmdAddr; 148 + ProcPtr ioCompletion; 149 + OSErr ioResult; 150 + StringPtr ioNamePtr; 151 + short ioVRefNum; 152 + short ioRefNum; 153 + short csCode; 154 + 155 + union { 156 + 157 + struct { 158 + unsigned char protType; 159 + union { 160 + Ptr wdsPointer; 161 + Ptr handler; 162 + } LAP1; 163 + } LAP; 164 + #define MPPprotType MPP.LAP.protType 165 + #define MPPwdsPointer MPP.LAP.LAP1.wdsPointer 166 + #define MPPhandler MPP.LAP.LAP1.handler 167 + 168 + struct { 169 + unsigned char socket; 170 + unsigned char checksumFlag; 171 + Ptr listener; 172 + } DDP; 173 + #define MPPsocket MPP.DDP.socket 174 + #define MPPchecksumFlag MPP.DDP.checksumFlag 175 + #define MPPlistener MPP.DDP.listener 176 + 177 + struct { 178 + unsigned char interval; 179 + unsigned char count; 180 + Ptr entityPtr; 181 + union { 182 + unsigned char verifyFlag; 183 + struct { 184 + Ptr retBuffPtr; 185 + short retBuffSize; 186 + short maxToGet; 187 + short numGotten; 188 + } NBP2; 189 + struct { 190 + AddrBlock confirmAddr; 191 + unsigned char newSocket; 192 + } NBP3; 193 + } NBP1; 194 + } NBP; 195 + #define MPPinterval MPP.NBP.interval 196 + #define MPPcount MPP.NBP.count 197 + #define MPPentityPtr MPP.NBP.entityPtr 198 + #define MPPverifyFlag MPP.NBP.NBP1.verifyFlag 199 + #define MPPretBuffPtr MPP.NBP.NBP1.NBP2.retBuffPtr 200 + #define MPPretBuffSize MPP.NBP.NBP1.NBP2.retBuffSize 201 + #define MPPmaxToGet MPP.NBP.NBP1.NBP2.maxToGet 202 + #define MPPnumGotten MPP.NBP.NBP1.NBP2.numGotten 203 + #define MPPconfirmAddr MPP.NBP.NBP1.NBP3.confirmAddr 204 + #define MPPnewSocket MPP.NBP.NBP1.NBP3.newSocket 205 + 206 + struct { 207 + unsigned char newSelfFlag; 208 + unsigned char oldSelfFlag; 209 + } SSS; 210 + #define MPPnewSelfFlag MPP.SSS.newSelfFlag 211 + #define MPPoldSelfFlag MPP.SSS.oldSelfFlag 212 + 213 + Ptr nKillQEl; 214 + #define MPPnKillQEl MPP.nKillQEl 215 + 216 + } MPP; 217 + } MPPParamBlock, *MPPPBptr; 218 + 219 + 220 + /* for MPW C compatibility */ 221 + #define MPPioCompletion ioCompletion 222 + #define MPPioResult ioResult 223 + #define MPPioRefNum ioRefNum 224 + #define MPPcsCode csCode 225 + #define LAPprotType MPPprotType 226 + #define LAPwdsPointer MPPwdsPointer 227 + #define LAPhandler MPPhandler 228 + #define DDPsocket MPPsocket 229 + #define DDPchecksumFlag MPPchecksumFlag 230 + #define DDPwdsPointer MPPwdsPointer 231 + #define DDPlistener MPPlistener 232 + #define NBPinterval MPPinterval 233 + #define NBPcount MPPcount 234 + #define NBPntQElPtr MPPentityPtr 235 + #define NBPentityPtr MPPentityPtr 236 + #define NBPverifyFlag MPPverifyFlag 237 + #define NBPretBuffPtr MPPretBuffPtr 238 + #define NBPretBuffSize MPPretBuffSize 239 + #define NBPmaxToGet MPPmaxToGet 240 + #define NBPnumGotten MPPnumGotten 241 + #define NBPconfirmAddr MPPconfirmAddr 242 + #define NBPnewSocket MPPnewSocket 243 + #define NBPnKillQEl MPPnKillQEl 244 + 245 + 246 + typedef struct WDSElement 247 + { 248 + short entrylength; 249 + Ptr entryPtr; 250 + } WDSElement; 251 + 252 + typedef struct NamesTableEntry 253 + { 254 + Ptr qNext; 255 + AddrBlock nteAddress; 256 + char filler; 257 + char entityData[99]; 258 + } NamesTableEntry; 259 + 260 + 261 + /* ---------- ATP parameter block ---------- */ 262 + 263 + 264 + typedef struct ATPParamBlock { 265 + struct QElem *qLink; 266 + short qType; 267 + short ioTrap; 268 + Ptr ioCmdAddr; 269 + ProcPtr ioCompletion; 270 + OSErr ioResult; 271 + long userData; 272 + short reqTID; 273 + short ioRefNum; 274 + short csCode; 275 + 276 + unsigned char atpSocket; 277 + unsigned char atpFlags; 278 + AddrBlock addrBlock; 279 + short reqLength; 280 + Ptr reqPointer; 281 + Ptr bdsPointer; 282 + 283 + union { 284 + 285 + struct { 286 + unsigned char numOfBuffs; 287 + unsigned char timeOutVal; 288 + unsigned char numOfResps; 289 + unsigned char retryCount; 290 + short intBuff; 291 + } ATP1; 292 + #define ATPnumOfBuffs ATP.ATP1.numOfBuffs 293 + #define ATPtimeOutVal ATP.ATP1.timeOutVal 294 + #define ATPnumOfResps ATP.ATP1.numOfResps 295 + #define ATPretryCount ATP.ATP1.retryCount 296 + #define ATPintBuff ATP.ATP1.intBuff 297 + 298 + struct { 299 + unsigned char filler; 300 + unsigned char bdsSize; 301 + short transID; 302 + } ATP2; 303 + #define ATPbdsSize ATP.ATP2.bdsSize 304 + #define ATPtransID ATP.ATP2.transID 305 + 306 + unsigned char bitMap; 307 + #define ATPbitMap ATP.bitMap 308 + 309 + unsigned char rspNum; 310 + #define ATPrspNum ATP.rspNum 311 + 312 + Ptr aKillQEl; 313 + #define ATPaKillQEl ATP.aKillQEl 314 + 315 + } ATP; 316 + } ATPParamBlock, *ATPPBptr; 317 + 318 + 319 + /* for MPW C compatibility */ 320 + #define ATPioCompletion ioCompletion 321 + #define ATPioResult ioResult 322 + #define ATPuserData userData 323 + #define ATPreqTID reqTID 324 + #define ATPioRefNum ioRefNum 325 + #define ATPcsCode csCode 326 + #define ATPatpSocket atpSocket 327 + #define ATPatpFlags atpFlags 328 + #define ATPaddrBlock addrBlock 329 + #define ATPreqLength reqLength 330 + #define ATPreqPointer reqPointer 331 + #define ATPbdsPointer bdsPointer 332 + 333 + 334 + /* ---------- XPP parameter block ---------- */ 335 + 336 + 337 + typedef struct XPPParamBlock { 338 + struct QElem *qLink; 339 + short qType; 340 + short ioTrap; 341 + Ptr ioCmdAddr; 342 + ProcPtr ioCompletion; 343 + OSErr ioResult; 344 + long cmdResult; 345 + short ioVRefNum; 346 + short ioRefNum; 347 + short csCode; 348 + 349 + union { 350 + 351 + Ptr abortSCBPtr; 352 + #define XPPabortSCBPtr XPP.abortSCBPtr 353 + 354 + struct { 355 + short aspMaxCmdSize; 356 + short aspQuantumSize; 357 + short numSesss; 358 + } XPP1; 359 + #define XPPaspMaxCmdSize XPP.XPP1.aspMaxCmdSize 360 + #define XPPaspQuantumSize XPP.XPP1.aspQuantumSize 361 + #define XPPnumSesss XPP.XPP1.numSesss 362 + 363 + struct { 364 + short sessRefnum; 365 + unsigned char aspTimeout; 366 + unsigned char aspRetry; 367 + union { 368 + struct { 369 + AddrBlock serverAddr; 370 + Ptr scbPointer; 371 + Ptr attnRoutine; 372 + } XPP2; 373 + struct { 374 + short cbSize; 375 + Ptr cbPtr; 376 + short rbSize; 377 + Ptr rbPtr; 378 + union { 379 + struct { 380 + AddrBlock afpAddrBlock; 381 + Ptr afpSCBPtr; 382 + Ptr afpAttnRoutine; 383 + } XPP3; 384 + struct { 385 + short wdSize; 386 + Ptr wdPtr; 387 + unsigned char ccbStart[296]; 388 + } XPP4; 389 + } XPP5; 390 + } XPP6; 391 + } XPP7; 392 + } XPP8; 393 + #define XPPsessRefnum XPP.XPP8.sessRefnum 394 + #define XPPaspTimeout XPP.XPP8.aspTimeout 395 + #define XPPaspRetry XPP.XPP8.aspRetry 396 + #define XPPserverAddr XPP.XPP8.XPP7.XPP2.serverAddr 397 + #define XPPscbPointer XPP.XPP8.XPP7.XPP2.scbPointer 398 + #define XPPattnRoutine XPP.XPP8.XPP7.XPP2.attnRoutine 399 + #define XPPcbSize XPP.XPP8.XPP7.XPP6.cbSize 400 + #define XPPcbPtr XPP.XPP8.XPP7.XPP6.cbPtr 401 + #define XPPrbSize XPP.XPP8.XPP7.XPP6.rbSize 402 + #define XPPrbPtr XPP.XPP8.XPP7.XPP6.rbPtr 403 + #define XPPafpAddrBlock XPP.XPP8.XPP7.XPP6.XPP5.XPP3.afpAddrBlock 404 + #define XPPafpSCBPtr XPP.XPP8.XPP7.XPP6.XPP5.XPP3.afpSCBPtr 405 + #define XPPafpAttnRoutine XPP.XPP8.XPP7.XPP6.XPP5.XPP3.afpAttnRoutine 406 + #define XPPwdSize XPP.XPP8.XPP7.XPP6.XPP5.XPP4.wdSize 407 + #define XPPwdPtr XPP.XPP8.XPP7.XPP6.XPP5.XPP4.wdPtr 408 + #define XPPccbStart XPP.XPP8.XPP7.XPP6.XPP5.XPP4.ccbStart 409 + 410 + } XPP; 411 + } XPPParamBlock, *XPPParmBlkPtr; 412 + 413 + 414 + /* ---------- AFP command block ---------- */ 415 + 416 + 417 + typedef struct AFPCommandBlock { 418 + unsigned char cmdByte; 419 + unsigned char startEndFlag; 420 + short forkRefNum; 421 + long rwOffset; 422 + long reqCount; 423 + unsigned char newLineFlag; 424 + char newLineChar; 425 + } AFPCommandBlock; 426 + 427 + 428 + #endif _nAppletalk_
+8
Mac #includes/pascal.h
··· 1 + 2 + pascal void CallPascal(...); 3 + pascal char CallPascalB(...); 4 + pascal int CallPascalW(...); 5 + pascal long CallPascalL(...); 6 + 7 + char *CtoPstr(char *); 8 + char *PtoCstr(char *);
+3 -4
headers/Appletalk.h Mac #includes/Appletalk.h
··· 2 2 /* 3 3 * Appletalk.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10
+8 -9
headers/ControlMgr.h Mac #includes/ControlMgr.h
··· 2 2 /* 3 3 * ControlMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 13 12 #define _ControlMgr_ 14 13 15 14 #ifndef _MacTypes_ 16 - #include "MacTypes.h" /* needs Mactypes.h */ 15 + #include "MacTypes.h" 17 16 #endif 18 17 19 18 #ifndef _WindowMgr_ 20 - #include "WindowMgr.h" /* needs WindowMgr.h */ 19 + #include "WindowMgr.h" 21 20 #endif 22 21 23 22 /* control messages */ ··· 64 63 struct ControlRecord ** nextControl ; 65 64 WindowPtr contrlOwner ; 66 65 Rect contrlRect ; 67 - char contrlVis ; 68 - char contrlHilite ; 66 + Byte contrlVis ; 67 + Byte contrlHilite ; 69 68 int contrlValue ; 70 69 int contrlMin ; 71 70 int contrlMax ; ··· 84 83 pascal ControlHandle GetNewControl(); 85 84 pascal ProcPtr GetCtlAction(); 86 85 87 - #endif 86 + #endif _ControlMgr_
-23
headers/DeskMgr.h
··· 1 - 2 - /* 3 - * DeskMgr.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 9 - * 10 - */ 11 - 12 - #ifndef _DeskMgr_ 13 - #define _DeskMgr_ 14 - 15 - enum { 16 - undoCmd, 17 - cutCmd = 2, 18 - copyCmd, 19 - pasteCmd, 20 - clearCmd 21 - }; 22 - 23 - #endif
+30 -9
headers/DeviceMgr.h Mac #includes/DeviceMgr.h
··· 2 2 /* 3 3 * DeviceMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 34 33 int ioVRefNum; 35 34 int ioRefNum; 36 35 int csCode; 37 - int csParam[]; 38 - } cntrlParam; 36 + int csParam[11]; 37 + } cntrlParam, CntrlParam; 38 + #define ioCRefNum ioRefNum 39 39 40 40 /* csCode */ 41 41 enum { ··· 91 91 92 92 /* result codes */ 93 93 enum { 94 - notOpenErr = -28, 94 + dceExtErr = -30, 95 + unitTblFullErr, 96 + notOpenErr, 95 97 abortErr, 96 98 dInstErr, 97 99 dRemovErr, ··· 107 109 108 110 /* chooser interface */ 109 111 enum { 110 - chooserID, /* caller value for chooser */ 112 + chooserID = 1, /* caller value for chooser */ 111 113 newSelMsg = 12, /* message values */ 112 114 fillListMsg, 113 115 getSelMsg, ··· 117 119 buttonMsg = 19 118 120 }; 119 121 122 + /* cdev message types */ 123 + enum { 124 + initDev, 125 + hitDev, 126 + closeDev, 127 + nulDev, 128 + updateDev, 129 + activDev, 130 + deactivDev, 131 + keyEvtDev, 132 + macDev 133 + }; 134 + 135 + /* cdev error codes */ 136 + #define cdevGenErr (-1) 137 + #define cdevMemErr 0 138 + #define cdevResErr 1 139 + #define cdevUnset 3 140 + 120 141 121 142 /* functions returning non-integral values */ 122 143 pascal DCtlHandle GetDCtlEntry(); ··· 133 154 extern ProcPtr ExtStsDT[] : 0x2BE; 134 155 135 156 136 - #endif _DeviceMgr_ 157 + #endif _DeviceMgr_
+4 -5
headers/DialogMgr.h Mac #includes/DialogMgr.h
··· 2 2 /* 3 3 * DialogMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 114 113 /* low-memory globals */ 115 114 extern ProcPtr ResumeProc : 0xA8C; 116 115 117 - #endif 116 + #endif _DialogMgr_
-62
headers/DiskDvr.h
··· 1 - 2 - /* 3 - * DiskDvr.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 9 - * 10 - */ 11 - 12 - #ifndef _DiskDvr_ 13 - #define _DiskDvr_ 14 - 15 - /* positioning */ 16 - #define currPos 0 /* fsAtMark */ 17 - #define absPos 1 /* fsFromStart */ 18 - #define relPos 3 /* fsFromMark */ 19 - 20 - typedef struct 21 - { 22 - int track; 23 - char writeProt; 24 - char diskInPlace; 25 - char installed; 26 - char sides; 27 - struct QElem *qLink; 28 - int qType; 29 - int dQDrive; 30 - int dQRefNum; 31 - int dQFSID; 32 - char twoSideFmt; 33 - char needsFlush; 34 - int diskErrs; 35 - } DrvSts; 36 - 37 - /* result codes */ 38 - #define firstDskErr (-84) 39 - enum { 40 - sectNFErr = -81, 41 - seekErr, 42 - spdAdjErr, 43 - twoSideErr, 44 - initIWMErr, 45 - tk0BadErr, 46 - cantStepErr, 47 - wrUnderrun, 48 - badDBtSlp, 49 - badDCksum, 50 - noDtaMkErr, 51 - badBtSlpErr, 52 - badCksmErr, 53 - dataVerErr, 54 - noAdrMkErr, 55 - noNybErr, 56 - offLinErr, 57 - noDriveErr 58 - }; 59 - #define lastDskErr (-64) 60 - 61 - 62 - #endif
+6 -5
headers/EventMgr.h Mac #includes/EventMgr.h
··· 2 2 /* 3 3 * EventMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 39 38 /* masks for keyboard event message */ 40 39 #define charCodeMask 0x000000FFL 41 40 #define keyCodeMask 0x0000FF00L 41 + #define adbAddrMask 0x00FF0000L 42 42 43 43 /* event masks */ 44 44 #define mDownMask 0x2 ··· 66 66 #define shiftKey 0x0200 67 67 #define alphaLock 0x0400 68 68 #define optionKey 0x0800 69 + #define controlKey 0x1000 69 70 70 71 71 72 /* results returned by PostEvent */ ··· 117 118 extern char ScrDmpEnb : 0x2F8; 118 119 119 120 120 - #endif 121 + #endif _EventMgr_
+6 -6
headers/FileMgr.h Mac #includes/FileMgr.h
··· 2 2 /* 3 3 * FileMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 49 48 /* result codes */ 50 49 enum { 51 50 fsDSIntErr = -127, 52 - wrgVolTypErr = -123, 51 + volGoneErr = -124, 52 + wrgVolTypErr, 53 53 badMovErr, 54 54 tmwdoErr, 55 55 dirNFErr, ··· 232 232 extern struct QHdr FSQHdr : 0x360; 233 233 234 234 235 - #endif 235 + #endif _FileMgr_
+14 -15
headers/FontMgr.h Mac #includes/FontMgr.h
··· 2 2 /* 3 3 * FontMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 65 64 { 66 65 int errNum ; 67 66 Handle fontHandle ; 68 - char bold ; 69 - char italic ; 70 - char ulOffset ; 71 - char ulShadow ; 72 - char ulThick ; 73 - char shadow ; 67 + Byte bold ; 68 + Byte italic ; 69 + Byte ulOffset ; 70 + Byte ulShadow ; 71 + Byte ulThick ; 72 + Byte shadow ; 74 73 SignedByte extra ; 75 - char ascent ; 76 - char descent ; 77 - char widMax ; 74 + Byte ascent ; 75 + Byte descent ; 76 + Byte widMax ; 78 77 SignedByte leading ; 79 - char unused ; 78 + Byte unused ; 80 79 Point numer ; 81 80 Point denom ; 82 81 } FMOutput ; ··· 167 166 extern FamRec **LastFOND : 0xBC2; 168 167 169 168 170 - #endif 169 + #endif _FontMgr_
+4 -5
headers/HFS.h Mac #includes/HFS.h
··· 2 2 /* 3 3 * HFS.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1986. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 265 264 extern HFSDefaults *FmtDefaults : 0x39E; 266 265 267 266 268 - #endif 267 + #endif _HFS_
+25 -17
headers/IntlPkg.h Mac #includes/IntlPkg.h
··· 2 2 /* 3 3 * IntlPkg.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 22 21 #define currTrailingZ 64 23 22 #define currLeadingZ 128 24 23 25 - enum { mdy, dmy, ymd }; 24 + enum { mdy, dmy, ymd, myd, dym, ydm }; 26 25 27 26 #define century 128 28 27 #define mntLdingZ 64 ··· 31 30 #define hrLeadingZ 128 32 31 #define minLeadingZ 64 33 32 #define secLeadingZ 32 33 + 34 + #define zeroCycle 1 35 + 36 + enum { longDay, longWeek, longMonth, longYear }; 37 + 38 + #define supDay 1 39 + #define supWeek 2 40 + #define supMonth 4 41 + #define supYear 8 34 42 35 43 enum { 36 44 verUS, ··· 70 78 char currSym1; 71 79 char currSym2; 72 80 char currSym3; 73 - char currFmt ; 74 - char dateOrder; 75 - char shortDateFmt; 81 + Byte currFmt ; 82 + Byte dateOrder; 83 + Byte shrtDateFmt; 76 84 char dateSep ; 77 - char timeCycle; 78 - char timeFmt ; 85 + Byte timeCycle; 86 + Byte timeFmt ; 79 87 char mornStr[4]; 80 88 char eveStr[4]; 81 89 char timeSep; ··· 87 95 char time6Suff; 88 96 char time7Suff; 89 97 char time8Suff; 90 - char metricSys; 98 + Byte metricSys; 91 99 int Intl0Vers; 92 100 } Intl0Rec,* Intl0Ptr,** Intl0Hndl ; 93 101 ··· 95 103 { 96 104 char days[7][16]; 97 105 char months[12][16]; 98 - char suppressDay; 99 - char longDateFmt; 100 - char dayleading0; 101 - char abbrLen; 102 - char st0[4]; /* check to see if these should be long */ 106 + Byte suppressDay; 107 + Byte lngDateFmt; 108 + Byte dayleading0; 109 + Byte abbrLen; 110 + char st0[4]; 103 111 char st1[4]; 104 112 char st2[4]; 105 113 char st3[4]; ··· 116 124 pascal Handle IUGetIntl(); 117 125 118 126 119 - #endif 127 + #endif _IntlPkg_
+4 -5
headers/ListMgr.h Mac #includes/ListMgr.h
··· 2 2 /* 3 3 * ListMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1986. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 71 70 /*pascal Cell LLastClick(); -- actually returns a long */ 72 71 73 72 74 - #endif 73 + #endif _ListMgr_
+4 -5
headers/MacTypes.h Mac #includes/MacTypes.h
··· 2 2 /* 3 3 * MacTypes.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 53 52 extern int ROM85 : 0x28E; 54 53 55 54 56 - #endif 55 + #endif _MacTypes_
-41
headers/MacinTalk.h
··· 1 - /* 2 - * MacinTalk.h 3 - * 4 - * Copyright (c) 1986 THINK Technologies, Inc. 5 - * These interfaces are based on information published by Apple Computer. 6 - * 7 - */ 8 - 9 - #ifndef _MacTypes_ 10 - #include "MacTypes.h" 11 - #endif 12 - 13 - typedef int SpeechErr; 14 - 15 - typedef char SpeechRecord[100]; 16 - 17 - typedef SpeechRecord *SpeechPointer, **SpeechHandle; 18 - 19 - typedef enum { Male, Female } Sex; 20 - 21 - typedef enum { Natural, Robotic, NoChange } FOMode; 22 - 23 - typedef enum { xEnglish, French, Spanish, German, Italian } Language; 24 - 25 - typedef struct { 26 - Sex theSex; 27 - Language theLanguage; 28 - int theRate; 29 - int thePitch; 30 - FOMode theMode; 31 - Str255 theName; 32 - long refCon; 33 - } VoiceRecord, *VoicePtr; 34 - 35 - pascal SpeechErr SpeechOn(); 36 - pascal void SpeechOff(); 37 - pascal void SpeechRate(); 38 - pascal void SpeechPitch(); 39 - pascal void SpeechSex(); 40 - pascal int Reader(); 41 - pascal int MacinTalk();
+11 -7
headers/MemoryMgr.h Mac #includes/MemoryMgr.h
··· 2 2 /* 3 3 * MemoryMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 23 22 /* result codes */ 24 23 enum { 25 24 memLockedErr = -117, 26 - memPurErr = -112, 25 + memSCErr, 26 + memBCErr, 27 + memPCErr, 28 + memAZErr, 29 + memPurErr, 27 30 memWZErr, 28 - nilHandleErr = -109, 31 + memAdrErr, 32 + nilHandleErr, 29 33 memFullErr, 30 34 memROZErr = -99 31 35 }; ··· 81 85 extern Ptr CurStackBase : 0x908; 82 86 83 87 84 - #endif 88 + #endif _MemoryMgr_
+14 -5
headers/MenuMgr.h Mac #includes/MenuMgr.h
··· 2 2 /* 3 3 * MenuMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 33 32 /* MDEF id */ 34 33 #define textMenuProc 0 35 34 35 + /* hierarchical and pop-up menus */ 36 + #define hMenuCmd 0x1B 37 + #define hierMenu -1 38 + #define mPopUpMsg 4 39 + 40 + 36 41 typedef struct 37 42 { 38 43 int menuID; ··· 52 57 pascal MenuHandle GetMHandle(); 53 58 54 59 /* low-memory globals */ 60 + extern int TopMenuItem : 0xA0A; 61 + extern int AtMenuBottom : 0xA0C; 55 62 extern Handle MenuList : 0xA1C; 56 63 extern int MBarEnable : 0xA20; 57 64 extern int MenuFlash : 0xA24; 58 65 extern int TheMenu : 0xA26; 59 66 extern ProcPtr MBarHook : 0xA2C; 60 67 extern ProcPtr MenuHook : 0xA30; 68 + extern long MenuDisable : 0xB54; 69 + extern int MBarHeight : 0xBAA; 61 70 62 71 63 - #endif 72 + #endif _MenuMgr_
-103
headers/OSUtil.h
··· 1 - 2 - /* 3 - * OSUtil.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 9 - * 10 - */ 11 - 12 - #ifndef _OSUtil_ 13 - #define _OSUtil_ 14 - 15 - #ifndef _MacTypes_ 16 - #include "MacTypes.h" 17 - #endif 18 - 19 - /* result codes */ 20 - enum { 21 - prInitErr = -88, 22 - prWrErr, 23 - clkWrErr, 24 - clkRdErr, 25 - vTypErr = -2, 26 - qErr 27 - }; 28 - 29 - /* queue types */ 30 - enum { 31 - vType = 1, 32 - ioQType, 33 - drvType, 34 - evType, 35 - fsQType 36 - }; 37 - 38 - /* machine types */ 39 - enum { macXLMachine, macMachine }; 40 - 41 - /* trap types */ 42 - enum { OSTrap, ToolTrap }; 43 - 44 - /* serial port use */ 45 - enum { useFree, useATalk, useAsync }; 46 - 47 - typedef struct 48 - { 49 - char valid; 50 - char aTalkA; 51 - char aTalkB; 52 - char config; 53 - int portA; 54 - int portB; 55 - long alarm; 56 - int font; 57 - int kbdPrint; 58 - int volClik; 59 - int misc; 60 - } SysParmType,* SysPPtr ; 61 - 62 - typedef struct QElem 63 - { 64 - struct QElem *qLink; 65 - int qType; 66 - char qData[]; 67 - } QElem, *QElemPtr; 68 - 69 - typedef struct QHdr 70 - { 71 - int qFlags; 72 - QElemPtr qHead; 73 - QElemPtr qTail; 74 - } QHdr,* QHdrPtr ; 75 - 76 - typedef struct 77 - { 78 - int year; 79 - int month; 80 - int day; 81 - int hour; 82 - int minute; 83 - int second; 84 - int dayOfWeek; 85 - } DateTimeRec ; 86 - 87 - 88 - /* access A5 from interrupt level */ 89 - #define SetUpA5() asm { move.l a5,-(sp) \ 90 - move.l 0x904,a5 } 91 - #define RestoreA5() asm { move.l (sp)+,a5 } 92 - 93 - 94 - /* functions returning non-integral values */ 95 - pascal SysPPtr GetSysPPtr(); 96 - 97 - /* low-memory globals */ 98 - extern int SysVersion : 0x15A; 99 - extern SysParmType SysParam : 0x1F8; 100 - extern long Time : 0x20C; 101 - 102 - 103 - #endif
-36
headers/PackageMgr.h
··· 1 - 2 - /* 3 - * PackageMgr.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 9 - * 10 - */ 11 - 12 - #ifndef _PackageMgr_ 13 - #define _PackageMgr_ 14 - 15 - #ifndef _MacTypes_ 16 - #include "MacTypes.h" 17 - #endif 18 - 19 - /* package IDs */ 20 - enum { 21 - listMgr, 22 - dskInit = 2, 23 - stdFile, 24 - flPoint, 25 - trFunc, 26 - intUtil, 27 - bdConv 28 - }; 29 - 30 - /* low-memory globals */ 31 - extern Handle AppPacks[] : 0xAB8; 32 - 33 - 34 - #endif 35 - 36 -
+85 -7
headers/PrintMgr.h Mac #includes/PrintMgr.h
··· 2 2 /* 3 3 * PrintMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985; and on the Public Toolbox Interface 9 - * Source Code, copyright (c) 1985 Apple Computer, licensed 10 - * to THINK Technologies by Apple Computer. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 11 8 * 12 9 */ 13 10 ··· 40 37 #define lPrEvtTop 0x0001FFFD 41 38 #define iPrDevCtl 7 42 39 #define lPrReset 0x00010000 40 + #define lPrDocOpen 0x00010000 43 41 #define lPrPageEnd 0x00020000 42 + #define lPrPageClose 0x00020000 44 43 #define lPrLineFeed 0x00030000 44 + #define lPrLFStd 0x0003FFFF 45 45 #define lPrLFSixth 0x0003FFFF 46 46 #define lPrLFEighth 0x0003FFFE 47 + #define lPrPageOpen 0x00040000 48 + #define lPrDocClose 0x00050000 47 49 #define iFMgrCtl 8 50 + #define iMscCtl 9 51 + #define iPvtCtl 10 48 52 49 53 /* result codes */ 50 54 #define iPrSavPFil (-1) ··· 52 56 #define iMemFullErr (-108) 53 57 #define iPrAbort 128 54 58 59 + /* PrGeneral constants */ 60 + enum { 61 + getRslDataOp = 4, 62 + setRslOp, 63 + draftBitsOp, 64 + noDraftBitsOp, 65 + getRotnOp 66 + }; 67 + #define noSuchRsl 1 68 + #define rgType1 1 69 + 55 70 /* other constants */ 56 71 #define sPrDrvr "\p.Print" 57 72 #define iPrDrvrRef (-3) ··· 129 144 TPrInfo prInfoPT; 130 145 TPrXInfo prXInfo; 131 146 TPrJob prJob; 132 - int printX[19]; 147 + int printX[/*19*/]; 148 + unsigned : 14, fLstPgFst : 1, fUserScale : 1; 149 + int iZoomMin; 150 + int iZoomMax; 151 + StringHandle hDocName; 152 + int pad[14]; /* to 120 bytes */ 133 153 } TPrint, *TPPrint, **THPrint; 134 154 135 155 typedef struct TPrStatus { ··· 171 191 } TPrDlg, *TPPrDlg; 172 192 173 193 194 + /* typedefs useful for PrGeneral */ 195 + 196 + typedef struct TGnlData { 197 + int iOpCode; 198 + int iError; 199 + long lReserved; 200 + /* more fields here, depending on particular call */ 201 + } TGnlData; 202 + 203 + typedef struct TRslRg { 204 + int iMin; 205 + int iMax; 206 + } TRslRg; 207 + 208 + typedef struct TRslRec { 209 + int iXRsl; 210 + int iYRsl; 211 + } TRslRec; 212 + 213 + typedef struct TGetRslBlk { 214 + int iOpCode; 215 + int iError; 216 + long lReserved; 217 + int iRgType; 218 + TRslRg xRslRg; 219 + TRslRg yRslRg; 220 + int iRslRecCnt; 221 + TRslRec rgRslRec[27]; 222 + } TGetRslBlk; 223 + 224 + typedef struct TSetRslBlk { 225 + int iOpCode; 226 + int iError; 227 + long lReserved; 228 + THPrint hPrint; 229 + int iXRsl; 230 + int iYRsl; 231 + } TSetRslBlk; 232 + 233 + typedef struct TDftBitsBlk { 234 + int iOpCode; 235 + int iError; 236 + long lReserved; 237 + THPrint hPrint; 238 + } TDftBitsBlk; 239 + 240 + typedef struct TGetRotnBlk { 241 + int iOpCode; 242 + int iError; 243 + long lReserved; 244 + THPrint hPrint; 245 + Boolean fLandscape; 246 + char bXtra; 247 + } TGetRotnBlk; 248 + 249 + 174 250 /* functions returning non-integral values */ 175 251 pascal TPPrPort PrOpenDoc(); 176 252 pascal Handle PrDrvrDCE(); 253 + pascal TPPrDlg PrStlInit(); 254 + pascal TPPrDlg PrJobInit(); 177 255 178 256 /* low-memory globals */ 179 257 extern int PrintErr : 0x944;
+4 -5
headers/Quickdraw.h Mac #includes/Quickdraw.h
··· 2 2 /* 3 3 * Quickdraw.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 203 202 extern Rect CrsrPin : 0x834; 204 203 205 204 206 - #endif 205 + #endif _Quickdraw_
+5 -5
headers/ResourceMgr.h Mac #includes/ResourceMgr.h
··· 2 2 /* 3 3 * ResourceMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 50 49 pascal Handle Get1Resource(); 51 50 pascal Handle Get1IndResource(); 52 51 pascal Handle Get1NamedResource(); 52 + pascal Handle RGetResource(); 53 53 54 54 /* low-memory globals */ 55 55 extern Handle TopMapHndl : 0xA50; ··· 63 63 extern int RomMapInsert : 0xB9E; 64 64 65 65 66 - #endif 66 + #endif _ResourceMgr_
-44
headers/SCSIMgr.h
··· 1 - 2 - /* 3 - * SCSIMgr.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1986. 9 - * 10 - */ 11 - 12 - #ifndef _SCSIMgr_ 13 - #define _SCSIMgr_ 14 - 15 - 16 - /* transfer instruction op codes */ 17 - enum { 18 - scInc = 1, 19 - scNoInc, 20 - scAdd, 21 - scMove, 22 - scLoop, 23 - scNop, 24 - scStop, 25 - scComp 26 - }; 27 - 28 - /* result codes */ 29 - enum { 30 - scCommErr = 2, 31 - scBadParmsErr = 4, 32 - scPhaseErr, 33 - scCompareErr 34 - }; 35 - 36 - 37 - typedef struct SCSIInstr { 38 - int scOpcode; 39 - long scParam1; 40 - long scParam2; 41 - } SCSIInstr; 42 - 43 - 44 - #endif
+4 -5
headers/ScrapMgr.h Mac #includes/ScrapMgr.h
··· 2 2 /* 3 3 * ScrapMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 37 36 extern ScrapStuff ScrapInfo : 0x960; 38 37 39 38 40 - #endif 39 + #endif _ScrapMgr_
+4 -5
headers/SegmentLdr.h Mac #includes/SegmentLdr.h
··· 2 2 /* 3 3 * SegmentLdr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 35 34 extern Handle AppParmHandle : 0xAEC; 36 35 37 36 38 - #endif 37 + #endif _SegmentLdr_
+9 -6
headers/SerialDvr.h Mac #includes/SerialDvr.h
··· 2 2 /* 3 3 * SerialDvr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 29 28 #define stop10 16384 30 29 #define stop15 ((int) -32768) 31 30 #define stop20 (-16384) 32 - #define noParity 8192 31 + #define noParity 0 33 32 #define oddParity 4096 34 33 #define evenParity 12288 35 34 #define data5 0 ··· 58 57 #define BinRefNum -8 59 58 #define BoutRefNum -9 60 59 60 + /* errors */ 61 + #define rcvrErr -89 62 + #define breakRecd -90 63 + 61 64 62 65 typedef struct 63 66 { ··· 83 86 } SerStaRec ; 84 87 85 88 86 - #endif 89 + #endif _SerialDvr_
+4 -5
headers/SoundDvr.h Mac #includes/SoundDvr.h
··· 2 2 /* 3 3 * SoundDvr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 71 70 extern char SdVolume : 0x260; 72 71 73 72 74 - #endif 73 + #endif _SoundDvr_
+4 -5
headers/StdFilePkg.h Mac #includes/StdFilePkg.h
··· 2 2 /* 3 3 * StdFilePkg.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 52 51 extern long CurDirStore : 0x398; 53 52 54 53 55 - #endif 54 + #endif _StdFilePkg_
-70
headers/TextEdit.h
··· 1 - 2 - /* 3 - * TextEdit.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 9 - * 10 - */ 11 - 12 - #ifndef _TextEdit_ 13 - #define _TextEdit_ 14 - 15 - #ifndef _Quickdraw_ 16 - #include "Quickdraw.h" 17 - #endif 18 - 19 - /* justifications */ 20 - enum { teJustRight = -1, teJustLeft, teJustCenter }; 21 - 22 - typedef char Chars[1], *CharsPtr, **CharsHandle; 23 - 24 - typedef struct 25 - { 26 - Rect destRect ; 27 - Rect viewRect ; 28 - Rect selRect ; 29 - int lineHeight ; 30 - int fontAscent ; 31 - Point selPoint ; 32 - int selStart ; 33 - int selEnd ; 34 - int active ; 35 - ProcPtr wordBreak ; 36 - ProcPtr clikLoop ; 37 - long clickTime ; 38 - int clickLoc ; 39 - long caretTime ; 40 - int caretState ; 41 - int just ; 42 - int teLength ; 43 - Handle hText ; 44 - int recalBack ; 45 - int recalLines; 46 - int clikStuff ; 47 - int crOnly ; 48 - int txFont ; 49 - char txFace ; 50 - int txMode ; 51 - int txSize ; 52 - GrafPtr inPort ; 53 - ProcPtr highHook ; 54 - ProcPtr caretHook ; 55 - int nLines ; 56 - int lineStarts[]; 57 - } TERec, *TEPtr, **TEHandle ; 58 - 59 - 60 - /* functions returning non-integral values */ 61 - pascal TEHandle TENew(); 62 - pascal CharsHandle TEGetText(); 63 - pascal Handle TEScrapHandle(); 64 - 65 - /* low-memory globals */ 66 - extern int TEScrpLength : 0xAB0; 67 - extern Handle TEScrpHandle : 0xAB4; 68 - 69 - 70 - #endif
-28
headers/TimeMgr.h
··· 1 - 2 - /* 3 - * TimeMgr.h 4 - * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1986. 9 - * 10 - */ 11 - 12 - #ifndef _TimeMgr_ 13 - #define _TimeMgr_ 14 - 15 - #ifndef _MacTypes_ 16 - #include "MacTypes.h" 17 - #endif 18 - 19 - 20 - typedef struct TMTask { 21 - struct QElem *qLink; 22 - int qType; 23 - ProcPtr tmAddr; 24 - int tmCount; 25 - } TMTask; 26 - 27 - 28 - #endif
+4 -5
headers/ToolboxUtil.h Mac #includes/ToolboxUtil.h
··· 2 2 /* 3 3 * ToolboxUtil.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 43 42 double Frac2X(Fract); 44 43 45 44 46 - #endif 45 + #endif _ToolboxUtil_
+4 -5
headers/VRetraceMgr.h Mac #includes/VRetraceMgr.h
··· 2 2 /* 3 3 * VRetraceMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 35 34 extern struct QHdr VBLQueue : 0x160; 36 35 37 36 38 - #endif 37 + #endif _VRetraceMgr_
+4 -5
headers/WindowMgr.h Mac #includes/WindowMgr.h
··· 2 2 /* 3 3 * WindowMgr.h 4 4 * 5 - * Copyright (c) 1986 THINK Technologies, Inc. 6 - * These interfaces are based on information published in 7 - * "Inside Macintosh" by Apple Computer, Addison-Wesley, 8 - * Reading (Mass.), 1985-86. 5 + * Copyright (c) 1986, 1987 THINK Technologies, Inc. 6 + * These interfaces are based on information copyrighted 7 + * by Apple Computer, Inc., 1985, 1986, 1987. 9 8 * 10 9 */ 11 10 ··· 122 121 extern WindowPtr GhostWindow : 0xA84; 123 122 124 123 125 - #endif 124 + #endif _WindowMgr_
headers/asm.h Mac #includes/asm.h
-8
headers/pascal.h
··· 1 - 2 - pascal void CallPascal(); 3 - pascal char CallPascalB(); 4 - pascal int CallPascalW(); 5 - pascal long CallPascalL(); 6 - 7 - char *CtoPstr(); 8 - char *PtoCstr();
+1
profiler/profile.c
··· 1 + /* Profile and tracing package for LightspeedC. (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. */ #include "stdio.h" typedef unsigned char Bool; /* for size */ enum{false,true}; typedef void (*address)(); /* address type */ typedef unsigned char byte; typedef unsigned long time; typedef struct { char *name; /* function name */ time average; /* average time */ time maximum; /* largest time */ time minimum; /* smallest time */ time total; /* total time */ unsigned int entries; /* times entered */ } PROFILE; typedef struct { address user; /* user return address */ int function; /* index into profiles */ time correction; /* nested call time */ time start; /* entry time */ } STACK; #define LOCAL static /* local to profiler */ #define MAX_PROFILES 200 /* routines to follow */ #define MAX_STACK 200 /* max nested calls */ #define MAX_TIME 500000L /* max time */ /* Select execution/compilation options. SINGLE - each routine contains only its time TESTING - test profile package without LightspeedC PROFILE option */ #define SINGLE /* single routine only */ /* #define TESTING standalone testing */ #ifdef TESTING #undef LOCAL /* make items visible */ #define LOCAL #endif LOCAL int depth = -1; LOCAL PROFILE profiles[MAX_PROFILES]; LOCAL int profile_count = 0; LOCAL STACK stack[MAX_STACK]; LOCAL int stack_pointer = -1; LOCAL time start_time; int _profile = 1; int _trace = 0; void DumpProfile(); extern _profile_exit_(); extern char *CtoPstr(); extern char *PtoCstr(); #define _VIATIMER_ /* if this symbol is defined, the VIA timer now is used instead of TickCount -- it provides faster ticks, however there is a false precision to the numbers and there is a range of + or - 500 ticks since the VIAtimer is so fast that interrupts and such play a more significant time role. NOTE THAT THIS PROFILE OPTION CANNOT BE USED WITH ANY PROGRAM THAT MANIPULATES THE #1 VIA timer */ #ifdef _VIATIMER_ /* TickCount() - redefine TickCount trap to be a procedure for determining the timing according to the VIA timer */ #define VIAbase (*((unsigned char**)0x01D4)) #define VIAt1lo (*(VIAbase+512*4)) #define VIAt1hi (*(VIAbase+512*5)) #define VIAmaxtime ~0 time TickCount() { static time timer=0; if (timer > 0) { /* Use VIA timer #1 (sound driver) and to implement a fine resolution counter */ /* Find delta of VIA #1 */ timer += VIAmaxtime - (((unsigned short)VIAt1hi<<8)+VIAt1lo); } else timer = 1; /* Reset VIA counter */ VIAt1hi = VIAmaxtime; VIAt1lo = VIAmaxtime; return (timer); } #endif _VIATIMER_ /* Compare two Pascal strings for equality. */ LOCAL Bool pstreq( s1, s2 ) register unsigned char *s1, *s2; { register int n = *s1; if ((n = *s1++) != *s2++) return( false ); while (n-- > 0) if (*s1++ != *s2++) return( false ); return( true ); } /* Return the time difference caused by the overhead of function entry and timer call. */ LOCAL time delta( original ) time original; { return( (time) TickCount() - original ); } /* Lookup a name in the active profile table. For this system, "names" are the address of the routine. If the name is found in the table, then the index to the table entry is returned. If the name is not found and the insert flag is on, then the item is inserted, and the new table index is returned (if insert is false, then -1 is returned). If the profile table is full, then -1 is returned. */ LOCAL int lookup( name, insert ) char *name; Bool insert; { register int i; for (i = 0; i < profile_count; i++) if (pstreq( profiles[i].name, name )) return( i ); if ( insert && profile_count < MAX_PROFILES) { /* place in table - i points to correct entry */ if (++profile_count == 1) { /* first time in */ start_time = (time) TickCount(); onexit( DumpProfile ); } profiles[i].name = name; profiles[i].minimum = MAX_TIME; profiles[i].maximum = profiles[i].total = NULL; profiles[i].entries = 0; return( i ); } return( -1 ); } /* Skip over to column 32 from position 'n'. */ LOCAL void Skip( n ) register int n; { for (; n < 32; n++) putchar( ' ' ); } /* Print the profile table on demand. Output is written to stdout and may be redirected with the Unix '>' mechanism to a file. The user should call this routine whenever a report is desired. Each time the routine is called, the program opens the map file which corresponds to the program running. The name of the map file is built by appending ".map" to the name of the running program. If the map file cannot be found then the routine returns. */ void DumpProfile() { int j, k; /* generic loop variables */ register int i; /* primary loop variable */ register time duration = 0L; /* time in test regions */ _profile = 0; /* turn off profiling here */ for (i = 0; i < profile_count; i++) duration += profiles[i].total; /* compute total time */ printf( "\n\n" ); printf( "\t\t\t\tRoutine Profiles\n\n" ); printf( "Routine Address" ); Skip( 15 ); printf( " Minimum Maximum Average %% Entries\n" ); if (duration <= 0.0) duration++; for (i = 0; i < profile_count; i++) { /* for all entries in the profile table */ if (profiles[i].minimum == MAX_TIME) continue; /* routine entry, no exit */ printf( "%s", PtoCstr( profiles[i].name ) ); CtoPstr( profiles[i].name ); Skip( profiles[i].name[0] ); printf( "%9lu %9lu %9lu %3.0f %7u\n", profiles[i].minimum, profiles[i].maximum, profiles[i].average, ((float) profiles[i].total * 100.0) / (float) duration + 0.05, profiles[i].entries ); } _profile = 1; /* re-enable profiling */ } /* Called by assembler exit routine. Compute usage statistics for routine on top of profiling stack. */ address __profile_exit() { int i; time exit_time = (time) TickCount(); depth--; /* end timing for a function */ i = stack[stack_pointer].function; #ifdef SINGLE exit_time = exit_time - delta( exit_time ) - stack[stack_pointer].start - stack[stack_pointer--].correction; if (exit_time > 0x7FFFFFFF) exit_time = 0L; /* handle clock rollover */ profiles[i].total += exit_time; if (stack_pointer >= 0) stack[stack_pointer].correction += exit_time + stack[stack_pointer + 1].correction; #else exit_time = exit_time - delta( exit_time ) - stack[stack_pointer--].start; if (exit_time > 0x7FFFFFFF) exit_time = 0L; /* handle clock rollover */ profiles[i].total += exit_time; #endif if (exit_time > profiles[i].maximum) profiles[i].maximum = exit_time; if (exit_time < profiles[i].minimum) profiles[i].minimum = exit_time; if (profiles[i].entries) profiles[i].average = profiles[i].total / profiles[i].entries; return( stack[stack_pointer + 1].user ); } /* Handle the routine entry profiling. Setup a stack frame and a profile table entry if needed. */ void __profile( unused, ret, name ) unsigned long *ret; address unused; char *name; { register int function, /* index of routine */ i; register time entry_time = (time) TickCount(); depth++; if (_trace) { _profile = 0; for (i = 0; i < depth; i++) putchar( ' ' ); printf( "%s\n", PtoCstr( name ) ); CtoPstr( name ); _profile = 1; } if (++stack_pointer < MAX_STACK) { /* setup for return to PROFILE_EXIT on user exit */ stack[stack_pointer].user = (address) *ret; *ret = (unsigned long) _profile_exit_; stack[stack_pointer].correction = NULL; } else { depth--; return; } if ((function = lookup( name, true )) >= 0) { /* process function entry */ profiles[function].entries++; stack[stack_pointer].function = function; entry_time = TickCount(); stack[stack_pointer].start = entry_time - delta( entry_time ); } else { /* remove entry from stack */ *ret = (unsigned long) stack[stack_pointer--].user; depth--; } }
+1
profiler/profilehooks.c
··· 1 + /* Profile and tracing package for LightspeedC. (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. */ extern void __profile(); extern void __profile_exit(); /* ; ; Entry point for profiler. Add another parameter to the stack which is ; a pointer to the return address of the caller of this function. ; */ _profile_() { asm { move.l (a7)+,d0 ; get current return address pea 4(a6) ; push pointer to return address move.l d0,-(a7) ; push back the return address jsr __profile ; call the C profiler move.l (a7)+,d0 ; get return address move.l d0,(a7) ; write on top of stack and return } } /* ; ; Exit point for profiler. This calls the end of function timing routine ; and returns to the user. ; */ _profile_exit_() { asm { move.l d0, -(a7) ; save old function result jsr __profile_exit ; call end of routine timer move.l d0, a0 ; save return address in A0 move.l (a7)+, d0 ; retrieve old function result jmp (a0) ; then return } }
-153
sources/credits.c
··· 1 - #include "MacTypes.h" 2 - #include "WindowMgr.h" 3 - #include "FontMgr.h" 4 - 5 - #define size 20 6 - #define yoffset 10 7 - #define xoffset 10 8 - #define toupper(c) ((c>='a'&&c<='z')?(c-'a'+'A'):c) 9 - 10 - void Initalize(void); 11 - void Put_Up_Boxes(void); 12 - void Put_Up_Box(int x, int y); 13 - void Put_Up_Characters(char c); 14 - void Put_Up_Character(int x, int y, char c); 15 - main(void); 16 - 17 - char phrase[] = "Libraries by:@\ 18 - @ Robert Alpert\ 19 - @ Steve Adams\ 20 - @ Paul Garmon\ 21 - @\ 22 - @Tested By:@\ 23 - @ Clement Wang\ 24 - @ Rick Tompkins\ 25 - @\ 26 - @Special Thanks to:@\ 27 - @ Steve Stein\ 28 - @ Fleet Hill"; 29 - 30 - int line,row; 31 - 32 - main() 33 - { 34 - int i,j, k; 35 - int line,row = 1; 36 - 37 - Initalize(); 38 - 39 - for (i='a'; i<='z'; i++) 40 - { 41 - Put_Up_Characters(toupper(i)); 42 - 43 - for (k=40000; k; k--); 44 - } 45 - Put_Up_Characters(':'); 46 - 47 - MoveTo(165, 335); 48 - TextFont(systemFont); 49 - TextSize(12); 50 - DrawString("\pClick the mouse to exit"); 51 - while (!Button()); 52 - while (Button()); 53 - } 54 - 55 - 56 - void Initalize() 57 - { 58 - static GrafPort port; 59 - 60 - InitGraf(&thePort); 61 - InitFonts(); 62 - InitWindows(); 63 - InitDialogs(0L); 64 - TEInit(); 65 - 66 - OpenPort(&port); 67 - 68 - TextFont(monaco); 69 - TextSize(9); 70 - TextFace(0); 71 - TextMode(srcOr); 72 - 73 - HideCursor(); 74 - EraseRect(&port.portRect); 75 - 76 - Put_Up_Boxes(); 77 - 78 - } 79 - 80 - 81 - void Put_Up_Boxes() 82 - { 83 - int i; 84 - 85 - line = row = 1; 86 - for (i=0; phrase[i] != '\0'; i++) 87 - { 88 - switch(phrase[i]) 89 - { 90 - case ' ': row++; 91 - break; 92 - 93 - case '@': row = 1; 94 - line++; 95 - break; 96 - 97 - case '-': Put_Up_Box(row,line); 98 - Put_Up_Character(row++,line,'-'); 99 - break; 100 - 101 - default: Put_Up_Box(row++,line); 102 - break; 103 - } 104 - } 105 - } 106 - 107 - void Put_Up_Box(x,y) 108 - int x,y; 109 - { 110 - Rect rect; 111 - 112 - SetRect(&rect, x*size+x+xoffset,y*size+yoffset+1-size,x*size+x+xoffset+size,y*size+yoffset); 113 - FrameRect(&rect); 114 - } 115 - 116 - 117 - void Put_Up_Characters(c) 118 - char c; 119 - { 120 - int i; 121 - 122 - row = line = 1; 123 - for (i=0; phrase[i] != '\0'; i++) 124 - { 125 - switch(phrase[i]) 126 - { 127 - 128 - case '@': row = 1; 129 - line++; 130 - break; 131 - 132 - case ' ': 133 - case '-': row++; 134 - break; 135 - 136 - default: if (c == toupper(phrase[i])) 137 - Put_Up_Character(row++,line,c); 138 - else 139 - row++; 140 - break; 141 - } 142 - } 143 - } 144 - 145 - void Put_Up_Character(x,y,c) 146 - int x,y; 147 - char c; 148 - { 149 - MoveTo(x*size+x+xoffset+(size*2)/5, y*size+yoffset-(size*2)/5+2); 150 - DrawChar(c); 151 - } 152 - 153 -
+1 -1
sources/ctype.h C Libraries/headers/ctype.h
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
sources/errno.h C Libraries/headers/errno.h
sources/fopenw.h C Libraries/headers/fopenw.h
sources/io.h C Libraries/headers/io.h
-584
sources/math.c
··· 1 - /* 2 - 3 - Standard Unix math library for LightspeedC�. 4 - 5 - (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. 6 - 7 - See Harbison & Steele's C:A Reference Manual chapter 11 for details 8 - 9 - */ 10 - 11 - 12 - #include "stdio.h" 13 - #include "math.h" 14 - #include "sane.h" 15 - 16 - #define C (0.00000000011641532183) 17 - 18 - /* The following value is the largest possible positive number that can be 19 - represented by the double format */ 20 - 21 - static union { 22 - unsigned int plusdoubleparts[5]; 23 - double plusdouble; 24 - } max = {0x7FFE, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF}; 25 - 26 - /* The following value is positive infinity as represented by SANE */ 27 - 28 - static union { 29 - unsigned int plusdoubleparts[5]; 30 - double plusdouble; 31 - } inf = {0x7FFF, 0, 0, 0, 0}; 32 - 33 - /* The following value is the base 2 logarithm of 10.0 as represented 34 - by a double value returned by SANE */ 35 - 36 - static union { 37 - unsigned int tenparts[5]; 38 - double ten; 39 - } log2of = {0x4000, 0xD49A, 0x784B, 0xCD1B, 0x8AFE}; 40 - 41 - /* This is the data structure used with rand() and srand() to generate 42 - random numbers according to the ANSI C spec. 43 - pdg - 6/10/86 */ 44 - 45 - static union { 46 - unsigned long seed; 47 - struct { int sign : 1, v : 15; } hiword; 48 - } randval = 1; 49 - 50 - /* This is the structure of a double, so we can access the exponent 51 - and mantissa sign bits independently without using SANE */ 52 - 53 - typedef struct { 54 - short expsign:1, 55 - exp:15; 56 - long mansign:1, 57 - man:31; 58 - long moreman; 59 - } dbl; 60 - 61 - 62 - /* This is the structure of the SANE (Standard Apple Numeric Environment) 63 - environment flags word used in ceil(), floor(), etc. */ 64 - 65 - typedef struct { 66 - short unused:1, round:2, 67 - /*flags:5, */ inexact:1, divbyzero:1, overflow:1, underflow:1, invalid:1, 68 - lastround:1, precision:2, halts:5; 69 - } SANEenvword; 70 - 71 - /* Temporary save area for SANE global environment flags word */ 72 - 73 - static SANEenvword SANEstate; 74 - 75 - /* Define the location of the SANE environment word in Macintosh memory */ 76 - 77 - #define SANEglobalenv (*((SANEenvword*) 0x0A4A)) 78 - 79 - 80 - /* local function to truncate a double to an integer (works for both old 81 - and new versions of LightspeedC */ 82 - 83 - #define NEWLSC /* if uncommented, removes excess code for new version */ 84 - 85 - #ifndef NEWLSC 86 - 87 - static int trunc(x) 88 - double x; 89 - { 90 - int i; 91 - 92 - SANEstate = SANEglobalenv; 93 - 94 - SANEglobalenv.round = TOWARDZERO; 95 - 96 - i = x; 97 - 98 - SANEglobalenv = SANEstate; 99 - 100 - return (i); 101 - } 102 - #else 103 - #define trunc(x) x 104 - #endif NEWLSC 105 - 106 - 107 - /* Return the absolute value of the integer X */ 108 - #line 0 abs 109 - int abs(x) 110 - int x; 111 - { 112 - if (x<0) return (-x); 113 - return (x); 114 - } 115 - 116 - /* Return the arc cosine of the double value X */ 117 - #line 0 acos 118 - double acos(x) 119 - double x; 120 - { 121 - if ((x > 1.0)||(x < -1.0)) 122 - { 123 - errno = EDOM; 124 - return( 0.0 ); 125 - } 126 - 127 - if (x == -1.0) return ( PI ); 128 - 129 - x = (1.0 - x) / (1.0 + x); 130 - 131 - fp68k(&x, FOSQRT); 132 - 133 - x *= 2.0; 134 - 135 - return( x ); 136 - } 137 - 138 - /* Return the arc sine of the double value X */ 139 - #line 0 asin 140 - double asin(x) 141 - double x; 142 - { 143 - double y = fabs( x ); 144 - 145 - if ( y > 1.0 ) 146 - { 147 - errno = EDOM; 148 - return( 0.0 ); 149 - } 150 - 151 - if (y == 1.0) 152 - { 153 - y = PI2; 154 - 155 - /* copy sign of x into y */ 156 - 157 - (*(dbl*) (&y)).mansign = (*(dbl*) (&x)).mansign; 158 - 159 - return( y ); 160 - } 161 - 162 - if ( y >= 0.3 ) x /= sqrt( (1.0 - x) * (1.0 + x) ); 163 - else 164 - if ( y >= C ) x /= sqrt( 1.0 - x * x ); 165 - 166 - elems68k( &x, FOATANX ); 167 - 168 - return( x ); /* pdg - 6/10/86 - formerly returned y */ 169 - } 170 - 171 - 172 - /* Return the arc tangent of the double value X */ 173 - #line 0 atan 174 - double atan(x) 175 - double x; 176 - { 177 - elems68k( &x, FOATANX ); 178 - return( x ); 179 - } 180 - 181 - 182 - /* Return the arc tangent of the double value of Y divided by X */ 183 - #line 0 atan2 184 - double atan2(y,x) 185 - double y, x; 186 - { 187 - double z; 188 - 189 - if ( x == 0.0 ) 190 - { 191 - if ( y == 0.0 ) 192 - { 193 - errno = EDOM; 194 - return( 0.0 ); 195 - } 196 - 197 - z = PI2; 198 - } 199 - else 200 - { 201 - z = atan( fabs( y ) / fabs( x ) ); 202 - 203 - if (x <= 0.0) z = PI - z; 204 - } 205 - 206 - /* copy sign of y into z */ 207 - 208 - (*(dbl*) (&z)).mansign = (*(dbl*) (&y)).mansign; 209 - 210 - return (z); 211 - } 212 - 213 - 214 - /* Round towards positive infinity. 215 - pdg - 6/10/86 - complete revision using SANE call */ 216 - #line 0 ceil 217 - double ceil(x) 218 - double x; 219 - { 220 - /* save the state, do the round, restore the state, and return value */ 221 - 222 - SANEstate = SANEglobalenv; 223 - 224 - SANEglobalenv.round = UPWARD; 225 - 226 - fp68k( &x, FORTI ); 227 - 228 - SANEglobalenv = SANEstate; 229 - 230 - return (x); 231 - } 232 - 233 - 234 - /* Return the cosine of the double value X */ 235 - #line 0 cos 236 - double cos(x) 237 - double x; 238 - { 239 - elems68k( &x, FOCOSX ); 240 - return( x ); 241 - } 242 - 243 - 244 - /* Return the hyperbolic cosine of the double value X */ 245 - #line 0 cosh 246 - double cosh(x) 247 - double x; 248 - { 249 - double y = exp( fabs( x ) ); 250 - 251 - if (y == 0.0) 252 - { 253 - errno = ERANGE; 254 - return ( max.plusdouble ); 255 - } 256 - 257 - y *= 0.5; 258 - y += y * 0.25; 259 - 260 - return( y ); 261 - } 262 - 263 - /* Return the value of e raised to the X power */ 264 - #line 0 exp 265 - double exp(x) 266 - double x; 267 - { 268 - elems68k( &x, FOEXPX ); 269 - 270 - if (SANEglobalenv.overflow) 271 - { 272 - errno = ERANGE; 273 - return ( max.plusdouble ); 274 - } 275 - 276 - return( x ); 277 - } 278 - 279 - 280 - /* Return the absolute value of X */ 281 - #line 0 fabs 282 - double fabs(x) 283 - double x; 284 - { 285 - fp68k( &x, FOABS ); 286 - return( x ); 287 - } 288 - 289 - 290 - /* Round towards negative infinity. 291 - pdg - 6/10/86 - complete revision using SANE call vs. improper C hack */ 292 - #line 0 floor 293 - double floor(x) 294 - double x; 295 - { 296 - /* save the state, do the round, restore the state, and return value */ 297 - 298 - SANEstate = SANEglobalenv; 299 - 300 - SANEglobalenv.round = DOWNWARD; 301 - 302 - fp68k( &x, FORTI ); 303 - 304 - SANEglobalenv = SANEstate; 305 - 306 - return (x); 307 - } 308 - 309 - 310 - /* Return a number such F that k * Y + f == X 311 - Thanks to Robert J. Murphy of Data Tailor, Inc. for this revision */ 312 - #line 0 fmod 313 - double fmod(x,y) 314 - double x, y; 315 - { 316 - double rem = x; 317 - 318 - fp68k( &y, FOABS); 319 - fp68k( &y, &rem, FOREM); 320 - 321 - if ( (x > 0) && (rem < 0)) rem += y; 322 - else 323 - if ( (x < 0) && (rem > 0)) rem -= y; 324 - 325 - return (rem); 326 - } 327 - 328 - 329 - /* Return fraction and exponent of X */ 330 - #line 0 frexp 331 - double frexp(x,nptr) 332 - double x; 333 - register int *nptr; 334 - { 335 - double y = fabs( x ), z = 2.0; 336 - 337 - if (y == 0.0) 338 - { 339 - *nptr = 0; 340 - return( 0.0 ); 341 - } 342 - 343 - elems68k( &y, FOLOG2X ); 344 - 345 - y -= (*nptr = trunc(y)); 346 - 347 - elems68k( &y, &z, FOPWRY ); 348 - 349 - /* scale the result if not between .5 and 1.0 */ 350 - 351 - if (z >= 1.0) 352 - { 353 - (*nptr)++; 354 - z *= 0.5; 355 - } 356 - else 357 - if (z < 0.5) 358 - { 359 - (*nptr)--; 360 - z *= 2.0; 361 - } 362 - 363 - /* copy sign of x into z */ 364 - 365 - (*(dbl*) (&z)).mansign = (*(dbl*) (&x)).mansign; 366 - 367 - return( z ); 368 - } 369 - 370 - 371 - /* Return the absolute value of the long number X */ 372 - #line 0 labs 373 - long int labs(x) 374 - register long int x; 375 - { 376 - if ( x < 0 ) return (-x); 377 - 378 - return (x); 379 - } 380 - 381 - 382 - /* Return return the floating point number represented by (X * radix) ^ n */ 383 - #line 0 ldexp 384 - double ldexp(x,n) 385 - double x; 386 - int n; 387 - { 388 - fp68k( &n, &x, FOSCALB ); 389 - return( x ); 390 - } 391 - 392 - 393 - /* Return the natural log of the double value X */ 394 - #line 0 log 395 - double log(x) 396 - double x; 397 - { 398 - if (x <= 0.0) 399 - { 400 - errno = EDOM; 401 - return ( -max.plusdouble ); 402 - } 403 - 404 - elems68k( &x, FOLNX ); 405 - return( x ); 406 - } 407 - 408 - 409 - /* Return the log base 10 of the double value X */ 410 - #line 0 log10 411 - double log10(x) 412 - double x; 413 - { 414 - if (x <= 0.0) 415 - { 416 - errno = EDOM; 417 - return ( -max.plusdouble ); 418 - } 419 - 420 - elems68k(&x, FOLOG2X); /* LOG2 is much faster than LN */ 421 - 422 - x /= log2of.ten; 423 - 424 - return ( x ); 425 - } 426 - 427 - 428 - /* Split X into a fraction and integer such that |X| < 1 */ 429 - #line 0 modf 430 - double modf(x,nptr) 431 - double x; 432 - register int *nptr; 433 - { 434 - if (abs( (*nptr = trunc(x)) ) > fabs( x )) 435 - { 436 - if (*nptr > 0) (*nptr)--; 437 - else 438 - (*nptr)++; 439 - } 440 - 441 - x -= *nptr; 442 - 443 - return( x ); 444 - } 445 - 446 - /* Return X ^ Y */ 447 - #line 0 pow 448 - double pow(x,y) 449 - double x, y; 450 - { 451 - int dummyint; 452 - 453 - if ( (x < 0.0 && (modf(y, &dummyint) != 0)) || (x == 0.0 && y < 0.0) ) 454 - { 455 - errno = EDOM; 456 - x = -max.plusdouble; 457 - goto returnx; 458 - } 459 - 460 - elems68k( &y, &x, FOPWRY ); 461 - 462 - if (SANEglobalenv.overflow) 463 - { 464 - errno = ERANGE; 465 - x = max.plusdouble; 466 - } 467 - 468 - returnx: 469 - 470 - return( x ); 471 - } 472 - 473 - 474 - /* Return a random number in the range 0 .. max int */ 475 - #line 0 rand 476 - 477 - int rand() 478 - { 479 - /* pdg - 6/10/86 - ANSI random number generator */ 480 - 481 - randval.seed = randval.seed * 1103515245 + 12345; 482 - return randval.hiword.v; 483 - } 484 - 485 - /* Return the sine of the double value X */ 486 - #line 0 sin 487 - double sin(x) 488 - double x; 489 - { 490 - elems68k( &x, FOSINX ); 491 - return( x ); 492 - } 493 - 494 - /* Return the hyperbolic sine of the double value X */ 495 - #line 0 sinh 496 - double sinh(x) 497 - double x; 498 - { 499 - double y = fabs(x); 500 - 501 - if (y >= C) 502 - { 503 - elems68k( &y, FOEXP1X ); 504 - 505 - if (SANEglobalenv.overflow) 506 - { 507 - errno = ERANGE; 508 - y = max.plusdouble; 509 - } 510 - else 511 - { 512 - y += y / ( y + 1.0); 513 - 514 - y *= 0.5; 515 - } 516 - } 517 - 518 - /* copy sign of x into y */ 519 - 520 - (*(dbl*) (&y)).mansign = (*(dbl*) (&x)).mansign; 521 - 522 - return (y); 523 - } 524 - 525 - 526 - /* Return the square root of the double value X */ 527 - #line 0 sqrt 528 - double sqrt(x) 529 - double x; 530 - { 531 - if (x < 0.0) 532 - { 533 - errno = EDOM; 534 - return( 0.0 ); 535 - } 536 - 537 - fp68k(&x, FOSQRT); 538 - return(x); 539 - } 540 - 541 - 542 - /* Set the seed of the random number generator to SEED */ 543 - #line 0 srand 544 - void srand(seed) 545 - unsigned int seed; 546 - { 547 - randval.seed = seed; 548 - } 549 - 550 - /* Return the tangent of the double value X */ 551 - #line 0 tan 552 - double tan(x) 553 - double x; 554 - { 555 - elems68k( &x, FOTANX ); 556 - 557 - if ( SANEglobalenv.invalid || ( x == inf.plusdouble ) ) 558 - { 559 - errno = ERANGE; 560 - x = max.plusdouble; 561 - } 562 - 563 - return(x); 564 - } 565 - 566 - 567 - /* Return the hyperbolic tangent of the double value X */ 568 - #line 0 tanh 569 - double tanh(x) 570 - double x; 571 - { 572 - double y = fabs( x ); 573 - 574 - if (y >= C) 575 - { 576 - y *= -2.0; 577 - elems68k( &y, FOEXP1X ); 578 - y = -y / ( y + 2.0 ); 579 - } 580 - 581 - (*(dbl*) (&y)).mansign = (*(dbl*) (&x)).mansign; 582 - 583 - return (y); 584 - }
-49
sources/math.h
··· 1 - /**************************************************************************** 2 - 3 - Standard math library header for LightspeedC�. 4 - 5 - (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. 6 - 7 - *****************************************************************************/ 8 - 9 - #ifndef _math_ 10 - 11 - #define _math_ /* show symbols defined */ 12 - double acos(); 13 - double asin(); 14 - double atan(); 15 - double atan2(); 16 - double ceil(); 17 - double cos(); 18 - double cosh(); 19 - double exp(); 20 - double fabs(); 21 - double floor(); 22 - double fmod(); 23 - double frexp(); 24 - long labs(); 25 - double ldexp(); 26 - double log(); 27 - double log10(); 28 - double modf(); 29 - double pow(); 30 - double sin(); 31 - double sinh(); 32 - double sqrt(); 33 - double tan(); 34 - double tanh(); 35 - 36 - #define PI (3.14159265358979323846) 37 - #define PI2 (1.57079632679489661923) 38 - #define PI4 (0.78539816339744830966) 39 - 40 - #define E (2.71828182845904523536) 41 - 42 - typedef enum{ 43 - EDOM=33, 44 - ERANGE=34 45 - }; 46 - 47 - extern int errno; /* actually defined in stdio */ 48 - 49 - #endif
+1 -1
sources/onexit.c C Libraries/sources/stdio .c files/onexit.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5
+1 -1
sources/printf-1.c C Libraries/sources/stdio .c files/printf-1.c
··· 1 1 /* 2 - printf routines for LightspeedC� 2 + printf routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5
+1 -1
sources/printf-1a.c C Libraries/sources/stdio .c files/printf-1a.c
··· 1 1 /* 2 - printf routines for LightspeedC� 2 + printf routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5
+3 -7
sources/printf-2-w.c C Libraries/sources/stdio .c files/printf-2-w.c
··· 1 1 /* 2 - printf routines for LightspeedC� 2 + printf routines for LightspeedC 3 3 4 4 (C) Copyright 1986. THINK Technologies, Inc. All rights reserved. 5 5 ··· 840 840 who->StdStream = true; 841 841 who->InUse = true; 842 842 who->window = true; 843 - who->rd = false; 843 + who->rd = true; /* 11/13/87 rms - changed from FALSE */ 844 844 who->wr = true; 845 845 846 846 return (who); ··· 911 911 XEventRecord *xevent; 912 912 { 913 913 WindowPtr wp = xevent->window; 914 - 915 914 switch (((EventRecord*)xevent)->what) 916 915 { 917 916 case updateEvt: ··· 1098 1097 int len; 1099 1098 { 1100 1099 Init_stdio(); 1101 - 1102 - ((StdWindowRec*) Currentswrp)->opt._tab_width = 1; 1103 - 1104 - if (len < 1) ((StdWindowRec*) Currentswrp)->opt._tab_width = len; 1100 + ((StdWindowRec*) Currentswrp)->opt._tab_width = len > 1 ? len : 1; 1105 1101 } 1106 1102 1107 1103 #line 0 gotoxy
sources/printf-2.c C Libraries/sources/stdio .c files/printf-2.c
+2 -3
sources/printf-3.c C Libraries/sources/stdio .c files/printf-3.c
··· 1 1 /* 2 - printf formatter for LightspeedC� 2 + printf formatter for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 ··· 825 825 826 826 return(_num_count); 827 827 828 - (void) std_ver(); 829 - 828 + (void) std_ver(); /* make the linker drag it in */ 830 829 }
+9 -13
sources/printf-4.c C Libraries/sources/stdio .c files/printf-4.c
··· 1 1 /* 2 - printf routines for LightspeedC� 3 - 2 + printf routines for LightspeedC 3 + 4 4 (C) Copyright 1986. THINK Technologies, Inc. All rights reserved. 5 5 6 6 allows echoing the output of console window to printer ··· 46 46 47 47 /* if printer port number is non-zero, port A is implied */ 48 48 49 - if (SPPrint) p = ".AOut"; 50 - else 51 - /* well, check to see if port B is in use by AppleTalk, 52 - indicated by a greater than zero value */ 53 - 54 - if (PortBUse < 0) p = ".BOut"; 55 - else 56 - /* ran out of ports to check */ 57 - return (EOF); 58 - 49 + if (SPPrint & 1) p = ".AOut"; 50 + else { 51 + if (PortBUse < 0 || (PortBUse & 0xF) != 1) p = ".BOut"; 52 + else return (EOF); 53 + } 54 + 59 55 /* set to binary mode if we are opening a device driver, 60 56 so output directed to a printer gets proper linefeeds */ 61 57 62 - if (!(printfile = fopen(p, "wb"))) return (EOF); 58 + if (!(printfile = fopen(p, "wb"))) return (errno); 63 59 64 60 _echo_to_printer_ = send_printer; 65 61 }
-351
sources/profile.c
··· 1 - /* 2 - 3 - Profile and tracing package for LightspeedC�. 4 - 5 - (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. 6 - 7 - */ 8 - 9 - 10 - #include "stdio.h" 11 - 12 - 13 - typedef unsigned char Bool; /* for size */ 14 - enum{false,true}; 15 - 16 - typedef void (*address)(); /* address type */ 17 - typedef unsigned char byte; 18 - typedef unsigned long time; 19 - 20 - typedef struct { 21 - char *name; /* function name */ 22 - time average; /* average time */ 23 - time maximum; /* largest time */ 24 - time minimum; /* smallest time */ 25 - time total; /* total time */ 26 - unsigned int entries; /* times entered */ 27 - } PROFILE; 28 - 29 - typedef struct { 30 - address user; /* user return address */ 31 - int function; /* index into profiles */ 32 - time correction; /* nested call time */ 33 - time start; /* entry time */ 34 - } STACK; 35 - 36 - #define LOCAL static /* local to profiler */ 37 - #define MAX_PROFILES 200 /* routines to follow */ 38 - #define MAX_STACK 200 /* max nested calls */ 39 - #define MAX_TIME 500000L /* max time */ 40 - 41 - 42 - /* 43 - 44 - Select execution/compilation options. 45 - 46 - SINGLE - each routine contains only its time 47 - TESTING - test profile package without LightspeedC PROFILE option 48 - 49 - */ 50 - 51 - #define SINGLE /* single routine only */ 52 - /* #define TESTING standalone testing */ 53 - 54 - 55 - #ifdef TESTING 56 - #undef LOCAL /* make items visible */ 57 - #define LOCAL 58 - #endif 59 - 60 - 61 - 62 - LOCAL int depth = -1; 63 - LOCAL PROFILE profiles[MAX_PROFILES]; 64 - LOCAL int profile_count = 0; 65 - LOCAL STACK stack[MAX_STACK]; 66 - LOCAL int stack_pointer = -1; 67 - LOCAL time start_time; 68 - 69 - int _profile = 1; 70 - int _trace = 0; 71 - 72 - void DumpProfile(); 73 - extern _profile_exit_(); 74 - extern char *CtoPstr(); 75 - extern char *PtoCstr(); 76 - 77 - #define _VIATIMER_ /* if this symbol is defined, the VIA timer now is used 78 - instead of TickCount -- it provides faster ticks, 79 - however there is a false precision to the numbers 80 - and there is a range of + or - 500 ticks since 81 - the VIAtimer is so fast that interrupts and such 82 - play a more significant time role. 83 - 84 - NOTE THAT THIS PROFILE OPTION CANNOT BE USED WITH 85 - ANY PROGRAM THAT MANIPULATES THE #1 VIA timer */ 86 - 87 - 88 - #ifdef _VIATIMER_ 89 - 90 - /* TickCount() - redefine TickCount trap to be a procedure for determining 91 - the timing according to the VIA timer */ 92 - 93 - #define VIAbase (*((unsigned char**)0x01D4)) 94 - #define VIAt1lo (*(VIAbase+512*4)) 95 - #define VIAt1hi (*(VIAbase+512*5)) 96 - #define VIAmaxtime ~0 97 - 98 - time TickCount() 99 - { 100 - static time timer=0; 101 - 102 - if (timer > 0) 103 - { 104 - /* Use VIA timer #1 (sound driver) and to implement a fine 105 - resolution counter */ 106 - 107 - /* Find delta of VIA #1 */ 108 - 109 - timer += VIAmaxtime - (((unsigned short)VIAt1hi<<8)+VIAt1lo); 110 - } 111 - else 112 - timer = 1; 113 - 114 - /* Reset VIA counter */ 115 - 116 - VIAt1hi = VIAmaxtime; 117 - VIAt1lo = VIAmaxtime; 118 - 119 - return (timer); 120 - } 121 - 122 - #endif _VIATIMER_ 123 - 124 - 125 - /* 126 - 127 - Compare two Pascal strings for equality. 128 - 129 - */ 130 - 131 - LOCAL Bool pstreq( s1, s2 ) 132 - register unsigned char *s1, *s2; 133 - { 134 - register int n = *s1; 135 - 136 - if ((n = *s1++) != *s2++) 137 - return( false ); 138 - while (n-- > 0) 139 - if (*s1++ != *s2++) 140 - return( false ); 141 - return( true ); 142 - } 143 - 144 - 145 - /* 146 - 147 - Return the time difference caused by the overhead of function entry and 148 - timer call. 149 - 150 - */ 151 - 152 - LOCAL time delta( original ) 153 - time original; 154 - { 155 - return( (time) TickCount() - original ); 156 - } 157 - 158 - 159 - /* 160 - 161 - Lookup a name in the active profile table. For this system, "names" are 162 - the address of the routine. If the name is found in the table, then the 163 - index to the table entry is returned. If the name is not found and the 164 - insert flag is on, then the item is inserted, and the new table index 165 - is returned (if insert is false, then -1 is returned). If the profile 166 - table is full, then -1 is returned. 167 - 168 - */ 169 - 170 - LOCAL int lookup( name, insert ) 171 - char *name; 172 - Bool insert; 173 - { 174 - register int i; 175 - 176 - for (i = 0; i < profile_count; i++) 177 - if (pstreq( profiles[i].name, name )) 178 - return( i ); 179 - if ( insert && profile_count < MAX_PROFILES) 180 - { /* place in table - i points to correct entry */ 181 - if (++profile_count == 1) 182 - { /* first time in */ 183 - start_time = (time) TickCount(); 184 - onexit( DumpProfile ); 185 - } 186 - profiles[i].name = name; 187 - profiles[i].minimum = MAX_TIME; 188 - profiles[i].maximum = 189 - profiles[i].total = NULL; 190 - profiles[i].entries = 0; 191 - return( i ); 192 - } 193 - return( -1 ); 194 - } 195 - 196 - 197 - /* 198 - 199 - Skip over to column 32 from position 'n'. 200 - 201 - */ 202 - 203 - LOCAL void Skip( n ) 204 - register int n; 205 - { 206 - for (; n < 32; n++) 207 - putchar( ' ' ); 208 - } 209 - 210 - 211 - /* 212 - 213 - Print the profile table on demand. Output is written to stdout and may 214 - be redirected with the Unix '>' mechanism to a file. The user should 215 - call this routine whenever a report is desired. Each time the routine is 216 - called, the program opens the map file which corresponds to the program 217 - running. The name of the map file is built by appending ".map" to the name 218 - of the running program. If the map file cannot be found then the routine 219 - returns. 220 - 221 - */ 222 - 223 - void DumpProfile() 224 - { 225 - int j, k; /* generic loop variables */ 226 - register int i; /* primary loop variable */ 227 - register time duration = 0L; /* time in test regions */ 228 - 229 - _profile = 0; /* turn off profiling here */ 230 - 231 - for (i = 0; i < profile_count; i++) 232 - duration += profiles[i].total; /* compute total time */ 233 - 234 - printf( "\n\n" ); 235 - printf( "\t\t\t\tRoutine Profiles\n\n" ); 236 - printf( "Routine Address" ); 237 - Skip( 15 ); 238 - printf( " Minimum Maximum Average %% Entries\n" ); 239 - 240 - if (duration <= 0.0) 241 - duration++; 242 - 243 - for (i = 0; i < profile_count; i++) 244 - { /* for all entries in the profile table */ 245 - if (profiles[i].minimum == MAX_TIME) 246 - continue; /* routine entry, no exit */ 247 - printf( "%s", PtoCstr( profiles[i].name ) ); 248 - CtoPstr( profiles[i].name ); 249 - Skip( profiles[i].name[0] ); 250 - printf( "%9lu %9lu %9lu %3.0f %7u\n", 251 - profiles[i].minimum, profiles[i].maximum, 252 - profiles[i].average, 253 - ((float) profiles[i].total * 100.0) / (float) duration + 0.05, 254 - profiles[i].entries ); 255 - } 256 - 257 - _profile = 1; /* re-enable profiling */ 258 - } 259 - 260 - 261 - /* 262 - 263 - Called by assembler exit routine. Compute usage statistics for routine on 264 - top of profiling stack. 265 - 266 - */ 267 - 268 - address __profile_exit() 269 - { 270 - int i; 271 - time exit_time = (time) TickCount(); 272 - 273 - depth--; 274 - /* end timing for a function */ 275 - 276 - i = stack[stack_pointer].function; 277 - #ifdef SINGLE 278 - exit_time = exit_time - delta( exit_time ) - 279 - stack[stack_pointer].start - stack[stack_pointer--].correction; 280 - if (exit_time > 0x7FFFFFFF) 281 - exit_time = 0L; /* handle clock rollover */ 282 - profiles[i].total += exit_time; 283 - if (stack_pointer >= 0) 284 - stack[stack_pointer].correction += exit_time + stack[stack_pointer + 1].correction; 285 - #else 286 - exit_time = exit_time - delta( exit_time ) - stack[stack_pointer--].start; 287 - if (exit_time > 0x7FFFFFFF) 288 - exit_time = 0L; /* handle clock rollover */ 289 - profiles[i].total += exit_time; 290 - #endif 291 - if (exit_time > profiles[i].maximum) 292 - profiles[i].maximum = exit_time; 293 - if (exit_time < profiles[i].minimum) 294 - profiles[i].minimum = exit_time; 295 - if (profiles[i].entries) 296 - profiles[i].average = profiles[i].total / profiles[i].entries; 297 - return( stack[stack_pointer + 1].user ); 298 - } 299 - 300 - 301 - /* 302 - 303 - Handle the routine entry profiling. Setup a stack frame and a profile 304 - table entry if needed. 305 - 306 - */ 307 - 308 - void __profile( unused, ret, name ) 309 - unsigned long *ret; 310 - address unused; 311 - char *name; 312 - { 313 - register int function, /* index of routine */ 314 - i; 315 - register time entry_time = (time) TickCount(); 316 - 317 - depth++; 318 - if (_trace) 319 - { 320 - _profile = 0; 321 - for (i = 0; i < depth; i++) 322 - putchar( ' ' ); 323 - printf( "%s\n", PtoCstr( name ) ); 324 - CtoPstr( name ); 325 - _profile = 1; 326 - } 327 - if (++stack_pointer < MAX_STACK) 328 - { /* setup for return to PROFILE_EXIT on user exit */ 329 - stack[stack_pointer].user = (address) *ret; 330 - *ret = (unsigned long) _profile_exit_; 331 - stack[stack_pointer].correction = NULL; 332 - } 333 - else 334 - { 335 - depth--; 336 - return; 337 - } 338 - 339 - if ((function = lookup( name, true )) >= 0) 340 - { /* process function entry */ 341 - profiles[function].entries++; 342 - stack[stack_pointer].function = function; 343 - entry_time = TickCount(); 344 - stack[stack_pointer].start = entry_time - delta( entry_time ); 345 - } 346 - else 347 - { /* remove entry from stack */ 348 - *ret = (unsigned long) stack[stack_pointer--].user; 349 - depth--; 350 - } 351 - }
-49
sources/profilehooks.c
··· 1 - /* 2 - 3 - Profile and tracing package for LightspeedC�. 4 - 5 - (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. 6 - 7 - */ 8 - 9 - extern void __profile(); 10 - extern void __profile_exit(); 11 - 12 - /* 13 - ; 14 - ; Entry point for profiler. Add another parameter to the stack which is 15 - ; a pointer to the return address of the caller of this function. 16 - ; 17 - */ 18 - _profile_() 19 - { 20 - 21 - asm 22 - { 23 - move.l (a7)+,d0 ; get current return address 24 - pea 4(a6) ; push pointer to return address 25 - move.l d0,-(a7) ; push back the return address 26 - jsr __profile ; call the C profiler 27 - move.l (a7)+,d0 ; get return address 28 - move.l d0,(a7) ; write on top of stack and return 29 - } 30 - } 31 - 32 - /* 33 - ; 34 - ; Exit point for profiler. This calls the end of function timing routine 35 - ; and returns to the user. 36 - ; 37 - */ 38 - 39 - _profile_exit_() 40 - { 41 - asm 42 - { 43 - move.l d0, -(a7) ; save old function result 44 - jsr __profile_exit ; call end of routine timer 45 - move.l d0, a0 ; save return address in A0 46 - move.l (a7)+, d0 ; retrieve old function result 47 - jmp (a0) ; then return 48 - } 49 - }
+5
sources/proto.h C Libraries/headers/proto.h
··· 274 274 int getypos(void); 275 275 void putch(char c); 276 276 277 + #ifndef _setjmph_ 278 + #include "setjmp.h" 279 + #endif _setjmph_ 277 280 281 + int setjmp(jmp_buf env); 282 + void longjmp(jmp_buf env, int val);
sources/qsort.c C Libraries/sources/unix .c files/qsort.c
+4 -4
sources/sane.h C Libraries/headers/sane.h
··· 1 1 /*************************************************************************** 2 2 3 - Standard Apple Numeric Environment (SANE) interface for LightspeedC�. 3 + Standard Apple Numeric Environment (SANE) interface for LightspeedC. 4 4 5 5 (C) Copyright 1986 THINK Technologies, Inc. All rights reserved. 6 6 ··· 145 145 } NaN_codes; 146 146 147 147 148 - #define SetEnvironment(where) ( fp68k(where,FOSETENV) ) 149 - #define GetEnvironment(where) ( fp68k(where,FOGETENV) ) 148 + #define SetEnvironment(where) fp68k(where,FOSETENV) 149 + #define GetEnvironment(where) fp68k(where,FOGETENV) 150 150 151 - pascal void fp68k() = 0xA9EB; /* 68K arithemtic */ 151 + pascal void fp68k() = 0xA9EB; /* 68K arithmetic */ 152 152 pascal void elems68k() = 0xA9EC; /* elementary functions */ 153 153 pascal void Dec2Str(); 154 154 pascal void Str2Dec();
+1 -1
sources/scanf1.c C Libraries/sources/stdio .c files/scanf1.c
··· 1 1 /* 2 - scanf routines for LightspeedC� 2 + scanf routines for LightspeedC 3 3 4 4 (C) Copyright 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+2 -2
sources/scanf2.c C Libraries/sources/stdio .c files/scanf2.c
··· 1 1 /* 2 - scanf routines for LightspeedC� 2 + scanf routines for LightspeedC 3 3 4 4 (C) Copyright 1986. THINK Technologies, Inc. All rights reserved. 5 5 */ ··· 457 457 458 458 {Decimal _decimal_; 459 459 int fblen = 0; 460 - 460 + 461 461 scratch[0] = '\0'; 462 462 curr_char = skip_white(); 463 463
sources/setjmp.h C Libraries/headers/setjmp.h
sources/signal.h C Libraries/headers/signal.h
sources/std_decode.c C Libraries/sources/stdio .c files/std_decode.c
+1 -1
sources/stddata_ctype.c C Libraries/sources/stdio .c files/stddata_ctype.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stddata_file.c C Libraries/sources/stdio .c files/stddata_file.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stdfile_error.c C Libraries/sources/stdio .c files/stdfile_error.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stdfile_pos.c C Libraries/sources/stdio .c files/stdfile_pos.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stdfilebuf.c C Libraries/sources/stdio .c files/stdfilebuf.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stdfwrite.c C Libraries/sources/stdio .c files/stdfwrite.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 This file contains fwrite and fread. 5 5
+8 -6
sources/stdget_console.c C Libraries/sources/stdio .c files/stdget_console.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 ··· 31 31 32 32 int (*_key_int_sig_func_)() = 0; 33 33 34 - #define AutoInt7 (*(long*) 0x7C) 35 - #define ROMBase (*(long*) 0x2AE) 36 - #define MaskPtr (*(long*) 0x31A) 34 + extern long ATrapHandler : 0x28; 35 + extern long ROMBase : 0x2AE; 36 + extern long Lo3Bytes : 0x31A; 37 + 38 + #define DebuggerIn() ((ATrapHandler & Lo3Bytes) < (ROMBase & Lo3Bytes)) 37 39 38 40 /* pdg - 6/18/86 - completely revised command character handling of the 39 41 following function to allow control characters to be ··· 167 169 /* call debugger if loaded, then 168 170 (or otherwise) depart */ 169 171 170 - if ((AutoInt7 & MaskPtr) < ROMBase) 171 - DebugStr("\pSIGDFL reset!"); 172 + if (DebuggerIn()) 173 + Debugger(); 172 174 173 175 ExitToShell(); 174 176 }
+2 -2
sources/stdgets.c C Libraries/sources/stdio .c files/stdgets.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 ··· 50 50 c = _get_char_from_keyboard(); 51 51 52 52 if ((_echo) && (c != EOF)) 53 - putch(c); 53 + fputc(c, who); 54 54 return(c); 55 55 } 56 56
sources/stdio.h C Libraries/headers/stdio.h
+1 -1
sources/stdmax_min.c C Libraries/sources/stdio .c files/stdmax_min.c
··· 1 1 /* 2 - max and min routines for LightspeedC� 2 + max and min routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stdopen.c C Libraries/sources/stdio .c files/stdopen.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */
+1 -1
sources/stdput_console.c C Libraries/sources/stdio .c files/stdput_console.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5
+1 -1
sources/stdputs.c C Libraries/sources/stdio .c files/stdputs.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5
+4 -4
sources/stdto..x.c C Libraries/sources/stdio .c files/stdto..x.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1985, 1986. THINK Technologies, Inc. All rights reserved. 5 5 */ ··· 21 21 if (! isxdigit(c)) 22 22 return(-1); 23 23 24 - if (isxdigit(c)) 25 - return(c-30); 24 + if (isdigit(c)) 25 + return(c-'0'); 26 26 else 27 - return(toupper(c)-55); 27 + return(toupper(c)-'A'+10); 28 28 } 29 29 30 30 #line 0 toupper()
+4 -6
sources/stdver.c C Libraries/sources/stdio .c files/stdver.c
··· 1 1 /* 2 - Routines for LightspeedC� 2 + Routines for LightspeedC 3 3 4 4 (C) Copyright 1986. THINK Technologies, Inc. All rights reserved. 5 5 ··· 10 10 perfectly usable function that returns a pointer to a string that 11 11 contains the version of standard i/o */ 12 12 13 - #define STDIO_VERSION "LightspeedC� Libraries 1.57" 14 - 15 13 /* return the library version number of stdio */ 16 - 17 14 18 15 #line 0 std_ver() 19 16 char *std_ver() 20 17 { 18 + static char STDIO_VERSION[] = "LightspeedC Libraries 2.15"; 19 + static char copyright[] = "(C) 1986 THINK Technologies, Inc. All rights reserved."; 20 + 21 21 return (STDIO_VERSION); 22 - 23 - "(C) Copyright 1986 THINK Technologies,Inc. All rights reserved"; 24 22 }
+14 -3
sources/storage.c C Libraries/sources/storage .c files/storage.c
··· 96 96 char *ptr; 97 97 unsigned long newsize; 98 98 { 99 + unsigned long oldsize; 100 + char *pnew; 101 + 99 102 SetPtrSize(ptr, newsize); 100 - 101 - /* return new pointer */ 102 103 103 - return (MemErr ? NULL : ptr); 104 + if (MemError()) { 105 + pnew = NewPtr(newsize); 106 + if (MemError()) return (NULL); 107 + oldsize = GetPtrSize(ptr); 108 + if (oldsize < newsize) 109 + BlockMove(ptr, pnew, oldsize); 110 + else 111 + BlockMove(ptr, pnew, newsize); 112 + DisposPtr(ptr); 113 + return(pnew); 114 + } else return (ptr); 104 115 } 105 116 106 117
sources/storage.h C Libraries/headers/storage.h
sources/storageu.c C Libraries/sources/storage .c files/storageu.c
sources/storageu.h C Libraries/headers/storageu.h
sources/strings.c C Libraries/sources/strings .c files/strings.c
sources/strings.h C Libraries/headers/strings.h
sources/stringsasm.c C Libraries/sources/strings .c files/stringsasm.c
sources/time.h C Libraries/headers/time.h
sources/types.h C Libraries/headers/types.h
-133
sources/unix main.c
··· 1 - /************************************************************************* 2 - * * 3 - * Module: unix main.c * 4 - * Programmer: Steve Adams * 5 - * * 6 - * (C) Copyright 1985, THINK Technologies, Inc. All rights reserved. * 7 - * * 8 - * Alternate main program to handle Unix command lines under Lightspeed * 9 - * C. The user is prompted for the command line on program entry. The * 10 - * line is disected and placed in an "argv" array up to a maximum of * 11 - * MAX_ARGS entries. I/O redirection is also supported, as follows: * 12 - * * 13 - * > redirects stdout to following file name * 14 - * < redirects stdin to following file name * 15 - * >> redirects stderr to following file name * 16 - * * 17 - * File names following a redirection may be immediately after the * 18 - * redirector, or at what appears to be the next argument. If a file * 19 - * open error occurs, then the program calls "SysBeep" and exits to the * 20 - * shell. * 21 - * * 22 - * TO USE: change the "main" function in you application to "_main" and * 23 - * include this file in your project. * 24 - * * 25 - *************************************************************************/ 26 - 27 - 28 - #include <stdio.h> 29 - #include <ctype.h> 30 - 31 - #define MAX_ARGS 50 32 - 33 - #ifndef true 34 - #define true 1 35 - #define false 0 36 - #endif 37 - 38 - static int argc = 1; /* final argument count */ 39 - static char *argv[MAX_ARGS] = { "" }; /* array of pointers */ 40 - static char command[256]; /* input line buffer */ 41 - static int filename = false; /* TRUE iff file name */ 42 - 43 - 44 - /************************************************************************* 45 - * * 46 - * Local routine to make a "beep" and exit to the shell. * 47 - * * 48 - *************************************************************************/ 49 - 50 - static void punt() 51 - { 52 - SysBeep( 5L ); 53 - ExitToShell(); 54 - } 55 - 56 - 57 - /************************************************************************* 58 - * * 59 - * Local routine to open a file in argv[--argc] after closing it's * 60 - * previous existance. * 61 - * * 62 - *************************************************************************/ 63 - 64 - 65 - static void openfile( file, mode ) 66 - char *mode; /* mode for file open */ 67 - FILE *file; /* file pointer to use */ 68 - { 69 - 70 - if ( (file = freopen( argv[--argc], mode, file ) ) <= (FILE *) NULL) 71 - punt(); 72 - filename = false; 73 - } 74 - 75 - 76 - /************************************************************************* 77 - * * 78 - * New main routine. Prompts for command line then calls user's main * 79 - * now called "_main" with the argument list and redirected I/O. * 80 - * * 81 - *************************************************************************/ 82 - 83 - 84 - void main() 85 - { 86 - char c; /* temp for EOLN check */ 87 - register char *cp; /* index in command line */ 88 - char *mode; /* local file mode */ 89 - FILE *file; /* file to change */ 90 - int i; 91 - 92 - printf( "Enter Unix command line:\n" ); 93 - gets( &command ); /* allow user to edit */ 94 - cp = &command[0]; /* start of buffer */ 95 - argv[0] = ""; /* program name is NULL */ 96 - while (argc < MAX_ARGS) 97 - { /* up to MAX_ARGS entries */ 98 - while (isspace( *cp++ )); 99 - if ( !*--cp ) 100 - break; 101 - else if ( *cp == '<' ) 102 - { /* redirect stdin */ 103 - cp++; 104 - file = stdin; 105 - mode = "r"; 106 - filename = true; 107 - } 108 - else if ( *cp == '>' ) 109 - { 110 - mode = "w"; 111 - filename = true; 112 - if (*++cp == '>') 113 - { 114 - file = stderr; 115 - cp++; 116 - } 117 - else 118 - file = stdout; 119 - } 120 - else 121 - { /* either an argument or a filename */ 122 - argv[argc++] = cp; 123 - while ( *++cp && !isspace( *cp ) ); 124 - c = *cp; 125 - *cp++ = '\0'; 126 - if (filename) 127 - openfile( file, mode ); 128 - if (!c) 129 - break; 130 - } 131 - } 132 - _main( argc, argv ); 133 - }
sources/unix.h C Libraries/headers/unix.h
sources/unix2.c C Libraries/sources/unix .c files/unix2.c
sources/unix3.c C Libraries/sources/unix .c files/unix3.c
sources/unix_strings.c C Libraries/sources/strings .c files/unix_strings.c
sources/unixatof.c C Libraries/sources/unix .c files/unixatof.c
sources/unixatox.c C Libraries/sources/unix .c files/unixatox.c
sources/unixexec.c C Libraries/sources/unix .c files/unixexec.c
+7 -5
sources/unixexit.c C Libraries/sources/unix .c files/unixexit.c
··· 26 26 ExitToShell(); 27 27 } 28 28 29 - #define AutoInt7 (*(long*) 0x7C) 30 - #define ROMBase (*(long*) 0x2AE) 31 - #define MaskPtr (*(long*) 0x31A) 29 + extern long ATrapHandler : 0x28; 30 + extern long ROMBase : 0x2AE; 31 + extern long Lo3Bytes : 0x31A; 32 + 33 + #define DebuggerIn() ((ATrapHandler & Lo3Bytes) < (ROMBase & Lo3Bytes)) 32 34 33 35 #line 0 abort 34 36 35 37 void abort() 36 38 { 37 39 38 - if ((AutoInt7 & MaskPtr) < ROMBase) 39 - DebugStr("\pAbort"); 40 + if (DebuggerIn()) 41 + Debugger(); 40 42 41 43 ExitToShell(); 42 44 }
+7 -6
sources/unixfileio.c C Libraries/sources/unix .c files/unixfileio.c
··· 188 188 char *filename; 189 189 int mode; 190 190 { 191 - int fildes; 192 191 char *type; 192 + FILE *who; 193 193 194 194 if (findfreefileref() == -1) 195 195 { ··· 200 200 if ((type = cvtmode(mode,filename)) == NULL) 201 201 return(-1); 202 202 203 - if (fildes = fopen(filename, type)->fileno) 204 - return (fildes); 205 - 206 - errno = EACCES; 207 - return (-1); 203 + if ((who = fopen(filename, type))==NULL) 204 + { 205 + errno = errno == fnfErr ? ENOENT : EACCES; 206 + return(-1); 207 + } 208 + return (who->fileno); 208 209 } 209 210 210 211 #line 0 close
sources/unixid.c C Libraries/sources/unix .c files/unixid.c
sources/unixmem.c C Libraries/sources/unix .c files/unixmem.c
sources/unixplot.c C Libraries/sources/unix .c files/unixplot.c
+6 -1
sources/unixsetbuf.c C Libraries/sources/unix .c files/unixsetbuf.c
··· 14 14 register FILE *fp; 15 15 char *buf; 16 16 { 17 + if (fp -> window) return(0); 18 + 17 19 if (buf == NULL) 18 20 return(setnbuf(fp)); 19 21 20 22 if (! fp->user_buf) 21 23 { 22 - DisposPtr(fp->filebuf); 24 + if (fp->filebuf) 25 + DisposPtr(fp->filebuf); 23 26 fp->user_buf = true; 24 27 } 25 28 ··· 35 38 register FILE *fp; 36 39 { 37 40 Ptr p; 41 + 42 + if (fp ->window) return(0); 38 43 39 44 if (! fp->user_buf) 40 45 return(0);
+7 -5
sources/unixsignal.c C Libraries/sources/unix .c files/unixsignal.c
··· 13 13 static void *sigptr[_SIGMAX+1]; /* array of signal pointers, initially 0 */ 14 14 static char _initsigterm = 0; /* flag for special SIGTERM set up */ 15 15 16 - #define AutoInt7 (*(long*) 0x7C) 17 - #define ROMBase (*(long*) 0x2AE) 18 - #define MaskPtr (*(long*) 0x31A) 16 + extern long ATrapHandler : 0x28; 17 + extern long ROMBase : 0x2AE; 18 + extern long Lo3Bytes : 0x31A; 19 + 20 + #define DebuggerIn() ((ATrapHandler & Lo3Bytes) < (ROMBase & Lo3Bytes)) 19 21 20 22 #line 0 bugout 21 23 ··· 23 25 { 24 26 /* call debugger if loaded, then (or otherwise) depart */ 25 27 26 - if ((AutoInt7 & MaskPtr) < ROMBase) 27 - DebugStr("\pSIGDFL exit!"); 28 + if (DebuggerIn()) 29 + Debugger(); 28 30 29 31 ExitToShell(); 30 32 }
sources/unixst2d.c C Libraries/sources/unix .c files/unixst2d.c
sources/unixst2i.c C Libraries/sources/unix .c files/unixst2i.c
sources/unixtime.c C Libraries/sources/unix .c files/unixtime.c