Commit | Line | Data |
---|---|---|
54fea4c1 C |
1 | /* hexphoto.c - your comments here */ |
2 | ||
3 | #ifndef lint | |
4 | static char *rcsid = "$Header: /f/osi/others/quipu/photo/RCS/hexphoto.c,v 7.1 90/09/24 15:36:47 mrose Exp $"; | |
5 | #endif | |
6 | ||
7 | /* | |
8 | * $Header: /f/osi/others/quipu/photo/RCS/hexphoto.c,v 7.1 90/09/24 15:36:47 mrose Exp $ | |
9 | * | |
10 | * | |
11 | * $Log: hexphoto.c,v $ | |
12 | * Revision 7.1 90/09/24 15:36:47 mrose | |
13 | * update | |
14 | * | |
15 | * Revision 7.0 89/11/23 22:01:42 mrose | |
16 | * Release 6.0 | |
17 | * | |
18 | */ | |
19 | ||
20 | /* | |
21 | * NOTICE | |
22 | * | |
23 | * Acquisition, use, and distribution of this module and related | |
24 | * materials are subject to the restrictions of a license agreement. | |
25 | * Consult the Preface in the User's Manual for the full terms of | |
26 | * this agreement. | |
27 | * | |
28 | */ | |
29 | ||
30 | ||
31 | #include "quipu/util.h" | |
32 | #include "quipu/photo.h" | |
33 | #include "psap.h" | |
34 | ||
35 | decode_t4 (picture,persons_name, len) | |
36 | char *picture; | |
37 | char *persons_name; | |
38 | { | |
39 | int i; | |
40 | ||
41 | if (len == 0) len = photolen (picture); | |
42 | ||
43 | for (i=0; i<len; i++) | |
44 | (void) fprintf (stderr,"%02x",*picture++ & 255); | |
45 | ||
46 | ||
47 | } | |
48 | static photolen (s1) | |
49 | char * s1; | |
50 | { | |
51 | int length=0,cnt,i; | |
52 | char * temp; | |
53 | ||
54 | if (*s1 == 0x03) { | |
55 | /* we have a coded picture */ | |
56 | ||
57 | temp = s1; | |
58 | temp++; | |
59 | cnt = *temp++ & 0x7f; /*assume len > 127 for now */ | |
60 | for (i=0; i<cnt; i++) | |
61 | length = (length << 8) | (*temp++ & 0xff) ; | |
62 | ||
63 | length += 2 + cnt; | |
64 | return (length); | |
65 | ||
66 | } else | |
67 | return (-1); | |
68 | ||
69 | } |