Mercurial > hg > xemacs-beta
comparison src/dumper.c @ 2015:2364237fbc0f
[xemacs-hg @ 2004-04-15 20:56:17 by olivierg]
Moving the dump file inside the executable
author | olivierg |
---|---|
date | Thu, 15 Apr 2004 20:56:23 +0000 |
parents | a8d8f419b459 |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
2014:92f7301e4a23 | 2015:2364237fbc0f |
---|---|
38 #include "syswindows.h" | 38 #include "syswindows.h" |
39 #else | 39 #else |
40 #ifdef HAVE_MMAP | 40 #ifdef HAVE_MMAP |
41 #include <sys/mman.h> | 41 #include <sys/mman.h> |
42 #endif | 42 #endif |
43 #include "dump-data.h" | |
43 #endif | 44 #endif |
44 | 45 |
45 typedef struct | 46 typedef struct |
46 { | 47 { |
47 const void *varaddress; | 48 const void *varaddress; |
1505 retry_read (fd, pdump_start, pdump_length); | 1506 retry_read (fd, pdump_start, pdump_length); |
1506 | 1507 |
1507 retry_close (fd); | 1508 retry_close (fd); |
1508 return 1; | 1509 return 1; |
1509 } | 1510 } |
1511 | |
1512 static int | |
1513 pdump_ram_try (void) | |
1514 { | |
1515 pdump_start = dumped_data_get(); | |
1516 pdump_length = dumped_data_size(); | |
1517 | |
1518 return pdump_load_check(); | |
1519 } | |
1520 | |
1510 #endif /* !WIN32_NATIVE */ | 1521 #endif /* !WIN32_NATIVE */ |
1511 | 1522 |
1512 | 1523 |
1513 static int | 1524 static int |
1514 pdump_file_try (char *exe_path) | 1525 pdump_file_try (char *exe_path) |
1551 | 1562 |
1552 int | 1563 int |
1553 pdump_load (const Extbyte *argv0) | 1564 pdump_load (const Extbyte *argv0) |
1554 { | 1565 { |
1555 Extbyte exe_path[PATH_MAX]; | 1566 Extbyte exe_path[PATH_MAX]; |
1567 | |
1556 #ifdef WIN32_NATIVE | 1568 #ifdef WIN32_NATIVE |
1557 GetModuleFileNameA (NULL, exe_path, PATH_MAX); | 1569 GetModuleFileNameA (NULL, exe_path, PATH_MAX); |
1558 #else /* !WIN32_NATIVE */ | 1570 #else /* !WIN32_NATIVE */ |
1559 Extbyte *w; | 1571 Extbyte *w; |
1560 const Extbyte *dir, *p; | 1572 const Extbyte *dir, *p; |
1573 | |
1574 if(pdump_ram_try()) { | |
1575 pdump_load_finish(); | |
1576 in_pdump = 0; | |
1577 return 1; | |
1578 } | |
1561 | 1579 |
1562 in_pdump = 1; | 1580 in_pdump = 1; |
1563 dir = argv0; | 1581 dir = argv0; |
1564 if (dir[0] == '-') | 1582 if (dir[0] == '-') |
1565 { | 1583 { |