summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-07-01 17:57:46 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-07-01 17:57:46 -0700
commitc2418359b3e9f2eb7a72f4ea5245637190571cc8 (patch)
treeca95673e0a271b9e1e53b8b1a708184b10ec824b /src/doc.c
parent37afa042f9f56e3b3f22511ff222b49d728558d9 (diff)
downloademacs-c2418359b3e9f2eb7a72f4ea5245637190571cc8.tar.gz
Simplify buildobj processing.
* Makefile.in (buildobj.h): Make it a sequence of strings each followed by comma, rather than a single string. Put it into a .tmp file in case there's an error while generating it. (gl-stamp): Use .tmp for temp files. (mostlyclean): Clean .tmp files. * doc.c (buildobj): Move to just the routine that needs it. It's now an array of strings, so processing is simpler.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/doc.c b/src/doc.c
index 155a9891303..3c5a682c001 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "buffer.h"
#include "keyboard.h"
#include "keymap.h"
-#include "buildobj.h"
Lisp_Object Qfunction_documentation;
@@ -555,7 +554,6 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
}
}
-static const char buildobj[] = BUILDOBJ;
DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation,
1, 1, 0,
@@ -598,27 +596,16 @@ the same file name is found in the `doc-directory'. */)
/* Vbuild_files is nil when temacs is run, and non-nil after that. */
if (NILP (Vbuild_files))
- {
- const char *beg, *end;
-
- for (beg = buildobj; *beg; beg = end)
- {
- ptrdiff_t len;
-
- while (*beg && c_isspace (*beg)) ++beg;
-
- for (end = beg; *end && ! c_isspace (*end); ++end)
- if (*end == '/') beg = end + 1; /* Skip directory part. */
-
- len = end - beg;
- if (len > 4 && end[-4] == '.' && end[-3] == 'o')
- len -= 2; /* Just take .o if it ends in .obj */
-
- if (len > 0)
- Vbuild_files = Fcons (make_string (beg, len), Vbuild_files);
- }
- Vbuild_files = Fpurecopy (Vbuild_files);
- }
+ {
+ static char const *const buildobj[] =
+ {
+ #include "buildobj.h"
+ };
+ int i = sizeof buildobj / sizeof *buildobj;
+ while (0 <= --i)
+ Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files);
+ Vbuild_files = Fpurecopy (Vbuild_files);
+ }
fd = emacs_open (name, O_RDONLY, 0);
if (fd < 0)