Mercurial > hg > xemacs-beta
annotate src/dump-data.c @ 5848:e2efee0f7703
hst confused
| author | Henry Thompson <ht@markup.co.uk> |
|---|---|
| date | Fri, 27 Feb 2015 17:43:50 +0000 |
| parents | 308d34e9f07d |
| children |
| rev | line source |
|---|---|
| 2015 | 1 /* Static array to put the dumped data in and its management |
| 2 Copyright (C) 2003 Olivier Galibert | |
| 3 | |
| 4 This file is part of XEmacs. | |
| 5 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
6 XEmacs is free software: you can redistribute it and/or modify it |
| 2015 | 7 under the terms of the GNU General Public License as published by the |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
8 Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
9 option) any later version. |
| 2015 | 10 |
| 11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 for more details. | |
| 15 | |
| 16 You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 2015 | 18 |
| 19 /* Synched up with: Not in FSF. */ | |
| 20 | |
| 21 /* Mule-ized? Mwahahahahahaha */ | |
| 22 | |
| 23 /* Magic values by Larry McVoy to prevent every known compiler, including | |
| 24 an especially perverse HP-UX one, from putting the array in BSS. | |
| 25 */ | |
| 26 | |
| 27 | |
| 28 #include <config.h> | |
| 29 #include "lisp.h" | |
| 30 #include "dump-data.h" | |
| 31 | |
| 32 /* 4 bytes for the data size, 4096 for alignment */ | |
| 33 | |
| 2367 | 34 static Rawbyte dumped_data[MAX_SIZE+4096+4] = { |
| 2015 | 35 255, |
| 36 6, | |
| 37 1, | |
| 38 2, | |
| 39 3, | |
| 40 4, | |
| 41 255, | |
| 42 3, | |
| 43 9, | |
| 44 62, | |
| 45 255, | |
| 46 10, | |
| 47 4, | |
| 48 61, | |
| 49 255 | |
| 50 }; | |
| 51 | |
| 52 size_t | |
| 2367 | 53 dumped_data_size (void) |
| 2015 | 54 { |
| 2367 | 55 return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) | |
| 56 (dumped_data[3] << 24); | |
| 2015 | 57 } |
| 58 | |
| 59 size_t | |
| 2367 | 60 dumped_data_max_size (void) |
| 2015 | 61 { |
| 62 return MAX_SIZE; | |
| 63 } | |
| 64 | |
| 65 size_t | |
| 2367 | 66 dumped_data_align_offset (void) |
| 2015 | 67 { |
| 2367 | 68 EMACS_INT iptr = (EMACS_INT) dumped_data; |
| 2015 | 69 EMACS_INT iptr2; |
| 2367 | 70 iptr2 = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; |
| 2015 | 71 |
| 2367 | 72 return iptr2 - iptr; |
| 2015 | 73 } |
| 74 | |
| 2367 | 75 Rawbyte * |
| 76 dumped_data_get (void) | |
| 2015 | 77 { |
| 2367 | 78 EMACS_INT iptr = (EMACS_INT) dumped_data; |
| 79 iptr = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; | |
| 80 return (Rawbyte *) iptr; | |
| 2015 | 81 } |
| 82 |
