Start development on 386BSD 0.0
[unix-history] / .ref-BSD-4_3_Net_2 / usr / src / contrib / isode / others / quipu / photo / old / hexphoto.c
CommitLineData
54fea4c1
C
1/* hexphoto.c - your comments here */
2
3#ifndef lint
4static 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
35decode_t4 (picture,persons_name, len)
36char *picture;
37char *persons_name;
38{
39int 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}
48static photolen (s1)
49char * s1;
50{
51int length=0,cnt,i;
52char * 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}