1159d09a2SMark Phalan /*
2159d09a2SMark Phalan * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3159d09a2SMark Phalan * Use is subject to license terms.
4159d09a2SMark Phalan */
5159d09a2SMark Phalan
6159d09a2SMark Phalan
7159d09a2SMark Phalan /*
8159d09a2SMark Phalan * k5-platform.h
9159d09a2SMark Phalan *
10159d09a2SMark Phalan * Copyright 2003, 2004, 2005 Massachusetts Institute of Technology.
11159d09a2SMark Phalan * All Rights Reserved.
12159d09a2SMark Phalan *
13159d09a2SMark Phalan * Export of this software from the United States of America may
14159d09a2SMark Phalan * require a specific license from the United States Government.
15159d09a2SMark Phalan * It is the responsibility of any person or organization contemplating
16159d09a2SMark Phalan * export to obtain such a license before exporting.
17*55fea89dSDan Cross *
18159d09a2SMark Phalan * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
19159d09a2SMark Phalan * distribute this software and its documentation for any purpose and
20159d09a2SMark Phalan * without fee is hereby granted, provided that the above copyright
21159d09a2SMark Phalan * notice appear in all copies and that both that copyright notice and
22159d09a2SMark Phalan * this permission notice appear in supporting documentation, and that
23159d09a2SMark Phalan * the name of M.I.T. not be used in advertising or publicity pertaining
24159d09a2SMark Phalan * to distribution of the software without specific, written prior
25159d09a2SMark Phalan * permission. Furthermore if you modify this software you must label
26159d09a2SMark Phalan * your software as modified software and not distribute it in such a
27159d09a2SMark Phalan * fashion that it might be confused with the original M.I.T. software.
28159d09a2SMark Phalan * M.I.T. makes no representations about the suitability of
29159d09a2SMark Phalan * this software for any purpose. It is provided "as is" without express
30159d09a2SMark Phalan * or implied warranty.
31*55fea89dSDan Cross *
32159d09a2SMark Phalan *
33159d09a2SMark Phalan * Some platform-dependent definitions to sync up the C support level.
34159d09a2SMark Phalan * Some to a C99-ish level, some related utility code.
35159d09a2SMark Phalan *
36159d09a2SMark Phalan * Currently:
37159d09a2SMark Phalan * + make "static inline" work
38159d09a2SMark Phalan * + 64-bit types and load/store code
39159d09a2SMark Phalan * + SIZE_MAX
40159d09a2SMark Phalan * + shared library init/fini hooks
41159d09a2SMark Phalan * + consistent getpwnam/getpwuid interfaces
42159d09a2SMark Phalan */
43159d09a2SMark Phalan
44159d09a2SMark Phalan static void
store_32_be(unsigned int val,unsigned char * p)45159d09a2SMark Phalan store_32_be (unsigned int val, unsigned char *p)
46159d09a2SMark Phalan {
47159d09a2SMark Phalan p[0] = (val >> 24) & 0xff;
48159d09a2SMark Phalan p[1] = (val >> 16) & 0xff;
49159d09a2SMark Phalan p[2] = (val >> 8) & 0xff;
50159d09a2SMark Phalan p[3] = (val ) & 0xff;
51159d09a2SMark Phalan }
52