Mercurial > hg > xemacs-beta
comparison src/emacs.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | 9ad43877534d |
children | b405438285a2 |
comparison
equal
deleted
inserted
replaced
184:bcd2674570bf | 185:3d6bfa290dbd |
---|---|
1563 If an option takes an argument, keep it and its argument together. */ | 1563 If an option takes an argument, keep it and its argument together. */ |
1564 | 1564 |
1565 static void | 1565 static void |
1566 sort_args (int argc, char **argv) | 1566 sort_args (int argc, char **argv) |
1567 { | 1567 { |
1568 char **new = (char **) xmalloc (sizeof (char *) * argc); | 1568 char **new = xnew_array (char *, argc); |
1569 /* For each element of argv, | 1569 /* For each element of argv, |
1570 the corresponding element of options is: | 1570 the corresponding element of options is: |
1571 0 for an option that takes no arguments, | 1571 0 for an option that takes no arguments, |
1572 1 for an option that takes one argument, etc. | 1572 1 for an option that takes one argument, etc. |
1573 -1 for an ordinary non-option argument. */ | 1573 -1 for an ordinary non-option argument. */ |
1574 int *options = (int *) xmalloc (sizeof (int) * argc); | 1574 int *options = xnew_array (int, argc); |
1575 int *priority = (int *) xmalloc (sizeof (int) * argc); | 1575 int *priority = xnew_array (int, argc); |
1576 int to = 1; | 1576 int to = 1; |
1577 int from; | 1577 int from; |
1578 int i; | 1578 int i; |
1579 int end_of_options_p = 0; | 1579 int end_of_options_p = 0; |
1580 | 1580 |
1711 of having to dump an emacs and then run that (when debugging emacs itself, | 1711 of having to dump an emacs and then run that (when debugging emacs itself, |
1712 this can be much faster)). [Actually, the speed difference isn't that | 1712 this can be much faster)). [Actually, the speed difference isn't that |
1713 much as long as your filesystem is local, and you don't end up with | 1713 much as long as your filesystem is local, and you don't end up with |
1714 a dumped version in case you want to rerun it. This function is most | 1714 a dumped version in case you want to rerun it. This function is most |
1715 useful when used as part of the `make all-elc' command. --ben] | 1715 useful when used as part of the `make all-elc' command. --ben] |
1716 This will \"restart\" emacs with the specified command-line arguments. | 1716 This will "restart" emacs with the specified command-line arguments. |
1717 */ | 1717 */ |
1718 (int nargs, Lisp_Object *args)) | 1718 (int nargs, Lisp_Object *args)) |
1719 { | 1719 { |
1720 int ac; | 1720 int ac; |
1721 Extbyte *wampum; | 1721 Extbyte *wampum; |
1722 int namesize; | 1722 int namesize; |
1723 int total_len; | 1723 int total_len; |
1724 Lisp_Object orig_invoc_name = Fcar (Vcommand_line_args); | 1724 Lisp_Object orig_invoc_name = Fcar (Vcommand_line_args); |
1725 Extbyte **wampum_all = (Extbyte **) alloca (nargs * sizeof (Extbyte *)); | 1725 Extbyte **wampum_all = alloca_array (Extbyte *, nargs); |
1726 int *wampum_all_len = (int *) alloca (nargs * sizeof (int)); | 1726 int *wampum_all_len = alloca_array (int, nargs); |
1727 | 1727 |
1728 assert (!gc_in_progress); | 1728 assert (!gc_in_progress); |
1729 | 1729 |
1730 if (run_temacs_argc < 0) | 1730 if (run_temacs_argc < 0) |
1731 error ("I've lost my temacs-hood."); | 1731 error ("I've lost my temacs-hood."); |