Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / storage / abs_storage.C
1 /*
2  * $XConsortium: abs_storage.cc /main/6 1996/07/18 14:52:12 drk $
3  *
4  * Copyright (c) 1992 HAL Computer Systems International, Ltd.
5  * All rights reserved.  Unpublished -- rights reserved under
6  * the Copyright Laws of the United States.  USE OF A COPYRIGHT
7  * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
8  * OR DISCLOSURE.
9  * 
10  * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
11  * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.  USE,
12  * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
13  * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
14  * INTERNATIONAL, LTD.
15  * 
16  *                         RESTRICTED RIGHTS LEGEND
17  * Use, duplication, or disclosure by the Government is subject
18  * to the restrictions as set forth in subparagraph (c)(l)(ii)
19  * of the Rights in Technical Data and Computer Software clause
20  * at DFARS 252.227-7013.
21  *
22  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
23  *                  1315 Dell Avenue
24  *                  Campbell, CA  95008
25  * 
26  */
27
28
29 #include "storage/abs_storage.h"
30
31 abs_storage::abs_storage( char* file_path, char* file_name,
32                           c_code_t c_id, rep_policy* p ) : 
33 policy(p), root(c_id), index_num(-1), v_swap_order(false)
34 {
35    strcpy(path, file_path);
36    strcpy(name, file_name);
37 }
38
39 abs_storage::~abs_storage()
40 {
41 }
42
43 int abs_storage::byte_order()
44 {
45    unsigned int x;
46    unsigned char *p;
47
48    x = 0x01020304;
49    p = (unsigned char *)&x;
50
51    switch (*p) {
52     case 1:
53        return (mmdb_big_endian);
54     case 4:
55        return (mmdb_little_endian);
56     default:
57        throw(stringException("neither BIG_ENDIAN or LITTLE_ENDIAN machine"));
58    }
59 }
60
61