import less(1)
[unleashed/tickless.git] / usr / src / lib / libc / port / gen / l3.c
blob05a43717ccc656c53a90bf6492ab19b4f6859b84
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Convert longs to and from 3-byte disk addresses
35 #pragma weak _l3tol = l3tol
36 #pragma weak _ltol3 = ltol3
38 #include "lint.h"
40 void
41 ltol3(char *cp, const long *lp, int n)
43 register i;
44 register char *a, *b;
46 a = cp;
47 b = (char *)lp;
48 for (i = 0; i < n; ++i) {
49 #if interdata || u370 || u3b || M32
50 b++;
51 *a++ = *b++;
52 *a++ = *b++;
53 *a++ = *b++;
54 #endif
55 #if vax || i286 || i386
56 *a++ = *b++;
57 *a++ = *b++;
58 *a++ = *b++;
59 b++;
60 #endif
61 #if pdp11
62 *a++ = *b++;
63 b++;
64 *a++ = *b++;
65 *a++ = *b++;
66 #endif
70 void
71 l3tol(long *lp, const char *cp, int n)
73 register i;
74 register char *a, *b;
76 a = (char *)lp;
77 b = cp;
78 for (i = 0; i < n; ++i) {
79 #if interdata || u370 || u3b || M32
80 *a++ = 0;
81 *a++ = *b++;
82 *a++ = *b++;
83 *a++ = *b++;
84 #endif
85 #if vax || i286 || i386
86 *a++ = *b++;
87 *a++ = *b++;
88 *a++ = *b++;
89 *a++ = 0;
90 #endif
91 #if pdp11
92 *a++ = *b++;
93 *a++ = 0;
94 *a++ = *b++;
95 *a++ = *b++;
96 #endif