diff options
| author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-09-23 19:49:00 +0400 |
|---|---|---|
| committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-09-23 19:49:00 +0400 |
| commit | 59e10fbd934323702a4586f50139d58db846bbf1 (patch) | |
| tree | 194db3962ed3b518afc92eed10ed16c29f6e0b15 /src/lisp.h | |
| parent | c03d2c89fbf878575cc46011df44f04103d8e19b (diff) | |
| download | emacs-59e10fbd934323702a4586f50139d58db846bbf1.tar.gz | |
Use known length of a Lisp string to copy it faster.
* lisp.h (lispstrcpy): New function. Add comment.
* callproc.c (child_setup):
* dbusbind.c (xd_append_arg):
* doc.c (get_doc_string):
* font.c (Ffont_xlfd_name):
* frame.c (xrdb_get_resource):
* process.c (Fmake_network_process, network_interface_info):
* w32fns.c (Fx_open_connection):
* w32proc.c (sys_spawnve):
* xfns.c (select_visual):
* xfont.c (xfont_list):
* xsmfns.c (x_session_initialize):
* xterm.c (x_term_init): Use it.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index 21f652b81ac..6ece4810b0b 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4462,6 +4462,15 @@ extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern char *xstrdup (const char *) ATTRIBUTE_MALLOC; extern char *xlispstrdup (Lisp_Object) ATTRIBUTE_MALLOC; extern void dupstring (char **, char const *); + +/* Like strcpy but uses known length of a Lisp string. */ + +INLINE char * +lispstrcpy (const char *dest, Lisp_Object string) +{ + return memcpy ((void *) dest, SSDATA (string), SBYTES (string) + 1); +} + extern void xputenv (const char *); extern char *egetenv_internal (const char *, ptrdiff_t); |
