home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Multimedia / Q-Z / VCR+(app+src).sit / Sources / validateEntry.c < prev    next >
MacBinary  |  1993-03-17  |  2.5 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Mar 17 22:59:27 1993, modified Wed Mar 17 22:59:27 1993, creator Think C, type ASCII, 1972 bytes "validateEntry.c" , at 0x834 348 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 76 61 6c 69 64 61 | 74 65 45 6e 74 72 79 2e |..valida|teEntry.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |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 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 07 b4 00 | 00 01 5c a7 cd a4 1f a7 |........|..\.....|
|00000060| cd a4 1f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fb 1c 00 00 |........|........|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 56 43 52 70 6c 75 |#include| "VCRplu|
|00000090| 73 2e 68 22 0d 0d 65 78 | 74 65 72 6e 09 76 63 72 |s.h"..ex|tern.vcr|
|000000a0| 49 6e 66 6f 09 6d 79 56 | 43 52 3b 0d 65 78 74 65 |Info.myV|CR;.exte|
|000000b0| 72 6e 09 6c 6f 6e 67 09 | 09 43 4f 44 45 5f 56 41 |rn.long.|.CODE_VA|
|000000c0| 4c 55 45 3b 0d 0d 42 6f | 6f 6c 65 61 6e 20 76 61 |LUE;..Bo|olean va|
|000000d0| 6c 69 64 61 74 65 45 6e | 74 72 79 28 73 68 6f 72 |lidateEn|try(shor|
|000000e0| 74 20 65 6e 74 72 79 54 | 79 70 65 29 0d 7b 0d 09 |t entryT|ype).{..|
|000000f0| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 09 09 74 |unsigned| long..t|
|00000100| 65 6d 70 4c 6f 6e 67 2c | 20 74 65 6d 70 4c 6f 6e |empLong,| tempLon|
|00000110| 67 32 3b 0d 09 53 74 72 | 33 32 09 73 63 72 61 74 |g2;..Str|32.scrat|
|00000120| 63 68 3b 0d 09 0d 09 69 | 66 20 28 65 6e 74 72 79 |ch;....i|f (entry|
|00000130| 54 79 70 65 20 3d 3d 20 | 44 45 43 4f 44 45 29 0d |Type == |DECODE).|
|00000140| 09 7b 0d 09 09 53 65 74 | 44 54 65 78 74 28 64 6c |.{...Set|DText(dl|
|00000150| 67 43 48 41 4e 4e 45 4c | 2c 22 5c 70 22 29 3b 0d |gCHANNEL|,"\p");.|
|00000160| 09 09 53 65 74 44 54 65 | 78 74 28 64 6c 67 53 54 |..SetDTe|xt(dlgST|
|00000170| 41 52 54 54 49 4d 45 2c | 22 5c 70 22 29 3b 0d 09 |ARTTIME,|"\p");..|
|00000180| 09 53 65 74 44 54 65 78 | 74 28 64 6c 67 44 55 52 |.SetDTex|t(dlgDUR|
|00000190| 41 54 49 4f 4e 2c 22 5c | 70 22 29 3b 0d 09 09 0d |ATION,"\|p");....|
|000001a0| 09 09 47 65 74 44 54 65 | 78 74 28 64 6c 67 50 4c |..GetDTe|xt(dlgPL|
|000001b0| 55 53 43 4f 44 45 2c 20 | 73 63 72 61 74 63 68 29 |USCODE, |scratch)|
|000001c0| 3b 0d 09 09 53 74 72 69 | 6e 67 54 6f 4e 75 6d 28 |;...Stri|ngToNum(|
|000001d0| 73 63 72 61 74 63 68 2c | 20 26 74 65 6d 70 4c 6f |scratch,| &tempLo|
|000001e0| 6e 67 29 3b 0d 09 0d 09 | 09 69 66 28 20 28 74 65 |ng);....|.if( (te|
|000001f0| 6d 70 4c 6f 6e 67 3c 31 | 29 20 7c 7c 20 28 74 65 |mpLong<1|) || (te|
|00000200| 6d 70 4c 6f 6e 67 3e 39 | 39 39 39 39 39 4c 29 20 |mpLong>9|99999L) |
|00000210| 29 0d 09 09 7b 20 53 65 | 74 44 54 65 78 74 28 31 |)...{ Se|tDText(1|
|00000220| 39 2c 22 5c 70 43 61 6e | 6e 6f 74 20 70 72 6f 63 |9,"\pCan|not proc|
|00000230| 65 73 73 20 74 68 61 74 | 20 56 43 52 20 70 6c 75 |ess that| VCR plu|
|00000240| 73 20 63 6f 64 65 20 28 | 6d 75 73 74 20 62 65 20 |s code (|must be |
|00000250| 3c 3d 20 36 20 64 69 67 | 69 74 73 29 21 22 29 3b |<= 6 dig|its)!");|
|00000260| 20 72 65 74 75 72 6e 20 | 46 41 4c 53 45 3b 20 7d | return |FALSE; }|
|00000270| 0d 0d 09 09 6d 79 56 43 | 52 2e 63 6f 64 65 20 3d |....myVC|R.code =|
|00000280| 20 74 65 6d 70 4c 6f 6e | 67 3b 0d 09 09 43 4f 44 | tempLon|g;...COD|
|00000290| 45 5f 56 41 4c 55 45 20 | 3d 20 4b 45 59 30 30 31 |E_VALUE |= KEY001|
|000002a0| 3b 0d 09 7d 0d 09 65 6c | 73 65 0d 09 7b 0d 09 09 |;..}..el|se..{...|
|000002b0| 53 65 74 44 54 65 78 74 | 28 64 6c 67 50 4c 55 53 |SetDText|(dlgPLUS|
|000002c0| 43 4f 44 45 2c 22 5c 70 | 22 29 3b 0d 0d 09 09 47 |CODE,"\p|");....G|
|000002d0| 65 74 44 54 65 78 74 28 | 64 6c 67 43 48 41 4e 4e |etDText(|dlgCHANN|
|000002e0| 45 4c 2c 20 73 63 72 61 | 74 63 68 29 3b 0d 09 09 |EL, scra|tch);...|
|000002f0| 53 74 72 69 6e 67 54 6f | 4e 75 6d 28 73 63 72 61 |StringTo|Num(scra|
|00000300| 74 63 68 2c 20 26 74 65 | 6d 70 4c 6f 6e 67 29 3b |tch, &te|mpLong);|
|00000310| 0d 09 0d 09 09 69 66 28 | 20 28 74 65 6d 70 4c 6f |.....if(| (tempLo|
|00000320| 6e 67 3c 31 29 20 7c 7c | 20 28 74 65 6d 70 4c 6f |ng<1) ||| (tempLo|
|00000330| 6e 67 3e 34 38 29 20 29 | 0d 09 09 7b 20 53 65 74 |ng>48) )|...{ Set|
|00000340| 44 54 65 78 74 28 31 39 | 2c 22 5c 70 49 6e 76 61 |DText(19|,"\pInva|
|00000350| 6c 69 64 20 63 68 61 6e | 6e 65 6c 20 6e 75 6d 62 |lid chan|nel numb|
|00000360| 65 72 22 29 3b 20 72 65 | 74 75 72 6e 20 46 41 4c |er"); re|turn FAL|
|00000370| 53 45 3b 20 7d 0d 09 09 | 0d 09 09 6d 79 56 43 52 |SE; }...|...myVCR|
|00000380| 2e 63 68 61 6e 6e 65 6c | 20 3d 20 74 65 6d 70 4c |.channel| = tempL|
|00000390| 6f 6e 67 3b 0d 09 0d 09 | 09 47 65 74 44 54 65 78 |ong;....|.GetDTex|
|000003a0| 74 28 64 6c 67 53 54 41 | 52 54 54 49 4d 45 2c 20 |t(dlgSTA|RTTIME, |
|000003b0| 73 63 72 61 74 63 68 29 | 3b 0d 09 09 53 74 72 69 |scratch)|;...Stri|
|000003c0| 6e 67 54 6f 4e 75 6d 28 | 73 63 72 61 74 63 68 2c |ngToNum(|scratch,|
|000003d0| 20 26 74 65 6d 70 4c 6f | 6e 67 29 3b 0d 09 0d 09 | &tempLo|ng);....|
|000003e0| 09 74 65 6d 70 4c 6f 6e | 67 32 20 3d 20 74 65 6d |.tempLon|g2 = tem|
|000003f0| 70 4c 6f 6e 67 20 25 20 | 31 30 30 3b 0d 09 09 69 |pLong % |100;...i|
|00000400| 66 28 28 74 65 6d 70 4c | 6f 6e 67 32 20 21 3d 20 |f((tempL|ong2 != |
|00000410| 30 29 20 26 26 20 28 74 | 65 6d 70 4c 6f 6e 67 32 |0) && (t|empLong2|
|00000420| 20 21 3d 20 33 30 29 29 | 0d 09 09 7b 20 53 65 74 | != 30))|...{ Set|
|00000430| 44 54 65 78 74 28 31 39 | 2c 22 5c 70 53 74 61 72 |DText(19|,"\pStar|
|00000440| 74 20 74 69 6d 65 20 6d | 75 73 74 20 62 65 20 6f |t time m|ust be o|
|00000450| 6e 20 61 6e 20 68 6f 75 | 72 20 6f 72 20 68 61 6c |n an hou|r or hal|
|00000460| 66 20 68 6f 75 72 21 22 | 29 3b 20 72 65 74 75 72 |f hour!"|); retur|
|00000470| 6e 20 46 41 4c 53 45 3b | 20 7d 0d 09 0d 09 09 69 |n FALSE;| }.....i|
|00000480| 66 28 28 74 65 6d 70 4c | 6f 6e 67 20 3c 20 30 29 |f((tempL|ong < 0)|
|00000490| 20 7c 7c 20 28 74 65 6d | 70 4c 6f 6e 67 20 3e 20 | || (tem|pLong > |
|000004a0| 32 33 33 30 29 29 0d 09 | 09 7b 20 53 65 74 44 54 |2330))..|.{ SetDT|
|000004b0| 65 78 74 28 31 39 2c 22 | 5c 70 53 74 61 72 74 20 |ext(19,"|\pStart |
|000004c0| 74 69 6d 65 20 6d 75 73 | 74 20 62 65 20 69 6e 20 |time mus|t be in |
|000004d0| 66 6f 72 6d 61 74 3a 20 | 31 38 30 30 20 66 6f 72 |format: |1800 for|
|000004e0| 20 36 70 6d 22 29 3b 20 | 72 65 74 75 72 6e 20 46 | 6pm"); |return F|
|000004f0| 41 4c 53 45 3b 20 7d 0d | 09 09 0d 09 09 6d 79 56 |ALSE; }.|.....myV|
|00000500| 43 52 2e 73 74 61 72 74 | 54 69 6d 65 20 3d 20 74 |CR.start|Time = t|
|00000510| 65 6d 70 4c 6f 6e 67 3b | 0d 09 0d 09 09 47 65 74 |empLong;|.....Get|
|00000520| 44 54 65 78 74 28 64 6c | 67 44 55 52 41 54 49 4f |DText(dl|gDURATIO|
|00000530| 4e 2c 20 73 63 72 61 74 | 63 68 29 3b 0d 09 09 53 |N, scrat|ch);...S|
|00000540| 74 72 69 6e 67 54 6f 4e | 75 6d 28 73 63 72 61 74 |tringToN|um(scrat|
|00000550| 63 68 2c 20 26 74 65 6d | 70 4c 6f 6e 67 29 3b 0d |ch, &tem|pLong);.|
|00000560| 09 0d 09 09 74 65 6d 70 | 4c 6f 6e 67 32 20 3d 20 |....temp|Long2 = |
|00000570| 74 65 6d 70 4c 6f 6e 67 | 20 25 20 33 30 3b 0d 09 |tempLong| % 30;..|
|00000580| 09 69 66 28 28 74 65 6d | 70 4c 6f 6e 67 32 21 3d |.if((tem|pLong2!=|
|00000590| 30 29 20 7c 7c 20 28 74 | 65 6d 70 4c 6f 6e 67 3c |0) || (t|empLong<|
|000005a0| 33 30 29 20 7c 7c 20 28 | 74 65 6d 70 4c 6f 6e 67 |30) || (|tempLong|
|000005b0| 3e 33 30 30 29 29 0d 09 | 09 7b 20 53 65 74 44 54 |>300))..|.{ SetDT|
|000005c0| 65 78 74 28 31 39 2c 22 | 5c 70 53 6f 72 72 79 2c |ext(19,"|\pSorry,|
|000005d0| 20 49 20 63 61 6e 74 20 | 70 72 6f 63 65 73 73 20 | I cant |process |
|000005e0| 74 68 61 74 20 70 72 6f | 67 72 61 6d 20 6c 65 6e |that pro|gram len|
|000005f0| 67 74 68 5c 6e 22 29 3b | 20 72 65 74 75 72 6e 20 |gth\n");| return |
|00000600| 46 41 4c 53 45 3b 20 7d | 0d 09 09 0d 09 09 6d 79 |FALSE; }|......my|
|00000610| 56 43 52 2e 64 75 72 61 | 74 69 6f 6e 20 3d 20 74 |VCR.dura|tion = t|
|00000620| 65 6d 70 4c 6f 6e 67 3b | 0d 09 09 43 4f 44 45 5f |empLong;|...CODE_|
|00000630| 56 41 4c 55 45 20 3d 20 | 4b 45 59 30 30 32 3b 0d |VALUE = |KEY002;.|
|00000640| 09 7d 0d 09 0d 09 47 65 | 74 44 54 65 78 74 28 64 |.}....Ge|tDText(d|
|00000650| 6c 67 4d 4f 4e 54 48 2c | 20 73 63 72 61 74 63 68 |lgMONTH,| scratch|
|00000660| 29 3b 0d 09 53 74 72 69 | 6e 67 54 6f 4e 75 6d 28 |);..Stri|ngToNum(|
|00000670| 73 63 72 61 74 63 68 2c | 20 26 74 65 6d 70 4c 6f |scratch,| &tempLo|
|00000680| 6e 67 29 3b 0d 0d 09 69 | 66 20 28 28 74 65 6d 70 |ng);...i|f ((temp|
|00000690| 4c 6f 6e 67 3e 31 32 29 | 20 7c 7c 20 28 74 65 6d |Long>12)| || (tem|
|000006a0| 70 4c 6f 6e 67 3c 31 29 | 29 0d 09 7b 20 53 65 74 |pLong<1)|)..{ Set|
|000006b0| 44 54 65 78 74 28 31 39 | 2c 22 5c 70 49 6e 76 61 |DText(19|,"\pInva|
|000006c0| 6c 69 64 20 6d 6f 6e 74 | 68 20 28 6d 75 73 74 20 |lid mont|h (must |
|000006d0| 62 65 20 31 2d 31 32 29 | 22 29 3b 20 72 65 74 75 |be 1-12)|"); retu|
|000006e0| 72 6e 20 46 41 4c 53 45 | 3b 20 7d 0d 09 0d 09 6d |rn FALSE|; }....m|
|000006f0| 79 56 43 52 2e 6d 6f 6e | 74 68 20 3d 20 74 65 6d |yVCR.mon|th = tem|
|00000700| 70 4c 6f 6e 67 3b 0d 0d | 09 47 65 74 44 54 65 78 |pLong;..|.GetDTex|
|00000710| 74 28 64 6c 67 44 41 59 | 2c 20 73 63 72 61 74 63 |t(dlgDAY|, scratc|
|00000720| 68 29 3b 0d 09 53 74 72 | 69 6e 67 54 6f 4e 75 6d |h);..Str|ingToNum|
|00000730| 28 73 63 72 61 74 63 68 | 2c 20 26 74 65 6d 70 4c |(scratch|, &tempL|
|00000740| 6f 6e 67 29 3b 0d 0d 09 | 69 66 28 28 74 65 6d 70 |ong);...|if((temp|
|00000750| 4c 6f 6e 67 3c 31 29 20 | 7c 7c 20 28 74 65 6d 70 |Long<1) ||| (temp|
|00000760| 4c 6f 6e 67 3e 33 31 29 | 20 29 0d 09 7b 20 53 65 |Long>31)| )..{ Se|
|00000770| 74 44 54 65 78 74 28 31 | 39 2c 22 5c 70 49 6e 76 |tDText(1|9,"\pInv|
|00000780| 61 6c 69 64 20 64 61 79 | 20 28 6d 75 73 74 20 62 |alid day| (must b|
|00000790| 65 20 31 2d 33 31 29 22 | 29 3b 20 72 65 74 75 72 |e 1-31)"|); retur|
|000007a0| 6e 20 46 41 4c 53 45 3b | 20 7d 0d 09 0d 09 6d 79 |n FALSE;| }....my|
|000007b0| 56 43 52 2e 64 61 79 20 | 3d 20 74 65 6d 70 4c 6f |VCR.day |= tempLo|
|000007c0| 6e 67 3b 0d 0d 09 47 65 | 74 44 54 65 78 74 28 64 |ng;...Ge|tDText(d|
|000007d0| 6c 67 59 45 41 52 2c 20 | 73 63 72 61 74 63 68 29 |lgYEAR, |scratch)|
|000007e0| 3b 0d 09 53 74 72 69 6e | 67 54 6f 4e 75 6d 28 73 |;..Strin|gToNum(s|
|000007f0| 63 72 61 74 63 68 2c 20 | 26 74 65 6d 70 4c 6f 6e |cratch, |&tempLon|
|00000800| 67 29 3b 0d 0d 09 6d 79 | 56 43 52 2e 79 65 61 72 |g);...my|VCR.year|
|00000810| 20 3d 20 74 65 6d 70 4c | 6f 6e 67 20 25 20 31 30 | = tempL|ong % 10|
|00000820| 30 3b 0d 0d 09 72 65 74 | 75 72 6e 20 54 52 55 45 |0;...ret|urn TRUE|
|00000830| 3b 0d 7d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.}.....|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000880| 00 00 01 00 00 00 01 16 | 00 00 00 16 00 00 00 46 |........|.......F|
|00000890| 73 2e 68 22 0d 0d 42 6f | 6f 6c 65 61 6e 20 76 61 |s.h"..Bo|olean va|
|000008a0| 6c 69 64 61 74 65 45 6e | 74 72 79 28 76 6f 69 64 |lidateEn|try(void|
|000008b0| 0f 76 61 6c 69 64 61 74 | 65 45 6e 74 72 79 2e 63 |.validat|eEntry.c|
|000008c0| 02 00 00 00 50 61 72 74 | 53 49 54 78 00 00 00 00 |....Part|SITx....|
|000008d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 a9 7e a4 29 00 00 | 00 00 00 00 01 5c 69 6e |...~.)..|.....\in|
|00000900| 74 66 28 22 49 6e 76 61 | 6c 69 64 20 64 61 74 65 |tf("Inva|lid date|
|00000910| 5c 6e 22 29 3b 20 67 6f | 74 6f 20 75 70 63 68 75 |\n"); go|to upchu|
|00000920| 63 6b 3b 20 7d 0d 0d 09 | 69 66 28 20 28 63 68 61 |ck; }...|if( (cha|
|00000930| 6e 6e 65 6c 3c 31 29 20 | 7c 7c 20 28 63 68 61 6e |nnel<1) ||| (chan|
|00000940| 6e 65 6c 3e 34 38 29 20 | 29 0d 09 7b 20 70 72 69 |nel>48) |)..{ pri|
|00000950| 6e 74 66 28 22 49 6e 76 | 61 6c 69 64 20 63 68 61 |ntf("Inv|alid cha|
|00000960| 6e 6e 65 6c 20 6e 75 6d | 62 65 72 5c 6e 22 29 3b |nnel num|ber\n");|
|00000970| 20 67 6f 74 6f 20 75 70 | 63 68 75 63 6b 3b 20 7d | goto up|chuck; }|
|00000980| 00 00 00 04 00 06 00 04 | 00 00 00 0a 00 09 06 47 |........|.......G|
|00000990| 65 6e 65 76 61 00 00 00 | 01 00 00 00 01 16 00 00 |eneva...|........|
|000009a0| 00 16 00 00 00 46 01 17 | 16 bc 08 74 00 00 00 1c |.....F..|...t....|
|000009b0| 00 46 00 01 45 54 41 42 | 00 00 00 12 45 46 4e 54 |.F..ETAB|....EFNT|
|000009c0| 00 00 00 1e 03 ec ff ff | 00 00 00 00 01 17 17 d4 |........|........|
|000009d0| 03 eb ff ff 00 00 00 08 | 01 17 16 04 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+