Mercurial > hg > xemacs-beta
annotate lib-src/make-dump-id.c @ 5096:e0587c615e8b
Updates to internals.texi
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-03-04 Ben Wing <ben@xemacs.org>
* internals/internals.texi (Top):
* internals/internals.texi (list-to-texinfo): Removed.
* internals/internals.texi (convert-list-to-texinfo): New.
* internals/internals.texi (table-to-texinfo): Removed.
* internals/internals.texi (convert-table-to-texinfo): New.
Update Lisp functions at top to newest versions.
* internals/internals.texi (A History of Emacs):
* internals/internals.texi (Through Version 18):
* internals/internals.texi (Lucid Emacs):
* internals/internals.texi (XEmacs):
* internals/internals.texi (The XEmacs Split):
* internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System):
* internals/internals.texi (Introduction to Writing C Code):
* internals/internals.texi (Writing Good Comments):
* internals/internals.texi (Writing Macros):
* internals/internals.texi (Major Textual Changes):
* internals/internals.texi (Great Integral Type Renaming):
* internals/internals.texi (How to Regression-Test):
* internals/internals.texi (Creating a Branch):
* internals/internals.texi (Dynamic Arrays):
* internals/internals.texi (Allocation by Blocks):
* internals/internals.texi (mark_object):
* internals/internals.texi (gc_sweep):
* internals/internals.texi (Byte-Char Position Conversion):
* internals/internals.texi (Searching and Matching):
* internals/internals.texi (Introduction to Multilingual Issues #3):
* internals/internals.texi (Byte Types):
* internals/internals.texi (Different Ways of Seeing Internal Text):
* internals/internals.texi (Buffer Positions):
* internals/internals.texi (Basic internal-format APIs):
* internals/internals.texi (The DFC API):
* internals/internals.texi (General Guidelines for Writing Mule-Aware Code):
* internals/internals.texi (Mule-izing Code):
* internals/internals.texi (Locales):
* internals/internals.texi (More about code pages):
* internals/internals.texi (More about locales):
* internals/internals.texi (Unicode support under Windows):
* internals/internals.texi (The Frame):
* internals/internals.texi (The Non-Client Area):
* internals/internals.texi (The Client Area):
* internals/internals.texi (The Paned Area):
* internals/internals.texi (Text Areas):
* internals/internals.texi (The Displayable Area):
* internals/internals.texi (Event Queues):
* internals/internals.texi (Event Stream Callback Routines):
* internals/internals.texi (Focus Handling):
* internals/internals.texi (Future Work -- Autodetection):
Replace " with ``, '' (not complete, maybe about halfway through).
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Thu, 04 Mar 2010 07:19:03 -0600 |
parents | ecf1ebac70d8 |
children | 308d34e9f07d |
rev | line source |
---|---|
442 | 1 /* Generate a unique dump-id for use with the portable dumper. |
2 Copyright (C) 2000 Olivier Galibert, Martin Buchholz | |
3 | |
4 This file is part of XEmacs. | |
5 | |
6 XEmacs is free software; you can redistribute it and/or modify it | |
7 under the terms of the GNU General Public License as published by the | |
8 Free Software Foundation; either version 2, or (at your option) any | |
9 later version. | |
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 | |
17 along with XEmacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 Boston, MA 02111-1307, USA. */ | |
20 | |
21 #include <config.h> | |
22 #include <stdio.h> | |
23 #include <stdlib.h> | |
24 #include "../src/systime.h" | |
25 | |
26 #ifdef WIN32_NATIVE | |
27 #include <sys/timeb.h> | |
28 | |
29 /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ | |
30 void | |
31 gettimeofday (struct timeval *tv, struct timezone *tz) | |
32 { | |
33 struct _timeb tb; | |
34 _ftime (&tb); | |
35 | |
36 tv->tv_sec = tb.time; | |
37 tv->tv_usec = tb.millitm * 1000L; | |
38 if (tz) | |
39 { | |
40 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ | |
41 tz->tz_dsttime = tb.dstflag; /* type of dst correction */ | |
42 } | |
43 } | |
44 #endif | |
45 | |
46 /* Generates an (extremely) pseudo random number for the dump-id */ | |
47 static unsigned int | |
48 generate_dump_id (void) | |
49 { | |
50 EMACS_TIME thyme; | |
51 EMACS_GET_TIME (thyme); | |
52 | |
53 return (unsigned int) (EMACS_SECS (thyme) ^ EMACS_USECS (thyme)); | |
54 } | |
55 | |
56 int | |
2367 | 57 main (int argc, char **argv) |
442 | 58 { |
59 FILE *f; | |
60 | |
61 if ((f = fopen ("dump-id.c", "w")) == NULL) | |
62 { | |
63 perror ("open dump-id.c"); | |
64 return EXIT_FAILURE; | |
65 } | |
66 | |
1688 | 67 /* dump_id is declared as extern "C" in dumper.h */ |
68 fputs ("extern\n", f); | |
69 fputs ("#ifdef __cplusplus\n", f); | |
70 fputs ("\"C\"\n", f); | |
71 fputs ("#endif\n", f); | |
72 fputs ("unsigned int dump_id;\n", f); | |
460 | 73 fprintf (f, "unsigned int dump_id = %uU;\n", generate_dump_id ()); |
442 | 74 |
75 if ((fclose (f)) != 0) | |
76 { | |
77 perror ("close dump-id.c"); | |
78 return EXIT_FAILURE; | |
79 } | |
80 | |
81 return EXIT_SUCCESS; | |
82 } |