home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / VideoToolboxSources / GetVersionString.c < prev    next >
MacBinary  |  1995-07-26  |  2.3 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: GetVersionString.c

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, inited, Wed Jul 26 04:16:08 1995, modified Wed Jul 26 04:16:08 1995, creator 'CWIE', type ASCII, 1632 bytes "GetVersionString.c" , at 0x6e0 454 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[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 47 65 74 56 65 72 | 73 69 6f 6e 53 74 72 69 |..GetVer|sionStri|
|00000010| 6e 67 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |ng.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 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 06 60 00 | 00 01 c6 ac 3b aa 48 ac |......`.|....;.H.|
|00000060| 3b aa 48 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.H.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 15 64 00 00 |........|.....d..|
|00000080| 2f 2a 0d 47 65 74 56 65 | 72 73 69 6f 6e 53 74 72 |/*.GetVe|rsionStr|
|00000090| 69 6e 67 2e 63 0d 47 65 | 74 73 20 74 68 65 20 76 |ing.c.Ge|ts the v|
|000000a0| 65 72 73 69 6f 6e 20 6f | 66 20 61 20 70 72 6f 67 |ersion o|f a prog|
|000000b0| 72 61 6d 20 66 72 6f 6d | 20 74 68 65 20 22 53 68 |ram from| the "Sh|
|000000c0| 6f 72 74 20 76 65 72 73 | 69 6f 6e 20 73 74 72 69 |ort vers|ion stri|
|000000d0| 6e 67 22 20 66 69 65 6c | 64 20 6f 66 0d 69 74 73 |ng" fiel|d of.its|
|000000e0| 20 27 76 65 72 73 27 20 | 72 65 73 6f 75 72 63 65 | 'vers' |resource|
|000000f0| 2e 20 54 68 65 20 76 65 | 72 73 69 6f 6e 20 69 73 |. The ve|rsion is|
|00000100| 20 72 65 74 75 72 6e 65 | 64 20 61 73 20 61 20 43 | returne|d as a C|
|00000110| 20 73 74 72 69 6e 67 20 | 61 6c 6c 6f 63 61 74 65 | string |allocate|
|00000120| 64 20 62 79 0d 4e 65 77 | 50 74 72 28 29 2e 20 52 |d by.New|Ptr(). R|
|00000130| 65 74 75 72 6e 73 20 22 | 22 20 69 66 20 74 68 65 |eturns "|" if the|
|00000140| 72 65 20 69 73 20 6e 6f | 20 27 76 65 72 73 27 20 |re is no| 'vers' |
|00000150| 31 20 72 65 73 6f 75 72 | 63 65 2e 20 55 73 65 20 |1 resour|ce. Use |
|00000160| 74 68 69 73 20 74 6f 20 | 64 69 73 70 6c 61 79 20 |this to |display |
|00000170| 0d 79 6f 75 72 20 70 72 | 6f 67 72 61 6d 27 73 20 |.your pr|ogram's |
|00000180| 63 75 72 72 65 6e 74 20 | 76 65 72 73 69 6f 6e 20 |current |version |
|00000190| 6e 75 6d 62 65 72 2e 0d | 0d 43 6f 70 79 72 69 67 |number..|.Copyrig|
|000001a0| 68 74 20 4a 6f 73 65 70 | 68 20 4c 61 66 66 65 79 |ht Josep|h Laffey|
|000001b0| 2c 20 31 39 39 33 2e 20 | 59 6f 75 20 6d 61 79 20 |, 1993. |You may |
|000001c0| 75 73 65 20 74 68 69 73 | 20 63 6f 64 65 20 73 6e |use this| code sn|
|000001d0| 69 70 70 65 74 20 69 6e | 20 61 6e 79 74 68 69 6e |ippet in| anythin|
|000001e0| 67 20 79 6f 75 27 64 0d | 6c 69 6b 65 2e 20 49 74 |g you'd.|like. It|
|000001f0| 20 77 6f 75 6c 64 20 62 | 65 20 63 6f 6f 6c 20 69 | would b|e cool i|
|00000200| 66 20 79 6f 75 20 63 6f | 75 6c 64 20 67 69 76 65 |f you co|uld give|
|00000210| 20 6d 65 20 61 20 6c 69 | 74 74 6c 65 20 63 72 65 | me a li|ttle cre|
|00000220| 64 69 74 2e 2e 2e 20 4f | 66 20 63 6f 75 72 73 65 |dit... O|f course|
|00000230| 2c 20 55 53 45 20 41 54 | 0d 59 4f 55 52 20 4f 57 |, USE AT|.YOUR OW|
|00000240| 4e 20 52 49 53 4b 3b 20 | 49 27 6d 20 6e 6f 74 20 |N RISK; |I'm not |
|00000250| 72 65 73 70 6f 6e 73 69 | 62 6c 65 20 66 6f 72 20 |responsi|ble for |
|00000260| 61 6e 79 74 68 69 6e 67 | 2c 20 65 74 63 2e 2c 20 |anything|, etc., |
|00000270| 65 74 63 2e 20 6a 6f 65 | 6c 61 66 66 40 61 6f 6c |etc. joe|laff@aol|
|00000280| 2e 63 6f 6d 0d 0d 48 49 | 53 54 4f 52 59 3a 20 0d |.com..HI|STORY: .|
|00000290| 31 31 2f 39 33 20 64 67 | 70 20 64 6f 77 6e 6c 6f |11/93 dg|p downlo|
|000002a0| 61 64 65 64 20 56 65 72 | 73 53 74 72 2e 63 20 66 |aded Ver|sStr.c f|
|000002b0| 72 6f 6d 20 43 6f 6d 70 | 75 73 65 72 76 65 0d 31 |rom Comp|userve.1|
|000002c0| 32 2f 31 39 2f 39 33 20 | 64 67 70 20 52 65 6d 6f |2/19/93 |dgp Remo|
|000002d0| 76 65 64 20 65 78 63 65 | 73 73 20 77 68 69 74 65 |ved exce|ss white|
|000002e0| 73 70 61 63 65 2e 20 52 | 65 6e 61 6d 65 64 20 66 |space. R|enamed f|
|000002f0| 75 6e 63 74 69 6f 6e 20 | 66 72 6f 6d 20 47 65 74 |unction |from Get|
|00000300| 56 65 72 73 53 74 72 20 | 74 6f 20 0d 09 09 09 47 |VersStr |to ....G|
|00000310| 65 74 56 65 72 73 69 6f | 6e 53 74 72 69 6e 67 2e |etVersio|nString.|
|00000320| 20 4e 6f 77 20 61 6c 6c | 6f 63 61 74 65 20 61 6e | Now all|ocate an|
|00000330| 64 20 72 65 74 75 72 6e | 20 73 74 72 69 6e 67 20 |d return| string |
|00000340| 69 6e 73 74 65 61 64 20 | 6f 66 20 63 6f 70 79 69 |instead |of copyi|
|00000350| 6e 67 20 0d 09 09 09 74 | 6f 20 75 73 65 72 2d 61 |ng ....t|o user-a|
|00000360| 6c 6c 6f 63 61 74 65 64 | 20 73 74 72 69 6e 67 20 |llocated| string |
|00000370| 61 72 67 75 6d 65 6e 74 | 2e 20 41 64 64 65 64 20 |argument|. Added |
|00000380| 65 72 72 6f 72 20 63 68 | 65 63 6b 69 6e 67 2e 0d |error ch|ecking..|
|00000390| 2a 2f 0d 23 69 6e 63 6c | 75 64 65 20 22 56 69 64 |*/.#incl|ude "Vid|
|000003a0| 65 6f 54 6f 6f 6c 62 6f | 78 2e 68 22 0d 2f 2f 23 |eoToolbo|x.h".//#|
|000003b0| 69 6e 63 6c 75 64 65 20 | 3c 52 65 73 6f 75 72 63 |include |<Resourc|
|000003c0| 65 73 2e 68 3e 0d 2f 2f | 23 69 6e 63 6c 75 64 65 |es.h>.//|#include|
|000003d0| 20 3c 4d 65 6d 6f 72 79 | 2e 68 3e 0d 23 64 65 66 | <Memory|.h>.#def|
|000003e0| 69 6e 65 09 56 45 52 53 | 5f 52 45 53 5f 49 44 09 |ine.VERS|_RES_ID.|
|000003f0| 09 31 09 2f 2a 20 72 65 | 73 6f 75 72 63 65 20 49 |.1./* re|source I|
|00000400| 44 20 6f 66 20 27 76 65 | 72 73 27 20 74 6f 20 75 |D of 've|rs' to u|
|00000410| 73 65 20 28 75 73 75 61 | 6c 6c 79 20 31 20 61 73 |se (usua|lly 1 as|
|00000420| 20 6f 66 20 53 79 73 37 | 2e 31 29 2a 2f 0d 23 64 | of Sys7|.1)*/.#d|
|00000430| 65 66 69 6e 65 09 42 59 | 54 45 5f 4f 46 46 53 45 |efine.BY|TE_OFFSE|
|00000440| 54 09 09 36 09 2f 2a 20 | 74 68 65 20 6f 66 66 73 |T..6./* |the offs|
|00000450| 65 74 20 6f 66 20 74 68 | 65 20 70 61 73 63 61 6c |et of th|e pascal|
|00000460| 2d 73 74 79 6c 65 20 76 | 65 72 73 69 6f 6e 20 73 |-style v|ersion s|
|00000470| 74 72 69 6e 67 20 2a 2f | 0d 09 09 09 09 09 09 09 |tring */|........|
|00000480| 2f 2a 20 66 72 6f 6d 20 | 74 68 65 20 62 65 67 69 |/* from |the begi|
|00000490| 6e 6e 69 6e 67 20 6f 66 | 20 74 68 65 20 27 76 65 |nning of| the 've|
|000004a0| 72 73 27 20 72 65 73 6f | 75 72 63 65 2e 20 2a 2f |rs' reso|urce. */|
|000004b0| 0d 09 09 09 09 09 09 09 | 2f 2a 20 20 41 70 70 6c |........|/* Appl|
|000004c0| 65 20 4d 41 59 20 63 68 | 61 6e 67 65 20 74 68 69 |e MAY ch|ange thi|
|000004d0| 73 2d 2d 20 68 6f 70 65 | 66 75 6c 6c 79 20 6e 6f |s-- hope|fully no|
|000004e0| 74 21 21 21 20 2a 2f 0d | 63 68 61 72 20 2a 47 65 |t!!! */.|char *Ge|
|000004f0| 74 56 65 72 73 69 6f 6e | 53 74 72 69 6e 67 28 76 |tVersion|String(v|
|00000500| 6f 69 64 29 3b 0d 0d 63 | 68 61 72 20 2a 47 65 74 |oid);..c|har *Get|
|00000510| 56 65 72 73 69 6f 6e 53 | 74 72 69 6e 67 28 76 6f |VersionS|tring(vo|
|00000520| 69 64 29 0d 7b 0d 09 48 | 61 6e 64 6c 65 20 76 65 |id).{..H|andle ve|
|00000530| 72 73 3b 0d 09 75 6e 73 | 69 67 6e 65 64 20 63 68 |rs;..uns|igned ch|
|00000540| 61 72 20 2a 73 31 3b 0d | 09 63 68 61 72 20 2a 73 |ar *s1;.|.char *s|
|00000550| 32 3b 0d 09 0d 09 76 65 | 72 73 3d 47 65 74 31 52 |2;....ve|rs=Get1R|
|00000560| 65 73 6f 75 72 63 65 28 | 27 76 65 72 73 27 2c 56 |esource(|'vers',V|
|00000570| 45 52 53 5f 52 45 53 5f | 49 44 29 3b 0d 09 69 66 |ERS_RES_|ID);..if|
|00000580| 28 76 65 72 73 3d 3d 4e | 55 4c 4c 29 72 65 74 75 |(vers==N|ULL)retu|
|00000590| 72 6e 20 22 22 3b 0d 09 | 48 4c 6f 63 6b 28 76 65 |rn "";..|HLock(ve|
|000005a0| 72 73 29 3b 0d 09 73 31 | 3d 28 75 6e 73 69 67 6e |rs);..s1|=(unsign|
|000005b0| 65 64 20 63 68 61 72 20 | 2a 29 28 2a 76 65 72 73 |ed char |*)(*vers|
|000005c0| 20 2b 20 42 59 54 45 5f | 4f 46 46 53 45 54 29 3b | + BYTE_|OFFSET);|
|000005d0| 0d 09 69 66 28 42 59 54 | 45 5f 4f 46 46 53 45 54 |..if(BYT|E_OFFSET|
|000005e0| 2b 2a 73 31 2b 31 3e 53 | 69 7a 65 52 65 73 6f 75 |+*s1+1>S|izeResou|
|000005f0| 72 63 65 28 76 65 72 73 | 29 29 0d 09 09 50 72 69 |rce(vers|))...Pri|
|00000600| 6e 74 66 45 78 69 74 28 | 22 47 65 74 56 65 72 73 |ntfExit(|"GetVers|
|00000610| 69 6f 6e 53 74 72 69 6e | 67 3a 20 49 6c 6c 65 67 |ionStrin|g: Illeg|
|00000620| 61 6c 20 27 76 65 72 73 | 27 20 72 65 73 6f 75 72 |al 'vers|' resour|
|00000630| 63 65 2e 5c 6e 22 29 3b | 0d 09 73 32 3d 4e 65 77 |ce.\n");|..s2=New|
|00000640| 50 74 72 28 2a 73 31 2b | 31 29 3b 0d 09 69 66 28 |Ptr(*s1+|1);..if(|
|00000650| 73 32 3d 3d 4e 55 4c 4c | 29 50 72 69 6e 74 66 45 |s2==NULL|)PrintfE|
|00000660| 78 69 74 28 22 47 65 74 | 56 65 72 73 69 6f 6e 53 |xit("Get|VersionS|
|00000670| 74 72 69 6e 67 3a 20 63 | 6f 75 6c 64 6e 27 74 20 |tring: c|ouldn't |
|00000680| 61 6c 6c 6f 63 61 74 65 | 20 73 74 72 69 6e 67 2e |allocate| string.|
|00000690| 5c 6e 22 29 3b 0d 09 70 | 32 63 73 74 72 28 73 31 |\n");..p|2cstr(s1|
|000006a0| 29 3b 0d 09 73 74 72 63 | 70 79 28 73 32 2c 28 63 |);..strc|py(s2,(c|
|000006b0| 68 61 72 20 2a 29 73 31 | 29 3b 0d 09 52 65 6c 65 |har *)s1|);..Rele|
|000006c0| 61 73 65 52 65 73 6f 75 | 72 63 65 28 76 65 72 73 |aseResou|rce(vers|
|000006d0| 29 3b 0d 09 72 65 74 75 | 72 6e 20 73 32 3b 0d 7d |);..retu|rn s2;.}|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 01 00 00 00 01 74 | 00 00 00 74 00 00 00 52 |.......t|...t...R|
|00000710| 5b 6e 6d 5d 3d 79 2a 63 | 2b 7a 2a 73 3b 0d 09 09 |[nm]=y*c|+z*s;...|
|00000720| 09 09 09 09 61 5b 6a 5d | 5b 69 5d 3d 7a 2a 63 2d |....a[j]|[i]=z*c-|
|00000730| 12 47 65 74 56 65 72 73 | 69 6f 6e 53 74 72 69 6e |.GetVers|ionStrin|
|00000740| 67 2e 63 72 02 00 00 00 | 54 45 58 54 43 57 49 45 |g.cr....|TEXTCWIE|
|00000750| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 28 02 40 |..TEXTCW|IE...(.@|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 a9 39 5a 91 00 00 | 06 60 00 00 01 c6 5d 20 |...9Z...|.`....] |
|00000780| 3d 20 2d 7a 3b 0d 09 09 | 09 09 09 66 6f 72 20 28 |= -z;...|...for (|
|00000790| 6a 3d 31 3b 6a 3c 3d 6e | 3b 6a 2b 2b 29 20 76 5b |j=1;j<=n|;j++) v[|
|000007a0| 6a 5d 5b 6b 5d 20 3d 20 | 2d 76 5b 6a 5d 5b 6b 5d |j][k] = |-v[j][k]|
|000007b0| 3b 0d 09 09 09 09 7d 0d | 09 09 09 09 62 72 65 61 |;.....}.|....brea|
|000007c0| 6b 3b 0d 09 09 09 7d 0d | 09 09 09 69 66 20 28 69 |k;....}.|...if (i|
|000007d0| 74 73 20 3d 3d 20 33 30 | 29 20 6e 72 65 72 72 6f |ts == 30|) nrerro|
|000007e0| 72 28 22 6e 6f 20 63 6f | 6e 76 65 72 67 65 6e 63 |r("no co|nvergenc|
|000007f0| 65 20 69 6e 20 33 30 20 | 73 76 64 63 6d 70 20 69 |e in 30 |svdcmp i|
|00000800| 00 00 00 1c 00 01 00 00 | 04 89 00 00 04 99 11 47 |........|.......G|
|00000810| 65 74 56 65 72 73 69 6f | 6e 53 74 72 69 6e 67 00 |etVersio|nString.|
|00000820| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 03 | 00 04 00 3d 00 03 01 a0 |........|...=....|
|00000850| 02 7d 00 3d 00 03 01 a0 | 02 7d ac 3b 72 10 00 00 |.}.=....|.}.;r...|
|00000860| 03 2f 00 00 03 2f 00 00 | 02 d4 00 00 00 00 00 04 |./.../..|........|
|00000870| 00 01 00 01 00 00 01 00 | 00 00 01 74 00 00 00 74 |........|...t...t|
|00000880| 00 00 00 52 01 89 2f e8 | 1a d0 00 00 00 1c 00 52 |...R../.|.......R|
|00000890| 00 01 4d 50 53 52 00 01 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|000008a0| 00 2a 03 ef ff ff 00 00 | 00 00 00 00 00 00 03 ed |.*......|........|
|000008b0| ff ff 00 00 00 20 00 00 | 00 00 03 f0 ff ff 00 00 |..... ..|........|
|000008c0| 00 6c 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.l......|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+