home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c006 / 1.ddi / FDGETS.C < prev    next >
DOS BACKUP file  |  1987-11-04  |  1.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: DOS BACKUP file (archive/dosBackupFile).

You can browse this item here: FDGETS.C

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert DOS BACKUP file (archive/dosBackupFile) magic Supported
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
100% file DOS 2.0-3.2 backed up file \CBTREE\LIBRARY\FDGETS.C default
99% file data default
51% TrID DOS 2.0-3.2 backup default
48% TrID MP3 audio default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| ff 01 00 00 00 5c 43 42 | 54 52 45 45 5c 4c 49 42 |.....\CB|TREE\LIB|
|00000010| 52 41 52 59 5c 46 44 47 | 45 54 53 2e 43 00 00 00 |RARY\FDG|ETS.C...|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 19 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 20 28 43 29 20 43 | 6f 70 79 72 69 67 68 74 |/* (C) C|opyright|
|00000090| 20 31 39 38 34 2c 38 35 | 2c 38 36 2c 38 37 20 57 | 1984,85|,86,87 W|
|000000a0| 61 6c 74 65 72 20 4c 2e | 20 50 65 61 63 6f 63 6b |alter L.| Peacock|
|000000b0| 20 20 20 41 6c 6c 20 52 | 69 67 68 74 73 20 52 65 | All R|ights Re|
|000000c0| 73 65 72 76 65 64 20 20 | 20 2a 2f 0d 0a 2f 2a 2a |served | */../**|
|000000d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000100| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000110| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0d 0a 20 2a 0d 0a |********|**.. *..|
|00000120| 20 2a 20 20 20 66 64 67 | 65 74 73 2e 63 20 20 2d | * fdg|ets.c -|
|00000130| 2d 20 20 67 65 74 20 61 | 20 73 74 72 69 6e 67 20 |- get a| string |
|00000140| 66 72 6f 6d 20 6c 6f 77 | 20 6c 65 76 65 6c 20 66 |from low| level f|
|00000150| 69 6c 65 0d 0a 20 2a 0d | 0a 20 2a 2f 0d 0a 0d 0a |ile.. *.|. */....|
|00000160| 23 69 6e 63 6c 75 64 65 | 20 22 63 62 74 72 65 65 |#include| "cbtree|
|00000170| 2e 68 22 0d 0a 0d 0a 23 | 69 66 6e 64 65 66 20 45 |.h"....#|ifndef E|
|00000180| 4f 46 0d 0a 23 64 65 66 | 69 6e 65 20 45 4f 46 20 |OF..#def|ine EOF |
|00000190| 28 2d 31 29 0d 0a 23 65 | 6e 64 69 66 0d 0a 0d 0a |(-1)..#e|ndif....|
|000001a0| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|000001b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0d 0a 0d 0a |********|***/....|
|000001f0| 63 68 61 72 20 20 20 2a | 66 64 67 65 74 73 28 62 |char *|fdgets(b|
|00000200| 75 66 2c 20 6e 2c 20 66 | 64 29 20 20 20 2f 2a 20 |uf, n, f|d) /* |
|00000210| 67 65 74 20 61 20 73 74 | 72 69 6e 67 20 74 69 6c |get a st|ring til|
|00000220| 6c 20 5c 6e 3a 20 6e 65 | 77 6c 69 6e 65 20 4e 4f |l \n: ne|wline NO|
|00000230| 54 20 69 6e 63 6c 75 64 | 65 64 20 21 20 2a 2f 0d |T includ|ed ! */.|
|00000240| 0a 0d 0a 2f 2a 0d 0a 20 | 2a 20 20 20 4e 4f 54 45 |.../*.. |* NOTE|
|00000250| 3a 20 20 20 70 72 6f 67 | 72 61 6d 6d 65 72 20 69 |: prog|rammer i|
|00000260| 73 20 72 65 73 70 6f 6e | 73 69 62 6c 65 20 74 6f |s respon|sible to|
|00000270| 20 6d 61 6b 65 20 73 75 | 72 65 20 62 75 66 66 65 | make su|re buffe|
|00000280| 72 20 69 73 20 42 49 47 | 20 45 4e 4f 55 47 48 21 |r is BIG| ENOUGH!|
|00000290| 21 0d 0a 20 2a 0d 0a 20 | 2a 2f 0d 0a 63 68 61 72 |!.. *.. |*/..char|
|000002a0| 20 20 20 2a 62 75 66 3b | 0d 0a 69 6e 74 20 6e 3b | *buf;|..int n;|
|000002b0| 0d 0a 69 6e 74 20 66 64 | 3b 0d 0a 7b 0d 0a 20 20 |..int fd|;..{.. |
|000002c0| 20 65 78 74 65 72 6e 20 | 69 6e 74 20 66 64 67 65 | extern |int fdge|
|000002d0| 74 63 28 29 3b 0d 0a 20 | 20 20 72 65 67 69 73 74 |tc();.. | regist|
|000002e0| 65 72 20 69 6e 74 20 63 | 3b 0d 0a 20 20 20 72 65 |er int c|;.. re|
|000002f0| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 73 3b 0d |gister c|har *s;.|
|00000300| 0a 0d 0a 20 20 20 73 20 | 3d 20 62 75 66 3b 20 20 |... s |= buf; |
|00000310| 20 2f 2a 20 6d 75 73 74 | 20 62 65 20 70 75 74 20 | /* must| be put |
|00000320| 68 65 72 65 20 66 6f 72 | 20 45 43 20 2a 2f 0d 0a |here for| EC */..|
|00000330| 20 20 20 77 68 69 6c 65 | 20 28 6e 20 21 3d 20 30 | while| (n != 0|
|00000340| 20 26 26 20 28 63 20 3d | 20 66 64 67 65 74 63 28 | && (c =| fdgetc(|
|00000350| 66 64 29 29 20 21 3d 20 | 45 4f 46 20 20 26 26 20 |fd)) != |EOF && |
|00000360| 20 63 20 21 3d 20 27 5c | 6e 27 29 0d 0a 20 20 20 | c != '\|n').. |
|00000370| 20 20 20 69 66 20 28 63 | 20 21 3d 20 27 5c 72 27 | if (c| != '\r'|
|00000380| 29 20 20 20 2f 2a 20 61 | 63 74 20 6c 69 6b 65 20 |) /* a|ct like |
|00000390| 61 73 63 69 69 20 6d 6f | 64 65 20 61 6e 64 20 74 |ascii mo|de and t|
|000003a0| 68 72 6f 77 20 6f 75 74 | 20 63 61 72 72 69 61 67 |hrow out| carriag|
|000003b0| 65 20 72 65 74 75 72 6e | 73 20 2a 2f 0d 0a 20 20 |e return|s */.. |
|000003c0| 20 20 20 20 7b 0d 0a 20 | 20 20 20 20 20 20 20 20 | {.. | |
|000003d0| 2a 73 2b 2b 20 3d 20 63 | 3b 0d 0a 20 20 20 20 20 |*s++ = c|;.. |
|000003e0| 20 20 20 20 6e 2d 2d 3b | 0d 0a 20 20 20 20 20 20 | n--;|.. |
|000003f0| 7d 0d 0a 20 20 20 69 66 | 20 28 6e 20 21 3d 20 2d |}.. if| (n != -|
|00000400| 31 29 0d 0a 20 20 20 20 | 20 20 2a 73 20 3d 20 27 |1).. | *s = '|
|00000410| 5c 30 27 3b 0d 0a 20 20 | 20 72 65 74 75 72 6e 20 |\0';.. | return |
|00000420| 28 63 20 3d 3d 20 45 4f | 46 20 26 26 20 73 20 3d |(c == EO|F && s =|
|00000430| 3d 20 62 75 66 20 3f 20 | 28 63 68 61 72 20 2a 29 |= buf ? |(char *)|
|00000440| 4e 55 4c 4c 20 3a 20 62 | 75 66 29 3b 0d 0a 7d 0d |NULL : b|uf);..}.|
|00000450| 0a 0d 0a 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0d 0a 0d |.../****|****/...|
|00000460| 0a 66 64 67 65 74 63 28 | 66 64 29 20 20 20 2f 2a |.fdgetc(|fd) /*|
|00000470| 20 67 65 74 20 63 68 61 | 72 20 66 72 6f 6d 20 73 | get cha|r from s|
|00000480| 70 65 63 69 66 69 65 64 | 20 6c 6f 77 2d 6c 65 76 |pecified| low-lev|
|00000490| 65 6c 20 66 69 6c 65 20 | 2a 2f 0d 0a 0d 0a 69 6e |el file |*/....in|
|000004a0| 74 20 66 64 3b 0d 0a 0d | 0a 7b 0d 0a 20 20 20 63 |t fd;...|.{.. c|
|000004b0| 68 61 72 20 63 3b 0d 0a | 0d 0a 20 20 20 69 66 20 |har c;..|.. if |
|000004c0| 28 72 65 61 64 28 66 64 | 2c 20 26 63 2c 20 31 29 |(read(fd|, &c, 1)|
|000004d0| 20 3d 3d 20 45 52 52 29 | 20 20 20 2f 2a 20 61 73 | == ERR)| /* as|
|000004e0| 73 75 6d 65 20 73 65 71 | 75 65 6e 74 69 61 6c 20 |sume seq|uential |
|000004f0| 72 65 61 64 20 2a 2f 0d | 0a 20 20 20 20 20 20 72 |read */.|. r|
|00000500| 65 74 75 72 6e 20 28 45 | 4f 46 29 3b 0d 0a 20 20 |eturn (E|OF);.. |
|00000510| 20 72 65 74 75 72 6e 20 | 28 28 69 6e 74 29 63 29 | return |((int)c)|
|00000520| 3b 0d 0a 7d 0d 0a | |;..}.. | |
+--------+-------------------------+-------------------------+--------+--------+