Mercurial > emacs
view src/unexhp9k800.c @ 92870:8f17f65dd575
* textmodes/org.el (org-ctrl-c-star): Implement a missing branch
in the decision tree.
(org-select-remember-template): Cleaned the code.
(org-prepare-dblock): Added the extra :content parameter.
(org-write-agenda): New output type ".ics" files.
(org-write-agenda): Call `org-icalendar-verify-function', both for
time stamps and for TODO entries.
(org-agenda-collect-markers, org-create-marker-find-array)
(org-check-agenda-marker-table): New functions.
(org-agenda-marker-table): New variable.
(org-export-as-html): Revert the change that killed the html
buffer. Side effects first need to be studied carefully.
(org-get-tags-at): Fix the structure of the condition-case
statement.
(org-ts-regexp0, org-repeat-re, org-display-custom-time)
(org-timestamp-change): Fix regulear expressions to swallow the
extra character for repeat-shift control.
(org-auto-repeat-maybe): Implement the new repeater mechanisms.
(org-get-legal-level): Aliased to `org-get-valid-level'.
(org-dblock-write:clocktable): Added a :link parameter, linking
headlines to their location in the Org agenda files.
(org-get-tags-at): Bugfix: prevent `org-back-to-heading' from
throwing an error when getting tags before headlines.
(org-timestamp-change, org-modify-ts-extra)
(org-ts-regexp1): Fix timestamp editing.
(org-agenda-custom-commands-local-options): New constant.
(org-agenda-custom-commands): Use
`org-agenda-custom-commands-local-options' to improve customize
type. "htmlize": Removed hack to fix face problem with htmlize,
it no longer seem necessary.
(org-follow-link-hook): New hook.
(org-agenda-custom-commands): Added "Component" as a tag for each
item in a command serie.
(org-open-at-point): Run `org-follow-link-hook'.
(org-agenda-schedule): Bugfix: don't display marker type when it
is `nil'.
(org-store-link): org-irc required.
(org-set-regexps-and-options): Parse the new logging options.
(org-extract-log-state-settings): New function.
(org-todo): Handle the new ways of recording state change stuff.
(org-local-logging): New function.
(org-columns-open-link): Fixed bug with opening link in column
view.
(org-local-logging): New function
(org-todo): Make sure that LOGGING properties are honoured.
(org-todo-keywords): Improve docstring.
(org-startup-options): Cleanup startup options.
(org-set-regexps-and-options): Process the "!" markers.
(org-todo): Respect the new logging stuff.
(org-log-note-how): New variable.
(org-add-log-maybe): New parameter HOW that defines how logging
should be done and also overrides PURPOSE. Add a docstring.
(org-add-log-note): Check if we really need to ask for a note.
(org-get-current-options): Digest the new keyword.
(org-agenda-reset-markers): Renamed from
`org-agenda-maybe-reset-markers'. FORCE argument removed.
(org-diary, org-agenda-quit, org-prepare-agenda): Call the renamed
function, without force argument.
(org-buffer-property-keys): Bind local variables s and p.
(org-make-tags-matcher): Allow "" to match an empty or
non-existent property value.
(org-export-as-html): Join unsorted lists when they directly
follow each other. Such lists may be created by headlines that
are converted to lists.
(org-nofm-to-completion): New function.
(org-export-as-html): Use :html-extension instead of
org-export-html-extension.
(org-store-link): Support for links from `rmail-summary-mode'.
(org-columns-new, org-complete, org-set-property): Set the
`include-columns' argument in the call to
`org-buffer-property-keys'.
(org-buffer-property-keys): New argument `include-columns', to
include properties expected by any of the COLUMS formats in the
current buffer.
(org-cleaned-string-for-export): Get rid of drawers first, so that
they will be removed also in the text before the first headline.
(org-clock-report): Show the clocktable when found.
(org-refile): Fix positioning bug when `org-reverse-note-order' is
nil.
(org-version): With prefix argument, insert `org-version' at
point.
(org-agenda-goto): Recenter the window after finding the target
location, to make sure the correct position will be displayed.
(org-agenda-get-deadlines): Don't scale priority with the warning
period.
(org-insert-heading): Don't break line in the middle of the line.
(org-agenda-get-deadlines): Allow `org-deadline-warning-days' to
be 0.
(org-update-checkbox-count): Revamped to deal with hierarchical
beckboxes. This was a patch from Miguel A. Figueroa-Villanueva.
(org-remove-timestamp-with-keyword): New function.
(org-schedule, org-deadline): Use
`org-remove-timestamp-with-keyword' to make sure all such time
stamps are removed.
(org-mode): Support for `align'.
(org-agenda-get-deadlines): Make sure priorities increase as the
due date approaches and is passed.
(org-remember-apply-template): Fixed problem with tags that
contain "_" or "@".
(org-make-link-regexps): Improve the regular expression for plain
links.
(org-agenda-get-closed): List each clocking entry.
(org-set-tags): Only tabify before tags if indent-tabs-mode is t.
(org-special-ctrl-k): New option.
(org-kill-line): New function.
(org-archive-all-done): Fixed incorrect number of stars in regexp.
(org-refile-get-location): New function.
(org-refile-goto-last-stored): New function.
(org-global-tags-completion-table): Add the value of org-tag-alist
in each buffer, to make sure that also unused tags will be
available for completion.
(org-columns-edit-value)
(org-columns-next-allowed-value): Only update if not in agenda.
(org-clocktable-steps): New function.
(org-dblock-write:clocktable): Call `org-clocktable-steps'.
(org-archive-subtree): Add the outline tree context as a property.
(org-closest-date): New optional argument `prefer'.
(org-goto-auto-isearch): New option.
(org-goto-map, org-get-location): Implement auto-isearch.
(org-goto-local-auto-isearch-map): New variable.
(org-goto-local-search-forward-headings)
(org-goto-local-auto-isearch): New functions
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Thu, 13 Mar 2008 08:54:11 +0000 |
parents | 5cb7ffd03e07 |
children | ddedcecb18ef |
line wrap: on
line source
/* Unexec for HP 9000 Series 800 machines. This file is in the public domain. Author: John V. Morris This file was written by John V. Morris at Hewlett Packard. Both the author and Hewlett Packard Co. have disclaimed the copyright on this file, and it is therefore in the public domain. (Search for "hp9k800" in copyright.list.) */ /* Bob Desinger <hpsemc!bd@hplabs.hp.com> Note that the GNU project considers support for HP operation a peripheral activity which should not be allowed to divert effort from development of the GNU system. Changes in this code will be installed when users send them in, but aside from that we don't plan to think about it, or about whether other Emacs maintenance might break it. Unexec creates a copy of the old a.out file, and replaces the old data area with the current data area. When the new file is executed, the process will see the same data structures and data values that the original process had when unexec was called. Unlike other versions of unexec, this one copies symbol table and debug information to the new a.out file. Thus, the new a.out file may be debugged with symbolic debuggers. If you fix any bugs in this, I'd like to incorporate your fixes. Send them to uunet!hpda!hpsemc!jmorris or jmorris%hpsemc@hplabs.HP.COM. CAVEATS: This routine saves the current value of all static and external variables. This means that any data structure that needs to be initialized must be explicitly reset. Variables will not have their expected default values. Unfortunately, the HP-UX signal handler has internal initialization flags which are not explicitly reset. Thus, for signals to work in conjunction with this routine, the following code must executed when the new process starts up. void _sigreturn (); ... sigsetreturn (_sigreturn); */ #ifdef emacs #include <config.h> #endif #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <a.out.h> #ifdef HPUX_USE_SHLIBS #include <dl.h> #endif /* brk value to restore, stored as a global. This is really used only if we used shared libraries. */ static long brk_on_dump = 0; /* Called from main, if we use shared libraries. */ int run_time_remap (ignored) char *ignored; { brk ((char *) brk_on_dump); } #undef roundup #define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */ #define min(x,y) (((x) < (y)) ? (x) : (y)) /* Create a new a.out file, same as old but with current data space */ unexec (new_name, old_name, new_end_of_text, dummy1, dummy2) char new_name[]; /* name of the new a.out file to be created */ char old_name[]; /* name of the old a.out file */ char *new_end_of_text; /* ptr to new edata/etext; NOT USED YET */ int dummy1, dummy2; /* not used by emacs */ { int old, new; int old_size, new_size; struct header hdr; struct som_exec_auxhdr auxhdr; long i; /* For the greatest flexibility, should create a temporary file in the same directory as the new file. When everything is complete, rename the temp file to the new name. This way, a program could update its own a.out file even while it is still executing. If problems occur, everything is still intact. NOT implemented. */ /* Open the input and output a.out files */ old = open (old_name, O_RDONLY); if (old < 0) { perror (old_name); exit (1); } new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777); if (new < 0) { perror (new_name); exit (1); } /* Read the old headers */ read_header (old, &hdr, &auxhdr); brk_on_dump = (long) sbrk (0); /* Decide how large the new and old data areas are */ old_size = auxhdr.exec_dsize; /* I suspect these two statements are separate to avoid a compiler bug in hpux version 8. */ i = (long) sbrk (0); new_size = i - auxhdr.exec_dmem; /* Copy the old file to the new, up to the data space */ lseek (old, 0, 0); copy_file (old, new, auxhdr.exec_dfile); /* Skip the old data segment and write a new one */ lseek (old, old_size, 1); save_data_space (new, &hdr, &auxhdr, new_size); /* Copy the rest of the file */ copy_rest (old, new); /* Update file pointers since we probably changed size of data area */ update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size); /* Save the modified header */ write_header (new, &hdr, &auxhdr); /* Close the binary file */ close (old); close (new); return 0; } /* Save current data space in the file, update header. */ save_data_space (file, hdr, auxhdr, size) int file; struct header *hdr; struct som_exec_auxhdr *auxhdr; int size; { /* Write the entire data space out to the file */ if (write (file, auxhdr->exec_dmem, size) != size) { perror ("Can't save new data space"); exit (1); } /* Update the header to reflect the new data size */ auxhdr->exec_dsize = size; auxhdr->exec_bsize = 0; } /* Update the values of file pointers when something is inserted. */ update_file_ptrs (file, hdr, auxhdr, location, offset) int file; struct header *hdr; struct som_exec_auxhdr *auxhdr; unsigned int location; int offset; { struct subspace_dictionary_record subspace; int i; /* Increase the overall size of the module */ hdr->som_length += offset; /* Update the various file pointers in the header */ #define update(ptr) if (ptr > location) ptr = ptr + offset update (hdr->aux_header_location); update (hdr->space_strings_location); update (hdr->init_array_location); update (hdr->compiler_location); update (hdr->symbol_location); update (hdr->fixup_request_location); update (hdr->symbol_strings_location); update (hdr->unloadable_sp_location); update (auxhdr->exec_tfile); update (auxhdr->exec_dfile); /* Do for each subspace dictionary entry */ lseek (file, hdr->subspace_location, 0); for (i = 0; i < hdr->subspace_total; i++) { if (read (file, &subspace, sizeof (subspace)) != sizeof (subspace)) { perror ("Can't read subspace record"); exit (1); } /* If subspace has a file location, update it */ if (subspace.initialization_length > 0 && subspace.file_loc_init_value > location) { subspace.file_loc_init_value += offset; lseek (file, -sizeof (subspace), 1); if (write (file, &subspace, sizeof (subspace)) != sizeof (subspace)) { perror ("Can't update subspace record"); exit (1); } } } /* Do for each initialization pointer record */ /* (I don't think it applies to executable files, only relocatables) */ #undef update } /* Read in the header records from an a.out file. */ read_header (file, hdr, auxhdr) int file; struct header *hdr; struct som_exec_auxhdr *auxhdr; { /* Read the header in */ lseek (file, 0, 0); if (read (file, hdr, sizeof (*hdr)) != sizeof (*hdr)) { perror ("Couldn't read header from a.out file"); exit (1); } if (hdr->a_magic != EXEC_MAGIC && hdr->a_magic != SHARE_MAGIC && hdr->a_magic != DEMAND_MAGIC) { fprintf (stderr, "a.out file doesn't have valid magic number\n"); exit (1); } lseek (file, hdr->aux_header_location, 0); if (read (file, auxhdr, sizeof (*auxhdr)) != sizeof (*auxhdr)) { perror ("Couldn't read auxiliary header from a.out file"); exit (1); } } /* Write out the header records into an a.out file. */ write_header (file, hdr, auxhdr) int file; struct header *hdr; struct som_exec_auxhdr *auxhdr; { /* Update the checksum */ hdr->checksum = calculate_checksum (hdr); /* Write the header back into the a.out file */ lseek (file, 0, 0); if (write (file, hdr, sizeof (*hdr)) != sizeof (*hdr)) { perror ("Couldn't write header to a.out file"); exit (1); } lseek (file, hdr->aux_header_location, 0); if (write (file, auxhdr, sizeof (*auxhdr)) != sizeof (*auxhdr)) { perror ("Couldn't write auxiliary header to a.out file"); exit (1); } } /* Calculate the checksum of a SOM header record. */ calculate_checksum (hdr) struct header *hdr; { int checksum, i, *ptr; checksum = 0; ptr = (int *) hdr; for (i = 0; i < sizeof (*hdr) / sizeof (int) - 1; i++) checksum ^= ptr[i]; return (checksum); } /* Copy size bytes from the old file to the new one. */ copy_file (old, new, size) int new, old; int size; { int len; int buffer[8192]; /* word aligned will be faster */ for (; size > 0; size -= len) { len = min (size, sizeof (buffer)); if (read (old, buffer, len) != len) { perror ("Read failure on a.out file"); exit (1); } if (write (new, buffer, len) != len) { perror ("Write failure in a.out file"); exit (1); } } } /* Copy the rest of the file, up to EOF. */ copy_rest (old, new) int new, old; { int buffer[4096]; int len; /* Copy bytes until end of file or error */ while ((len = read (old, buffer, sizeof (buffer))) > 0) if (write (new, buffer, len) != len) break; if (len != 0) { perror ("Unable to copy the rest of the file"); exit (1); } } #ifdef DEBUG display_header (hdr, auxhdr) struct header *hdr; struct som_exec_auxhdr *auxhdr; { /* Display the header information (debug) */ printf ("\n\nFILE HEADER\n"); printf ("magic number %d \n", hdr->a_magic); printf ("text loc %.8x size %d \n", auxhdr->exec_tmem, auxhdr->exec_tsize); printf ("data loc %.8x size %d \n", auxhdr->exec_dmem, auxhdr->exec_dsize); printf ("entry %x \n", auxhdr->exec_entry); printf ("Bss segment size %u\n", auxhdr->exec_bsize); printf ("\n"); printf ("data file loc %d size %d\n", auxhdr->exec_dfile, auxhdr->exec_dsize); printf ("som_length %d\n", hdr->som_length); printf ("unloadable sploc %d size %d\n", hdr->unloadable_sp_location, hdr->unloadable_sp_size); } #endif /* DEBUG */ /* arch-tag: d55a09ac-9427-4ec4-8496-cb9d7710774f (do not change this comment) */