* Author: Sebastian Freundt <hroptatyr@sxemacs.org>
*
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Bytecount slen = XSTRING_LENGTH(sequence);
Bufbyte *p = NULL;
Bufbyte *end = NULL;
- int speccount = specpdl_depth();
+ int speccount = specpdl_depth();
size_t i = 0;
- XMALLOC_ATOMIC_OR_ALLOCA(p, slen, Bufbyte);
- end = p + slen;
+ XMALLOC_ATOMIC_OR_ALLOCA(p, slen, Bufbyte);
+ end = p + slen;
memcpy(p, XSTRING_DATA(sequence), slen);
vals[i++] = result;
}
}
- XMALLOC_UNBIND(p, slen, speccount);
+ XMALLOC_UNBIND(p, slen, speccount);
} else if (BIT_VECTORP(sequence)) {
Lisp_Bit_Vector *v = XBIT_VECTOR(sequence);
}
UNGCPRO;
-}
+}
static void
bit_vector_map_inplace(Lisp_Object function, Lisp_Object bitvec)
To give a rough idea of the outcome sizes:
family size arity #combinations #permutations #cartesians
- 2 2 1 2 4
- 4 2 6 12 16
- 8 4 70 1680 4096
- 9 4 126 3024 6561
+ 2 2 1 2 4
+ 4 2 6 12 16
+ 8 4 70 1680 4096
+ 9 4 126 3024 6561
9 5 126 15120 59049
9 6 84 60480 531441
9 7 36 181440 4782969
- (1 1) if family is a dictionary and mode is 'pointwise or
'combination
- (1 1 ... 1) if there are n families, irrespective of mode.
- +-+- n -+
+ +-+- n -+
So it is '(1 1) if two families are given, '(1 1 1) for 3 families
and so forth.
result = Fconcat(nargs, args);
XMALLOC_UNBIND(args, nargs, speccount);
- return result;
+ return result;
}
DEFUN("mapcar", Fmapcar, 2, 2, 0, /*
{
size_t len = XINT(Flength(sequence));
Lisp_Object *args = NULL;
- Lisp_Object result;
+ Lisp_Object result;
int speccount = specpdl_depth();
- XMALLOC_OR_ALLOCA(args, len, Lisp_Object);
+ XMALLOC_OR_ALLOCA(args, len, Lisp_Object);
mapcar1(len, args, function, sequence);
result = Flist(len, args);
- XMALLOC_UNBIND(args, len, speccount);
- return result;
+ XMALLOC_UNBIND(args, len, speccount);
+ return result;
}
DEFUN("mapdllist", Fmapdllist, 2, 2, 0, /*
The result is a list of the same length as SEQUENCE.
SEQUENCE may be a list, a vector, a dllist, a bit vector, or a string.
*/
- (function, sequence))
+ (function, sequence))
{
size_t len = XINT(Flength(sequence));
Lisp_Object *args = NULL;
- Lisp_Object result;
+ Lisp_Object result;
int speccount = specpdl_depth();
- XMALLOC_OR_ALLOCA(args, len, Lisp_Object);
+ XMALLOC_OR_ALLOCA(args, len, Lisp_Object);
mapcar1(len, args, function, sequence);
result = Fdllist(len, args);
- XMALLOC_UNBIND(args, len, speccount);
+ XMALLOC_UNBIND(args, len, speccount);
return result;
}
* Author: Sebastian Freundt <hroptatyr@sxemacs.org>
*
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
typedef unsigned long md5_uint32;
# else
/* The following line is intended to evoke an error.
- Using #error is not portable enough. */
+ Using #error is not portable enough. */
"Cannot determine unsigned 32-bit data type."
# endif
# endif
#define OP(a, b, c, d, s, T) \
do \
- { \
+ { \
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
++words; \
CYCLIC (a, s); \
a += b; \
- } \
+ } \
while (0)
/* It is unfortunate that C does not provide an operator for
argument specifying the function to use. */
#undef OP
#define OP(f, a, b, c, d, k, s, T) \
- do \
+ do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
CYCLIC (a, s); \
XSETCOLOR_INSTANCE(val, c);
GCPRO2(val,dev);
- retval = MAYBE_INT_DEVMETH(XDEVICE(dev), initialize_color_instance,
- (c, name, dev,
- decode_error_behavior_flag(noerror)));
+ retval = MAYBE_INT_DEVMETH(XDEVICE(dev), initialize_color_instance,
+ (c, name, dev,
+ decode_error_behavior_flag(noerror)));
if (!retval) {
unbind_to(count, Qnil);
UNGCPRO;
print_opaque_ptr(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
const Lisp_Opaque_Ptr *p = XOPAQUE_PTR(obj);
-
+
write_fmt_string(printcharfun,
"#<INTERNAL OBJECT (SXEmacs bug?) "
"(opaque-ptr, adr=%p) %p>", p->ptr, p);
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* - all of EVP interface functionality minus `engine' support
* - all of PEM interface functionality
* - a simple SSL client
- *
+ *
* In addition, we are trying hard to provide not only an exact elisp
* copy of openssl, but also a _comprehensive_ one
*
- *
+ *
* * src/openssl.c: functions overview:
*
* - General
* ossl-connect - constructor for SSL connection objects
* ossl-finish - destructor of SSL connection objects
* ossl-pending - predicate if data is available for read
- * ossl-read -
+ * ossl-read -
* ossl-write -
* ossl-x509-get-subject
* ossl-x509-get-issuer
* ossl-sslcipher-name
* ossl-sslcipher-bits
*
- *
+ *
* * Todo (internally):
* - implement the usage of engines
* - implement X.509 stuff
* (ossl-ec-pkey-p pkey)
* ;; generate an ec (elliptic curve) key
* ;; Note: this is probably disabled in your openssl
- * (when (featurep 'openssl-ec)
+ * (when (featurep 'openssl-ec)
* (setq pkey (ossl-ec-generate-key))
* (ossl-ec-pkey-p pkey))
*
* Note: For these functions you must have enabled DH in your OpenSSL lib
* ;; not yet
*
- * - HYBRID
+ * - HYBRID
* (setq key (ossl-rsa-generate-key 2048 3))
* (setq enc (ossl-seal 'AES-256-ECB "a tight secret" key))
* (ossl-open 'AES-256-ECB (car enc) key (cadr enc) (caddr enc))
/*
*
* AUXILIARY
- *
+ *
*/
DEFUN("ossl-version", Fossl_version, 0, 0, 0, /*
Return a descriptive version number of the OpenSSL in use.
if (!__md) { \
EVP_cleanup(); \
return -1; \
- } \
+ } \
\
__kl = fun(__md); \
\
if (!__ciph) { \
EVP_cleanup(); \
return -1; \
- } \
+ } \
\
__kl = fun(__ciph); \
\
\f
/*
- *
+ *
* RAND
- *
+ *
*/
DEFUN("ossl-rand-bytes", Fossl_rand_bytes, 1, 1, 0, /*
Return COUNT bytes of randomness.
return Qnil;
}
EVP_DigestUpdate(mdctx, md_value, n);
- } while (n > 0);
+ } while (n > 0);
EVP_DigestFinal_ex(mdctx, md_value, &md_len);
EVP_MD_CTX_cleanup(mdctx);
}
-/*
+/*
*
* HMAC (aka keyed hashes)
- *
+ *
*/
DEFUN("ossl-hmac", Fossl_hmac, 3, 3, 0, /*
Return the message authentication code of MSG
return Qnil;
}
HMAC_Update(hmacctx, outbuf, n);
- } while (n > 0);
+ } while (n > 0);
HMAC_Final(hmacctx, outbuf, &outlen);
HMAC_CTX_cleanup(hmacctx);
}
-/*
- *
+/*
+ *
* SYMMETRIC CIPHER
- *
+ *
*/
DEFUN("ossl-bytes-to-key", Fossl_bytes_to_key, 5, 5, 0, /*
Derive a key and initialisation vector (iv) suitable for a cipher.
COUNT \(a positive integer\) is the iteration count to use. This
indicates how often the hash algorithm is called recursively.
-Note: You probably want to put a wrapping encoder function
+Note: You probably want to put a wrapping encoder function
\(like `base16-encode-string'\) around it, since this returns
binary string data.
*/
STRING is the text to be encrypted.
-KEY should be a key generated suitably for this cipher, for example
+KEY should be a key generated suitably for this cipher, for example
by `ossl-bytes-to-key'.
Optional fourth argument IV should be an initialisation vector
}
fseek(fp, 0, SEEK_END);
- file_size = ftell(fp);
+ file_size = ftell(fp);
fseek(fp, 0, SEEK_SET);
C_STRING_ALLOCA, string_ext, OSSL_CODING);
string_len = OSSL_STRING_LENGTH(string);
- if (!string_len)
+ if (!string_len)
error ("string must be of non-zero positive length.");
OpenSSL_add_all_algorithms();
}
fseek(fp, 0, SEEK_END);
- file_size = ftell(fp);
+ file_size = ftell(fp);
fseek(fp, 0, SEEK_SET);
}
-/*
- *
+/*
+ *
* ASYMMETRIC CIPHER
- *
+ *
*/
/* This is an opaque object for storing PKEYs in lisp */
Lisp_Object Qevp_pkeyp;
if (x509) {
X509_NAME *iss = X509_get_issuer_name(x509);
X509_NAME *sub = X509_get_subject_name(x509);
- write_c_string(" X509 Certificate", printcharfun);
+ write_c_string(" X509 Certificate", printcharfun);
write_c_string(" iss:", printcharfun);
write_c_string(X509_NAME_oneline(sub, NULL, 0), printcharfun);
write_c_string(" sub:", printcharfun);
write_c_string(";", printcharfun);
if (rsa_pkey_p(pkey))
- write_c_string(" RSA", printcharfun);
+ write_c_string(" RSA", printcharfun);
else if (dsa_pkey_p(pkey))
- write_c_string(" DSA", printcharfun);
+ write_c_string(" DSA", printcharfun);
else if (ec_pkey_p(pkey))
- write_c_string(" EC", printcharfun);
+ write_c_string(" EC", printcharfun);
if (ossl_pkey_has_private_data(pkey))
- write_c_string(" private/public key", printcharfun);
+ write_c_string(" private/public key", printcharfun);
else if (ossl_pkey_has_public_data(pkey))
- write_c_string(" public key", printcharfun);
+ write_c_string(" public key", printcharfun);
else
- write_c_string(" empty key", printcharfun);
+ write_c_string(" empty key", printcharfun);
if (EVP_PKEY_size(pkey) > 0) {
write_fmt_str(printcharfun, ", size %d", EVP_PKEY_size(pkey)*8);
}
}
- write_c_string(">", printcharfun);
+ write_c_string(">", printcharfun);
/* avoid some warning */
if (escapeflag);
}
DEFUN("ossl-pkey-size", Fossl_pkey_size, 1, 1, 0, /*
-Return the size a public key PKEY in bits.
+Return the size a public key PKEY in bits.
*/
(pkey))
{
error ("pkey1 must be of RSA type");
if (!rsa_pkey_p(pk2))
error ("pkey2 must be of RSA type");
-
+
rk1 = (pk1->pkey).rsa;
rk2 = (pk2->pkey).rsa;
error ("pkey1 must be of DSA type");
if (!dsa_pkey_p(pk2))
error ("pkey2 must be of DSA type");
-
+
dk1 = (pk1->pkey).dsa;
dk2 = (pk2->pkey).dsa;
Return an envelope derived from encrypting STRING by CIPHER under PKEY
with the hybrid technique.
-That is, create a random key/iv pair for the symmetric encryption with
+That is, create a random key/iv pair for the symmetric encryption with
CIPHER and encrypt that key/iv asymmetrically with the provided public
key.
-The envelope returned is a list
+The envelope returned is a list
\(encrypted_string encrypted_key encrypted_iv\)
where
`encrypted_string' is the (symmetrically) encrypted message
encrypt the result with the private key PKEY.
Note: Due to some relationship between the public key system and the
-message digest you cannot use every digest algorithm with every
+message digest you cannot use every digest algorithm with every
private key type.
The most certain results will be achieved using
RSA keys with RSA-* digests, DSA keys with DSA-* digests.
CHECK_SYMBOL(cipher);
OpenSSL_add_all_algorithms();
-
+
if (NILP(cipher)) {
ciph = NULL;
pass = NULL;
EVP_PKEY *pk;
Lisp_Object result;
/* bio stuff */
- BIO *b;
+ BIO *b;
/* gc stuff */
struct gcpro gcpro1;
if (!(b = BIO_new(BIO_s_null()))) {
UNGCPRO;
error("cannot open memory buffer");
- return Qnil;
+ return Qnil;
}
result = build_string("");
const EVP_CIPHER *ciph;
char *pass;
/* bio stuff */
- BIO *b;
+ BIO *b;
struct gcpro gcpro1, gcpro2, gcpro3;
GCPRO3(pkey, cipher, password);
CHECK_SYMBOL(cipher);
OpenSSL_add_all_algorithms();
-
+
if (NILP(cipher)) {
ciph = NULL;
pass = NULL;
if (!(b = BIO_new(BIO_s_null()))) {
UNGCPRO;
error("cannot open memory buffer");
- return Qnil;
+ return Qnil;
}
result = build_string("");
parent = XSSLCONN(obj)->parent;
write_c_string("#<OpenSSL socket layer: ", printcharfun);
- if (conn == NULL)
+ if (conn == NULL)
write_c_string("dead", printcharfun);
else
write_c_string(SSL_get_version(conn), printcharfun);
error("sslv2 client method not supported");
#endif
} else if (EQ(method, Qssl3)) {
-#if HAVE_SSLV3_CLIENT_METHOD
+#if HAVE_SSLV3_CLIENT_METHOD
meth = (SSL_METHOD *)SSLv3_client_method();
#else
error("sslv3 client method not supported");
#endif
} else if (EQ(method, Qssl23)) {
-#if HAVE_SSLV23_CLIENT_METHOD
+#if HAVE_SSLV23_CLIENT_METHOD
meth = (SSL_METHOD *)SSLv23_client_method();
#else
error("sslv23 client method not supported");
#endif
} else if (EQ(method, Qtls1)) {
-#if HAVE_TLSV1_CLIENT_METHOD
+#if HAVE_TLSV1_CLIENT_METHOD
meth = (SSL_METHOD *)TLSv1_client_method();
#else
error("tlsv1 client method not supported");
#endif
- } else {
-#if HAVE_TLSV1_CLIENT_METHOD
+ } else {
+#if HAVE_TLSV1_CLIENT_METHOD
meth = (SSL_METHOD *)TLSv1_client_method();
#else
error("default tlsv1 client method not supported");
#endif
- }
+ }
if (!RAND_status())
error("OSSL: not enough random data");
error("sslv2 client method not supported");
#endif
} else if (EQ(method, Qssl3)) {
-#if HAVE_SSLV3_SERVER_METHOD
+#if HAVE_SSLV3_SERVER_METHOD
meth = (SSL_METHOD *)SSLv3_server_method();
#else
error("sslv3 client method not supported");
#endif
} else if (EQ(method, Qssl23)) {
-#if HAVE_SSLV23_SERVER_METHOD
+#if HAVE_SSLV23_SERVER_METHOD
meth = (SSL_METHOD *)SSLv23_server_method();
#else
error("sslv23 client method not supported");
#endif
} else if (EQ(method, Qtls1)) {
-#if HAVE_TLSV1_SERVER_METHOD
+#if HAVE_TLSV1_SERVER_METHOD
meth = (SSL_METHOD *)TLSv1_server_method();
#else
error("tlsv1 client method not supported");
#endif
} else {
-#if HAVE_SSLV23_SERVER_METHOD
+#if HAVE_SSLV23_SERVER_METHOD
meth = (SSL_METHOD *)SSLv23_server_method();
#else
error("default sslv23 client method not supported");
CHECK_SSLCONN(ssl_conn);
- conn = XSSLCONN(ssl_conn)->ssl_conn;
+ conn = XSSLCONN(ssl_conn)->ssl_conn;
vrc = SSL_get_verify_result(conn);
result = Fcons(
int connected_p;
int protected_p;
- /* Low level streams used in input and output,
+ /* Low level streams used in input and output,
backup streams if network stream is proselytised */
Lisp_Object pipe_instream;
Lisp_Object pipe_outstream;
char *kludge;
va_list args;
int bufsize, retval, tries = 3;
- /* write_fmt_str is used for small prints usually... */
- char buffer[64+1];
+ /* write_fmt_str is used for small prints usually... */
+ char buffer[64+1];
int speccount = specpdl_depth();
va_start(args, fmt);
kludge = buffer;
SXE_VSNPRINT_VA(retval,buffer,kludge,bufsize,speccount,tries,Bufbyte,fmt,args);
-
+
if (retval == 0)
/* nothing to write */
return retval;
- use_fprintf = ! initialized ||fatal_error_in_progress ||
+ use_fprintf = ! initialized ||fatal_error_in_progress ||
inhibit_non_essential_printing_operations;
if (retval > 0) {
int retval;
va_list args;
va_start(args, fmt);
- retval = std_handle_out_va(stdout,
- (initialized && !fatal_error_in_progress
- ? GETTEXT(fmt) : fmt),
+ retval = std_handle_out_va(stdout,
+ (initialized && !fatal_error_in_progress
+ ? GETTEXT(fmt) : fmt),
args);
va_end(args);
return retval;
va_start(args, fmt);
stderr_out("\nSXEmacs: ");
- std_handle_out_va(stderr,
- (initialized && !fatal_error_in_progress
- ? GETTEXT(fmt) : fmt),
+ std_handle_out_va(stderr,
+ (initialized && !fatal_error_in_progress
+ ? GETTEXT(fmt) : fmt),
args);
stderr_out("\n");
}
}
-
+
if (stream) {
std_handle_out_external(stream, Qnil, extptr, extlen,
stream == stdout
* I assume that IEEE-754 format numbers can take 329 bytes for the worst
* case of -1e307 in 20d float_output_format. What is one to do (short of
* re-writing _doprnt to be more sane)?
- * -wsr
+ * -wsr
*/
void float_to_string(char *buf, fpfloat data, int maxlen)
{
len = snprintf(buf, sizeof(buf), "%s object %p", badness_string, val);
break;
default:
- len = snprintf(buf, sizeof(buf), "%s unknown badness %d",
+ len = snprintf(buf, sizeof(buf), "%s unknown badness %d",
badness_string, badness);
break;
}
output. */
#endif
- /* Try out custom printing */
- if (UNLIKELY(!(bool)inhibit_autoloads && !(bool)nodumpfile) &&
+ /* Try out custom printing */
+ if (UNLIKELY(!(bool)inhibit_autoloads && !(bool)nodumpfile) &&
!EQ(Qnil, Vcustom_object_printer) &&
- !EQ(Qnil, apply1(Vcustom_object_printer,
- Fcons(obj, Fcons(printcharfun, Qnil))))) {
- return;
+ !EQ(Qnil, apply1(Vcustom_object_printer,
+ Fcons(obj, Fcons(printcharfun, Qnil))))) {
+ return;
}
/* Detect circularities and truncate them.
static void
unix_init_process_io_handles(Lisp_Process * p, void *in, void *out, int flags)
{
- Lisp_Object process = Qnil;
+ Lisp_Object process = Qnil;
USID usid = FD_TO_USID((EMACS_INT)in);
- XSETPROCESS(process, p);
- puthash((const void *)usid, LISP_TO_VOID(process),
- usid_to_process);
+ XSETPROCESS(process, p);
+ puthash((const void *)usid, LISP_TO_VOID(process),
+ usid_to_process);
UNIX_DATA(p)->infd = (EMACS_INT)in;
}
int xforkin = forkin;
int xforkout = forkout;
- /* Checking for quit in the child is bad because that will
+ /* Checking for quit in the child is bad because that will
cause I/O, and that, in turn, can confuse the X connection. */
begin_dont_check_for_quit();
do {
Lstream_data_count writeret;
- if (p->process_type!=PROCESS_TYPE_NETWORK_SERVER_LISTEN) {
+ if (p->process_type!=PROCESS_TYPE_NETWORK_SERVER_LISTEN) {
chunklen = Lstream_read(lstream, chunkbuf, 512);
- }
+ }
old_sigpipe =
(SIGTYPE(*)(int))signal(SIGPIPE, send_process_trap);
if (chunklen > 0) {
case PROCESS_TYPE_NETWORK_SERVER_LISTEN:
report_file_error ("no writing to listen process possible",
list1 (proc));
- break;
+ break;
case PROCESS_TYPE_SSL:
case PROCESS_TYPE_PROC:
case PROCESS_TYPE_NETWORK:
/* closing the outstream could result in SIGPIPE, so ignore it. */
old_sigpipe = (SIGTYPE(*)(int))signal(SIGPIPE, SIG_IGN);
usid = FD_TO_USID(UNIX_DATA(p)->infd);
- event_stream_delete_stream_pair(p->pipe_instream,
- p->pipe_outstream);
+ event_stream_delete_stream_pair(p->pipe_instream,
+ p->pipe_outstream);
signal(SIGPIPE, old_sigpipe);
#ifdef SIGNALS_VIA_CHARACTERS
/* If possible, send signals to the entire pgrp
by sending an input character to it. */
- if (d->subtty >= 0)
+ if (d->subtty >= 0)
{
char sigchar = process_signal_char(d->subtty, signo);
if (sigchar) {
if (pgid == -1)
ioctl(d->infd, TIOCGPGRP, &pgid); /* BSD */
if (pgid == -1 && d->subtty >= 0)
- /* Only this works on AIX! */
- ioctl(d->subtty, TIOCGPGRP, &pgid);
+ /* Only this works on AIX! */
+ ioctl(d->subtty, TIOCGPGRP, &pgid);
#endif /* TIOCGPGRP */
if (pgid == -1) {
*/
static Lisp_Object unix_network_process_listener(Lisp_Object process)
{
- Lisp_Process *listener = 0,
- *p = XPROCESS(process);
- Lisp_Object ret = Qnil;
- int sock = 0;
- struct gcpro ngcpro1;
-
- if (!PROCESS_READABLE_P(p))
- return Qnil;
-
- if (!CONSP(p->pid) || NILP(XCDR(XCDR(p->pid))))
- return Qnil;
-
- NGCPRO1(ret);
- sock = XINT(XCAR(XCDR(p->pid)));
- listener = get_process_from_usid(FD_TO_USID(sock));
- ret = listener ? (Lisp_Object)listener : Qnil;
- NUNGCPRO;
- return ret;
+ Lisp_Process *listener = 0,
+ *p = XPROCESS(process);
+ Lisp_Object ret = Qnil;
+ int sock = 0;
+ struct gcpro ngcpro1;
+
+ if (!PROCESS_READABLE_P(p))
+ return Qnil;
+
+ if (!CONSP(p->pid) || NILP(XCDR(XCDR(p->pid))))
+ return Qnil;
+
+ NGCPRO1(ret);
+ sock = XINT(XCAR(XCDR(p->pid)));
+ listener = get_process_from_usid(FD_TO_USID(sock));
+ ret = listener ? (Lisp_Object)listener : Qnil;
+ NUNGCPRO;
+ return ret;
}
/*
*/
static void unix_network_server_accept(Lisp_Object process)
{
- Lisp_Process *p = XPROCESS(process);
- Lisp_Object np = Qnil;
- Lisp_Object acceptor = Qnil, filter = Qnil, sentinel = Qnil;
- Lisp_Object bufname = Qnil;
- Lisp_Object buffer = Qnil;
- long int ns, inch, outch;
+ Lisp_Process *p = XPROCESS(process);
+ Lisp_Object np = Qnil;
+ Lisp_Object acceptor = Qnil, filter = Qnil, sentinel = Qnil;
+ Lisp_Object bufname = Qnil;
+ Lisp_Object buffer = Qnil;
+ long int ns, inch, outch;
struct sockaddr_in sa;
- int sa_size = sizeof(sa);
- struct gcpro ngcpro1, ngcpro2, ngcpro3, ngcpro4, ngcpro5;
-
- if (!PROCESS_READABLE_P(p))
- return;
-
- /* Make sure the listen process is not disconnected
- afterwards. We have to make this here because in process.c
- we should not have any knowledge we need to do this, and in
- unix_open_network_server_stream we have no access to the
- process struct. It works, so I'm not complaining...
- */
- UNIX_DATA(p)->connected_via_filedesc_p = 1;
-
- errno = 0; /* if we got an error, let it be from the accept call */
- ns = accept((int)UNIX_DATA(p)->infd, (struct sockaddr*)(&sa),
+ int sa_size = sizeof(sa);
+ struct gcpro ngcpro1, ngcpro2, ngcpro3, ngcpro4, ngcpro5;
+
+ if (!PROCESS_READABLE_P(p))
+ return;
+
+ /* Make sure the listen process is not disconnected
+ afterwards. We have to make this here because in process.c
+ we should not have any knowledge we need to do this, and in
+ unix_open_network_server_stream we have no access to the
+ process struct. It works, so I'm not complaining...
+ */
+ UNIX_DATA(p)->connected_via_filedesc_p = 1;
+
+ errno = 0; /* if we got an error, let it be from the accept call */
+ ns = accept((int)UNIX_DATA(p)->infd, (struct sockaddr*)(&sa),
(socklen_t*)&sa_size);
- if ( ns < 0 )
- return;
-
- NGCPRO5(np,bufname,acceptor,filter,sentinel);
- if (CONSP(p->process_type_data)) {
- acceptor = XCAR(p->process_type_data);
- filter = XCDR(p->process_type_data);
- if (CONSP(filter)) {
- sentinel = XCDR(filter);
- filter = XCAR(filter);
- }
- if (CONSP(sentinel)) {
- bufname = XCDR(sentinel);
- sentinel = XCAR(sentinel);
- }
- if (CONSP(bufname)) {
- bufname = XCAR(bufname);
- }
- }
- if (!NILP(bufname)) {
- Lisp_Object args[] = {
+ if ( ns < 0 )
+ return;
+
+ NGCPRO5(np,bufname,acceptor,filter,sentinel);
+ if (CONSP(p->process_type_data)) {
+ acceptor = XCAR(p->process_type_data);
+ filter = XCDR(p->process_type_data);
+ if (CONSP(filter)) {
+ sentinel = XCDR(filter);
+ filter = XCAR(filter);
+ }
+ if (CONSP(sentinel)) {
+ bufname = XCDR(sentinel);
+ sentinel = XCAR(sentinel);
+ }
+ if (CONSP(bufname)) {
+ bufname = XCAR(bufname);
+ }
+ }
+ if (!NILP(bufname)) {
+ Lisp_Object args[] = {
build_string("<server port:%S listened_on:%S>"),
- make_int(sa.sin_port), bufname
+ make_int(sa.sin_port), bufname
};
- bufname = Fformat( 3, args );
- } else {
- Lisp_Object args[] = {
+ bufname = Fformat( 3, args );
+ } else {
+ Lisp_Object args[] = {
build_string("<server proc:%S pid:%S service:%S>"),
p->name, p->pid, make_int(sa.sin_port)
};
- bufname = Fformat( 5, args );
- }
- if (!NILP(bufname) ) {
- bufname = Fgenerate_new_buffer_name(bufname,Qnil);
- buffer = Fget_buffer_create(bufname);
- }
- np = make_process_internal(p->name);
- XPROCESS(np)->pid = Fcons( make_int(sa.sin_port),
- Fcons(make_int(UNIX_DATA(p)->infd),p->pid));
+ bufname = Fformat( 5, args );
+ }
+ if (!NILP(bufname) ) {
+ bufname = Fgenerate_new_buffer_name(bufname,Qnil);
+ buffer = Fget_buffer_create(bufname);
+ }
+ np = make_process_internal(p->name);
+ XPROCESS(np)->pid = Fcons( make_int(sa.sin_port),
+ Fcons(make_int(UNIX_DATA(p)->infd),p->pid));
XPROCESS(np)->process_type = PROCESS_TYPE_NETWORK;
XPROCESS(np)->buffer = buffer;
- inch = ns;
- outch = dup(ns);
+ inch = ns;
+ outch = dup(ns);
set_socket_nonblocking_maybe(inch, sa.sin_port, "tcp");
init_process_io_handles(XPROCESS(np), (void *)inch, (void *)outch,
STREAM_NETWORK_CONNECTION);
- /* Process the call backs.. */
- if (CONSP(p->process_type_data)) {
- if (!NILP(filter)) {
- XPROCESS(np)->filter = filter;
- }
- if (!NILP(sentinel)) {
- XPROCESS(np)->sentinel = sentinel;
- }
- if (!NILP(acceptor)) {
- int speccount = specpdl_depth();
- record_unwind_protect(exec_acceptor_unwind,
- noseeum_cons(process, acceptor));
- running_asynch_code = 1;
- call1_trapping_errors("Error in server stream acceptor",
- acceptor, np);
- running_asynch_code = 0;
- restore_match_data();
- unbind_to(speccount, Qnil);
-
- }
- } else {
- /* We have to log something here... */
- }
+ /* Process the call backs.. */
+ if (CONSP(p->process_type_data)) {
+ if (!NILP(filter)) {
+ XPROCESS(np)->filter = filter;
+ }
+ if (!NILP(sentinel)) {
+ XPROCESS(np)->sentinel = sentinel;
+ }
+ if (!NILP(acceptor)) {
+ int speccount = specpdl_depth();
+ record_unwind_protect(exec_acceptor_unwind,
+ noseeum_cons(process, acceptor));
+ running_asynch_code = 1;
+ call1_trapping_errors("Error in server stream acceptor",
+ acceptor, np);
+ running_asynch_code = 0;
+ restore_match_data();
+ unbind_to(speccount, Qnil);
+
+ }
+ } else {
+ /* We have to log something here... */
+ }
event_stream_select_process(XPROCESS(np));
- NUNGCPRO;
+ NUNGCPRO;
}
/* Open a TCP network connection to a given HOST/SERVICE.
static void
unix_open_network_server_stream(Lisp_Object name, Lisp_Object host,
- Lisp_Object service, Lisp_Object protocol,
- void **vinfd, void **voutfd)
+ Lisp_Object service, Lisp_Object protocol,
+ void **vinfd, void **voutfd)
{
EMACS_INT inch;
EMACS_INT outch;
volatile int port;
volatile int retry = 0;
int retval;
- /* FIXME: Limited to 5 since it is the maximum for several BSD
- based implementations of sockets, and it is an acceptable
- value for a low rate of service purpose like this facility
- was designed for. */
- int listenQ = 5;
+ /* FIXME: Limited to 5 since it is the maximum for several BSD
+ based implementations of sockets, and it is an acceptable
+ value for a low rate of service purpose like this facility
+ was designed for. */
+ int listenQ = 5;
if (!EQ(protocol, Qtcp) && !EQ(protocol, Qudp))
else /* EQ (protocol, Qudp) */
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = 0;
- if (SYMBOLP(host) ) {
- if (EQ(host,Qip_any)) {
- hints.ai_flags |= AI_PASSIVE;
- } else if (!EQ(host,Qlocalhost)) {
- invalid_argument("invalid host ",host);
- } else {
- /* If using localhost, not passing
- AI_PASSIVE will cause getaddrinfo
- to return a proper addr spec for
- listening only to local
- connections. */
- }
- retval = getaddrinfo(NULL, portstring, &hints, &res);
- } else {
- CHECK_STRING(host);
- LISP_STRING_TO_EXTERNAL(host, ext_host, Qnative);
- retval = getaddrinfo(ext_host, portstring, &hints, &res);
- }
+ if (SYMBOLP(host) ) {
+ if (EQ(host,Qip_any)) {
+ hints.ai_flags |= AI_PASSIVE;
+ } else if (!EQ(host,Qlocalhost)) {
+ invalid_argument("invalid host ",host);
+ } else {
+ /* If using localhost, not passing
+ AI_PASSIVE will cause getaddrinfo
+ to return a proper addr spec for
+ listening only to local
+ connections. */
+ }
+ retval = getaddrinfo(NULL, portstring, &hints, &res);
+ } else {
+ CHECK_STRING(host);
+ LISP_STRING_TO_EXTERNAL(host, ext_host, Qnative);
+ retval = getaddrinfo(ext_host, portstring, &hints, &res);
+ }
if (retval != 0) {
char *gai_error_l;
a hung network. */
can_break_system_calls = 1;
retval = bind(s, lres->ai_addr, lres->ai_addrlen);
- if (retval >= 0 )
- retval = listen(s, listenQ);
+ if (retval >= 0 )
+ retval = listen(s, listenQ);
can_break_system_calls = 0;
if (retval == -1) {
xerrno = errno;
invalid_argument("Unknown service", service);
port = svc_info->s_port;
}
- if (SYMBOLP(host)) {
- if (EQ(host,Qip_any)) {
- address.sin_addr.s_host = htonl(INADDR_ANY);
- } else if (EQ(host,Qlocalhost)) {
- address.sin_addr.s_host = htonl(INADDR_LOOPBACK);
- } else {
- invalid_argument("invalid host ",host);
- }
- } else {
- get_internet_address(host, &address, ERROR_ME);
- }
+ if (SYMBOLP(host)) {
+ if (EQ(host,Qip_any)) {
+ address.sin_addr.s_host = htonl(INADDR_ANY);
+ } else if (EQ(host,Qlocalhost)) {
+ address.sin_addr.s_host = htonl(INADDR_LOOPBACK);
+ } else {
+ invalid_argument("invalid host ",host);
+ }
+ } else {
+ get_internet_address(host, &address, ERROR_ME);
+ }
address.sin_port = port;
if (EQ(protocol, Qtcp))
can_break_system_calls = 1;
retval =
bind(s, (struct sockaddr *)&address, sizeof(address));
- if ( retval >= 0 )
- listen( s, listenQ ); /* @@@ FIXME: This should be a parameter */
+ if ( retval >= 0 )
+ listen( s, listenQ ); /* @@@ FIXME: This should be a parameter */
can_break_system_calls = 0;
if (retval == -1 && errno != EISCONN) {
int xerrno = errno;
int netp = ((process->process_type == PROCESS_TYPE_NETWORK) ||
(process->process_type == PROCESS_TYPE_MULTICAST) ||
(process->process_type == PROCESS_TYPE_SSL) ||
- (process->process_type == PROCESS_TYPE_NETWORK_SERVER_LISTEN));
+ (process->process_type == PROCESS_TYPE_NETWORK_SERVER_LISTEN));
switch (process->process_type) {
case PROCESS_TYPE_NETWORK:
write_c_string(
Lisp_Object process;
CVOID_TO_LISP(process, vval);
return XPROCESS(process);
- } else
+ } else
return 0;
}
network-process. Returns nil if process is closed or was not accepted
through a network server stream.
-Args are PROCESS
+Args are PROCESS
PROCESS should be a network-stream process accepted through a network
*/
(process))
{
- CHECK_PROCESS(process);
- return MAYBE_LISP_PROCMETH(network_process_listener, (process));
+ CHECK_PROCESS(process);
+ return MAYBE_LISP_PROCMETH(network_process_listener, (process));
}
acceptor function is called. If defined filter and sentinel are set
for the new connection process .
-Input and output work as for subprocesses; `delete-process' closes it.
+Input and output work as for subprocesses; `delete-process' closes it.
-Args are NAME BUFFER HOST SERVICE &optional PROTOCOL ACCEPTOR .
+Args are NAME BUFFER HOST SERVICE &optional PROTOCOL ACCEPTOR .
NAME is name for process. It is modified if necessary to make it
unique.
specify an output stream or filter function to handle the output. No
real process output of listening process is expected. However the
name of this buffer will be used as a base for generating a new
- buffer name for the accepted connections.
+ buffer name for the accepted connections.
The BUFFER may be also nil, meaning that this process is not
associated with any buffer. In this case a filter should be specified
- otherwise there will be no way to retrieve the process output.
+ otherwise there will be no way to retrieve the process output.
BUFFER may also be 'auto in which case a buffer is automatically
created for the accepted connection.
acceptance with the accepted connection process as the single argument.
Seventh argument FILTER is a function which will be set as filter for
the accepted connections automatically. See `set-process-filter' for
- more details.
+ more details.
Eight argument SENTINEL is a function which will be set as sentinel
the accepted connections automatically. see `set-process-sentinel'
for more details.
/* !!#### This function has not been Mule-ized */
/* This function can GC */
Lisp_Object process = Qnil;
- Lisp_Object bufname = Qnil;
+ Lisp_Object bufname = Qnil;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6, gcpro7, gcpro8, ngcpro1, ngcpro2;
void *inch, *outch;
/* Since this code is inside HAVE_SOCKETS, existence of
open_network_stream is mandatory */
- PROCMETH(open_network_server_stream, (name, host, service, protocol,
+ PROCMETH(open_network_server_stream, (name, host, service, protocol,
&inch, &outch));
NGCPRO2(process,bufname);
if (!NILP(buffer) && !SYMBOLP(buffer)) {
buffer = Fget_buffer_create(buffer);
- bufname = Fbuffer_name(buffer);
+ bufname = Fbuffer_name(buffer);
} else if (SYMBOLP(buffer) && !NILP(buffer) && ! EQ(Qauto,buffer) ) {
- error("unknown buffer symbol %s",
- string_data(symbol_name(XSYMBOL(buffer))));
- return Qnil;
-
+ error("unknown buffer symbol %s",
+ string_data(symbol_name(XSYMBOL(buffer))));
+ return Qnil;
+
} else {
- Lisp_Object args[] = {
+ Lisp_Object args[] = {
build_string("<listen proc:%S host:%S service:%S protocol:%S>"),
name, host, service, protocol
};
- bufname = Fformat( 5, args );
- }
+ bufname = Fformat( 5, args );
+ }
process = make_process_internal(name);
XPROCESS(process)->pid = Fcons(service, host);
XPROCESS(process)->process_type = PROCESS_TYPE_NETWORK_SERVER_LISTEN;
XPROCESS(process)->buffer = buffer;
- {
- /* Just opened a scope because I like to keep definitions close to
- usage specially temporary ones... */
- Lisp_Object args[] = { acceptor, filter, sentinel, bufname };
- XPROCESS(process)->process_type_data = Flist(4,args);
- }
+ {
+ /* Just opened a scope because I like to keep definitions close to
+ usage specially temporary ones... */
+ Lisp_Object args[] = { acceptor, filter, sentinel, bufname };
+ XPROCESS(process)->process_type_data = Flist(4,args);
+ }
init_process_io_handles(XPROCESS(process), (void *)inch, (void *)outch,
STREAM_NETWORK_SERVER_CONNECTION);
*/
(name, buffer, infd, outfd))
{
- return connect_to_file_descriptor(name, buffer, infd, outfd);
+ return connect_to_file_descriptor(name, buffer, infd, outfd);
}
#ifdef HAVE_MULTICAST
}
switch (p->process_type) {
- case PROCESS_TYPE_NETWORK_SERVER_LISTEN:
- /* We must have add a connect... We should accept and call
- the sentinel.. */
- PROCMETH(network_server_accept, (wrap_object(p)));
- nbytes = 0;
- break;
+ case PROCESS_TYPE_NETWORK_SERVER_LISTEN:
+ /* We must have add a connect... We should accept and call
+ the sentinel.. */
+ PROCMETH(network_server_accept, (wrap_object(p)));
+ nbytes = 0;
+ break;
case PROCESS_TYPE_PROC:
case PROCESS_TYPE_NETWORK:
case PROCESS_TYPE_MULTICAST:
return Qnil;
}
-DEFUN("set-process-output-coding-system",
+DEFUN("set-process-output-coding-system",
Fset_process_output_coding_system, 2, 2, 0, /*
Set PROCESS's output coding system to CODESYS.
*/
return XPROCESS(process)->kill_without_query ? Qt : Qnil;
}
\f
-static void
+static void
mark_usid_to_process(Lisp_Object obj)
{
struct hash_table *ht = get_dynacat(obj);
DEFSUBR(Fprocess_list);
DEFSUBR(Fstart_process_internal);
#ifdef HAVE_SOCKETS
- defsymbol(&Qip_any, "ip_any");
- defsymbol(&Qlocalhost, "localhost");
+ defsymbol(&Qip_any, "ip_any");
+ defsymbol(&Qlocalhost, "localhost");
DEFSUBR(Fopen_network_stream_internal);
DEFSUBR(Fopen_network_server_stream_internal);
DEFSUBR(Fnetwork_process_listener);
PROCESS_TYPE_NETWORK,
PROCESS_TYPE_MULTICAST,
PROCESS_TYPE_SSL,
- PROCESS_TYPE_NETWORK_SERVER_LISTEN,
+ PROCESS_TYPE_NETWORK_SERVER_LISTEN,
/* last entry holds the number of process types */
PROCESS_TYPES_COUNT
};
Lisp_Object service, Lisp_Object protocol,
void **vinfd, void **voutfd);
void (*open_network_server_stream) (Lisp_Object name, Lisp_Object host,
- Lisp_Object service, Lisp_Object protocol,
- void **vinfd, void **voutfd);
+ Lisp_Object service, Lisp_Object protocol,
+ void **vinfd, void **voutfd);
void (*network_server_accept) (Lisp_Object process);
Lisp_Object (*network_process_listener) (Lisp_Object process);
#ifdef HAVE_MULTICAST
if (rte->first == rte->last)
write_fmt_str(printcharfun, "%ld ", (long)(rte->first));
else
- write_fmt_str(printcharfun, "(%ld %ld) ",
+ write_fmt_str(printcharfun, "(%ld %ld) ",
(long)(rte->first),
(long)(rte->last));
print_internal(rte->val, printcharfun, 1);
/* Make a copy of the source path since we may need to modify it. */
strncpy(copy_path, path, sizeof(copy_path)-1);
- copy_path[sizeof(copy_path)-1]='\0';
+ copy_path[sizeof(copy_path)-1]='\0';
path = copy_path;
max_path = copy_path + PATH_MAX - 2;
/* True if `size1' is non-NULL and PTR is pointing anywhere inside
`string1' or just past its end. This works if PTR is NULL, which is
a good thing. */
-#define FIRST_STRING_P(ptr) \
+#define FIRST_STRING_P(ptr) \
(size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
/* (Re)Allocate N items of type T using malloc, or fail. */
#define DEBUG_PRINT2(x1, x2) printf(x1, x2)
#define DEBUG_PRINT3(x1, x2, x3) printf(x1, x2, x3)
#define DEBUG_PRINT4(x1, x2, x3, x4) printf(x1, x2, x3, x4)
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
print_partial_compiled_pattern(s, e)
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
print_double_string (w, s1, sz1, s2, sz2)
((int) (fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \
? 0 \
: ((fail_stack).stack = (fail_stack_elt_t *) \
- REGEX_REALLOCATE_STACK ((fail_stack).stack, \
- (fail_stack).size * sizeof (fail_stack_elt_t), \
- ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
+ REGEX_REALLOCATE_STACK ((fail_stack).stack, \
+ (fail_stack).size * sizeof (fail_stack_elt_t), \
+ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
\
(fail_stack).stack == NULL \
? 0 \
- : ((fail_stack).size <<= 1, \
- 1)))
+ : ((fail_stack).size <<= 1, \
+ 1)))
/* Push pointer POINTER on FAIL_STACK.
Return 1 if was able to do so and 0 if ran out of memory allocating
/* We actually push this many items. */
#define NUM_FAILURE_ITEMS \
- ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \
+ ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \
+ NUM_NONREG_ITEMS)
/* How many items can still be added to the stack without overflowing it. */
`pend', `string1', `size1', `string2', and `size2'. */
#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, \
- regstart, regend, reg_info) \
+ regstart, regend, reg_info) \
do { \
int this_reg; \
const unsigned char *string_temp; \
#define PATFETCH_RAW(c) \
do {if (p == pend) return REG_EEND; \
assert (p < pend); \
- c = charptr_emchar (p); \
+ c = charptr_emchar (p); \
INC_CHARPTR (p); \
} while (0)
#endif
/* Get the next unsigned number in the uncompiled pattern. */
-#define GET_UNSIGNED_NUMBER(num) \
+#define GET_UNSIGNED_NUMBER(num) \
{ if (p != pend) \
{ \
- PATFETCH (c); \
- while (ISDIGIT (c)) \
- { \
- if (num < 0) \
- num = 0; \
- num = num * 10 + c - '0'; \
- if (p == pend) \
- break; \
- PATFETCH (c); \
- } \
- } \
+ PATFETCH (c); \
+ while (ISDIGIT (c)) \
+ { \
+ if (num < 0) \
+ num = 0; \
+ num = num * 10 + c - '0'; \
+ if (p == pend) \
+ break; \
+ PATFETCH (c); \
+ } \
+ } \
}
#define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */
`used' is set to the length of the compiled pattern;
`fastmap_accurate' is zero;
`re_ngroups' is the number of groups/subexpressions (including shy
- groups) in PATTERN;
+ groups) in PATTERN;
`re_nsub' is the number of non-shy groups in PATTERN;
`not_bol' and `not_eol' are zero;
character class. */
else if (syntax & RE_CHAR_CLASSES &&
- c == '[' && *p == ':') {
+ c == '[' && *p == ':') {
/* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1];
/* Convert external to internal as soon
as possible. */
reg = bufp->external_to_internal_register[reg];
-
+
/* Can't back reference to a
subexpression if inside it. */
if (group_in_compile_stack(
/* Call before fetching a character with *d. This switches over to
string2 if necessary. */
#define REGEX_PREFETCH() \
- while (d == dend) \
+ while (d == dend) \
{ \
/* End of string2 => fail. */ \
- if (dend == end_match_2) \
- goto fail; \
- /* End of string1 => advance to string2. */ \
+ if (dend == end_match_2) \
+ goto fail; \
+ /* End of string1 => advance to string2. */ \
d = string2; \
dend = end_match_2; \
}
/* Test if CH is a word-constituent character. (XEmacs change) */
#define WORDCHAR_P_UNSAFE(ch) \
(SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), \
- ch) == Sword)
+ ch) == Sword)
/* Free everything we malloc. */
#ifdef MATCH_MAY_ALLOCATE
if (regs && !bufp->no_sub) {
/* Have the register data arrays been
allocated? */
- if (bufp->regs_allocated == REGS_UNALLOCATED) {
- /* No. So allocate them with malloc.
+ if (bufp->regs_allocated == REGS_UNALLOCATED) {
+ /* No. So allocate them with malloc.
We need one extra element beyond
`num_regs' for the `-1' marker GNU
code uses. */
return -2;
}
bufp->regs_allocated = REGS_REALLOCATE;
- } else if (bufp->regs_allocated == REGS_REALLOCATE) {
- /* Yes. If we need more elements than were already
+ } else if (bufp->regs_allocated == REGS_REALLOCATE) {
+ /* Yes. If we need more elements than were already
allocated, reallocate them. If we need fewer, just
leave it alone. */
if (regs->num_regs < num_nonshy_regs + 1) {
if (!FAIL_STACK_EMPTY()) {
/* A restart point is known. Restore to that state. */
DEBUG_PRINT1("\nFAIL:\n");
- POP_FAILURE_POINT(d, p, lowest_active_reg,
- highest_active_reg, regstart, regend,
+ POP_FAILURE_POINT(d, p, lowest_active_reg,
+ highest_active_reg, regstart, regend,
reg_info);
/* If this failure point is a dummy, try the next one. */
msg_size = strlen(msg) + 1; /* Includes the null. */
if (errbuf_size != 0) {
- strncpy(errbuf, msg, errbuf_size - 1);
- errbuf[errbuf_size-1]='\0';
+ strncpy(errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size-1]='\0';
}
return msg_size;
/* If this bit is set, then ^ and $ are always anchors (outside bracket
expressions, of course).
If this bit is not set, then it depends:
- ^ is an anchor if it is at the beginning of a regular
- expression or after an open-group or an alternation operator;
- $ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
-#define RE_SYNTAX_POSIX_AWK \
+#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS)
static void
compre_prfun(Lisp_Object obj, Lisp_Object pcfun, int escflag)
{
- write_fmt_str(pcfun, "#<compiled regexp %lx",
+ write_fmt_str(pcfun, "#<compiled regexp %lx",
(long unsigned int)((COMPRE_GET(obj))->buffer));
if (escflag);
}
fixup_internal_substring(nonreloc, reloc, offset, &length);
-
+
if (!NILP(reloc)) {
if (no_quit) {
newnonreloc = XSTRING_DATA(reloc);
Author: Sebastian Freundt <hroptatyr@sxemacs.org>
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
#endif
#endif /* INCLUDED_semaphore_h */
-
* Author: Sebastian Freundt <hroptatyr@sxemacs.org>
*
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Author: Sebastian Freundt <hroptatyr@sxemacs.org>
*
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Author: Sebastian Freundt <hroptatyr@sxemacs.org>
*
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
(tmphash < hash);
tmp = next_node(tmp) ) {}
result = tmp;
- }
+ }
return result;
}
mark_object(node_data_value(parent_node(tmp)));
}
- mark_object(XSKIPLIST_PLIST(obj));
+ mark_object(XSKIPLIST_PLIST(obj));
return XSKIPLIST_PLIST(obj);
}
static void
print_skiplist(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- write_fmt_str(printcharfun, "#<skiplist :size %lu :levels %lu >",
- (long unsigned int)XSKIPLIST_NNODES(obj),
+ write_fmt_str(printcharfun, "#<skiplist :size %lu :levels %lu >",
+ (long unsigned int)XSKIPLIST_NNODES(obj),
(long unsigned int)XSKIPLIST_NLEVELS(obj));
}
*/
(skiplist))
{
- CHECK_SKIPLIST(skiplist);
- return XSKIPLIST_PLIST(skiplist);
+ CHECK_SKIPLIST(skiplist);
+ return XSKIPLIST_PLIST(skiplist);
}
static const struct lrecord_description skiplist_description[] = {
{
CHECK_SKIPLIST(skiplist);
-
+
return copy_skiplist(XSKIPLIST(skiplist));
}
Return the union skiplist of SKIPLISTS.
Args are &rest SKIPLIST.
-The union is a skiplist containing all key-value-pairs which are
+The union is a skiplist containing all key-value-pairs which are
in at least one of the SKIPLISTS.
Note: Key-value-pairs with equal keys and distinct values are
Lisp_Object args[3];
skiplist_level_t lev;
struct gcpro gcpro1, gcpro2;
-
- CHECK_SKIPLIST(skiplist);
+
+ CHECK_SKIPLIST(skiplist);
GCPRO2(function, skiplist);
- sl = XSKIPLIST(skiplist);
+ sl = XSKIPLIST(skiplist);
lev = next_node(skiplist_foot(sl)); /* start at the bottom */
while (lev) {
args[0] = function;
* Author: Sebastian Freundt <hroptatyr@sxemacs.org>
*
* This file is part of SXEmacs.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
+------+ +------+ +------+
| data | nil | data | nil | data | nil
+------+ ^ +------+ ^ +------+ ^
- |\+--|--+ \+--|--+ |\+--|--+
- | |ptr0-|---------->|ptr0-|---------|>|ptr0-|---->nil
- | +--^--+ +--^--+ | +--^--+
- | | | | |
- \+--|--+ head \+--|--+
- |ptr1-|---------------------------->|ptr1-|---->nil
- +--^--+ +--^--+
- | |
+ |\+--|--+ \+--|--+ |\+--|--+
+ | |ptr0-|---------->|ptr0-|---------|>|ptr0-|---->nil
+ | +--^--+ +--^--+ | +--^--+
+ | | | | |
+ \+--|--+ head \+--|--+
+ |ptr1-|---------------------------->|ptr1-|---->nil
+ +--^--+ +--^--+
+ | |
+--------+ | head
|Skiplist+--->head
+--------+
INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \
type##_specifier_methods->extra_data_size = \
sizeof (struct type##_specifier); \
- type##_specifier_methods->extra_description = \
+ type##_specifier_methods->extra_description = \
type##_specifier_description; \
} while (0)
# define REGISTER
# endif
-/* In HPUX 10 the strcat function references memory past the last byte of
- the string! This will core dump if the memory following the last byte is
+/* In HPUX 10 the strcat function references memory past the last byte of
+ the string! This will core dump if the memory following the last byte is
not mapped.
Here is a correct version from, glibc 1.09.
/* Synched up with: Not in FSF. */
/* In SunOS 4.1.1 the strcmp and strncmp functions reference memory
- past the last byte of the string! This will core dump if the memory
+ past the last byte of the string! This will core dump if the memory
following the last byte is not mapped.
Here are correct versions by hbs@lucid.com.
/* Synched up with: Not in FSF. */
-/* In SunOS 4.1.1 the strcpy function references memory past the last byte of
- the string! This will core dump if the memory following the last byte is
+/* In SunOS 4.1.1 the strcpy function references memory past the last byte of
+ the string! This will core dump if the memory following the last byte is
not mapped.
Here are correct versions by hbs@lucid.com.
uses, mbstowcs() and wcstombs(), are unusable when programs are
statically linked (as Emacs must be) because the static version of
libc.a contains the *dynamic* versions of these functions. These
- functions don't seem to be called when Emacs is running, so it's
+ functions don't seem to be called when Emacs is running, so it's
enough to define stubs for them.
This appears to be fixed in SunOS 4.1.2.
-/* Utility definitions for C code of SXEmacs
+/* Utility definitions for C code of SXEmacs
Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
Copyright (C) 1993-1996 Richard Mlynarik.
#ifndef PRINTF_ARGS
# if defined (__GNUC__) && (__GNUC__ >= 2)
# define PRINTF_ARGS(string_index,first_to_check) \
- __attribute__ ((format (printf, string_index, first_to_check)))
+ __attribute__ ((format (printf, string_index, first_to_check)))
# else
# define PRINTF_ARGS(string_index,first_to_check)
# endif /* GNUC */
# if ((__GNUC__ > 2) || (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))
# define DOESNT_RETURN void
# define DECLARE_DOESNT_RETURN(decl) \
- extern void decl __attribute__ ((noreturn))
+ extern void decl __attribute__ ((noreturn))
# define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
/* Should be able to state multiple independent __attribute__s, but \
- the losing syntax doesn't work that way, and screws losing cpp */ \
- extern void decl \
- __attribute__ ((noreturn, format (printf, str, idx)))
+ the losing syntax doesn't work that way, and screws losing cpp */ \
+ extern void decl \
+ __attribute__ ((noreturn, format (printf, str, idx)))
# else
# define DOESNT_RETURN void volatile
# define DECLARE_DOESNT_RETURN(decl) extern void volatile decl
# define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
- extern void volatile decl PRINTF_ARGS(str,idx)
+ extern void volatile decl PRINTF_ARGS(str,idx)
# endif /* GNUC 2.5 */
# else
# define DOESNT_RETURN void
# define DECLARE_DOESNT_RETURN(decl) extern void decl
# define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
- extern void decl PRINTF_ARGS(str,idx)
+ extern void decl PRINTF_ARGS(str,idx)
# endif /* GNUC */
#endif
have at least 1/4 probability of changing.
* If mix() is run forward, every bit of c will change between 1/3 and
2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
-mix() was built out of 36 single-cycle latency instructions in a
+mix() was built out of 36 single-cycle latency instructions in a
structure that could supported 2x parallelism, like so:
- a -= b;
+ a -= b;
a -= c; x = (c>>13);
b -= c; a ^= x;
b -= a; x = (a<<8);
c -= a; b ^= x;
c -= b; x = (b>>13);
...
- Unfortunately, superscalar Pentiums and Sparcs can't take advantage
+ Unfortunately, superscalar Pentiums and Sparcs can't take advantage
of that parallelism. They've also turned some of those single-cycle
latency instructions into multi-cycle latency instructions. Still,
this is the fastest good hash I could find. There were about 2^^68
#endif
#if !defined (get16bits)
#define get16bits(d) ((((const uint8_t *)(d))[1] << UINT32_C(8))\
- +((const uint8_t *)(d))[0])
+ +((const uint8_t *)(d))[0])
#endif
hcode_t
/* Handle end cases */
switch (rem) {
- case 3: hash += get16bits (data);
- hash ^= hash << 16;
- hash ^= data[sizeof (uint16_t)] << 18;
- hash += hash >> 11;
- break;
- case 2: hash += get16bits (data);
- hash ^= hash << 11;
- hash += hash >> 17;
- break;
- case 1: hash += *data;
- hash ^= hash << 10;
- hash += hash >> 1;
+ case 3: hash += get16bits (data);
+ hash ^= hash << 16;
+ hash ^= data[sizeof (uint16_t)] << 18;
+ hash += hash >> 11;
+ break;
+ case 2: hash += get16bits (data);
+ hash ^= hash << 11;
+ hash += hash >> 17;
+ break;
+ case 1: hash += *data;
+ hash ^= hash << 10;
+ hash += hash >> 1;
default:
break;
}
DEFUN ("subr-name", Fsubr_name, 1, 1, 0, /*
Return name of function SUBR.
-SUBR must be a built-in function.
+SUBR must be a built-in function.
*/
(subr))
{
- const char *name;
- if (!SUBRP (subr))
- wrong_type_argument (Qsubrp, subr);
- name = XSUBR (subr)->name;
- return make_string ((Bufbyte *)name, strlen (name));
+ const char *name;
+ if (!SUBRP (subr))
+ wrong_type_argument (Qsubrp, subr);
+ name = XSUBR (subr)->name;
+ return make_string ((Bufbyte *)name, strlen (name));
}
CHECK_SYMBOL(symbol);
XSETSTRING(name, XSYMBOL(symbol)->name);
- /* This is a CRUTCH, we need some better mechanism to
- * initialize data like morphisms */
- XSTRING(name)->lheader.morphisms = 0;
+ /* This is a CRUTCH, we need some better mechanism to
+ * initialize data like morphisms */
+ XSTRING(name)->lheader.morphisms = 0;
return name;
}
{
/* This function can GC */
Ffset(symbol, newdef);
- LOADHIST_ATTACH (Fcons (Qdefun, symbol));
+ LOADHIST_ATTACH (Fcons (Qdefun, symbol));
return newdef;
}
static Lisp_Object
search_symbol_macro(Lisp_Object name)
{
- return Fget(name, Qsymbol_macro, Qnil);
+ return Fget(name, Qsymbol_macro, Qnil);
}
/* Return the current value of SYM. The difference between this function
a) We have already found the symbol e.g. by traversing local_var_alist.
or
b) We know that the symbol will not be found in the current buffer's
- list of local variables.
+ list of local variables.
In the former case, find_it_p is 1 and symbol_cons is the element from
local_var_alist. In the latter case, find_it_p is 0 and symbol_cons
is the symbol.
Lisp_Object val = find_symbol_value(symbol);
if (UNBOUNDP(val)) {
- Lisp_Object fd = search_symbol_macro(symbol);
- if (!NILP(fd))
- return Feval(fd);
- else
- return Fsignal(Qvoid_variable, list1(symbol));
- } else
+ Lisp_Object fd = search_symbol_macro(symbol);
+ if (!NILP(fd))
+ return Feval(fd);
+ else
+ return Fsignal(Qvoid_variable, list1(symbol));
+ } else
return val;
}
(symbol, newval))
{
REGISTER Lisp_Object valcontents;
- Lisp_Object ssm;
+ Lisp_Object ssm;
Lisp_Symbol *sym;
/* remember, we're called by Fmakunbound() as well */
reject_constant_symbols(symbol, newval, 0,
UNBOUNDP(newval) ? Qmakunbound : Qset);
- if (UNBOUNDP(valcontents)) {
- ssm = search_symbol_macro(symbol);
- if (!NILP(ssm))
- return Feval(list3(Qsetf, ssm, list2(Qquote, newval)));
- }
+ if (UNBOUNDP(valcontents)) {
+ ssm = search_symbol_macro(symbol);
+ if (!NILP(ssm))
+ return Feval(list3(Qsetf, ssm, list2(Qquote, newval)));
+ }
if (!SYMBOL_VALUE_MAGIC_P(valcontents) || UNBOUNDP(valcontents)) {
sym->value = newval;
RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */
}
-DEFUN("kill-console-local-variable", Fkill_console_local_variable, 1, 1,
+DEFUN("kill-console-local-variable", Fkill_console_local_variable, 1, 1,
"vKill Console Local Variable: ", /*
Make VARIABLE no longer have a separate value in the selected console.
From now on the default value will apply in this console.
ll be a symbol, one of
A simple built-in variable.
- Same, but cannot be set.
+ Same, but cannot be set.
A built-in integer variable.
- Same, but cannot be set.
+ Same, but cannot be set.
A built-in boolean variable.
- Same, but cannot be set.
+ Same, but cannot be set.
Always contains a specifier; e.g. `has-modeline-p'.
A built-in buffer-local variable.
fer' Same, but cannot be set.
Forwards to the default value of a built-in
buffer-local variable.
- A built-in console-local variable.
+ A built-in console-local variable.
nsole' Same, but cannot be set.
Forwards to the default value of a built-in
console-local variable.
DEFUN("variable-binding-locus", Fvariable_binding_locus, 1, 1, 0, /*
Return a value indicating where VARIABLE's current binding comes from.
If the current binding is buffer-local, the value is the current buffer.
-If the current binding is global (the default), the value is nil.
+If the current binding is global (the default), the value is nil.
*/
(variable))
{
size_t i;
if (multiword_predicate_p)
- /* If it is a multiword_predicate_p it is expected
- the last char of name is a p, which should be
- removed and replaced with "_p", so the net length
- difference is 1 char, the '_' */
+ /* If it is a multiword_predicate_p it is expected
+ the last char of name is a p, which should be
+ removed and replaced with "_p", so the net length
+ difference is 1 char, the '_' */
assert(len + 1 < sizeof(temp));
else
assert(len < sizeof(temp));
- temp[0]='\0';
+ temp[0]='\0';
strncat(temp, name + 1, sizeof(temp)-1); /* Remove initial Q */
if (multiword_predicate_p) {
- /* Overwrite the 'p' which is the last char of name
- and put "_p" instead. */
- strcpy(temp + len - 1, "_p");
+ /* Overwrite the 'p' which is the last char of name
+ and put "_p" instead. */
+ strcpy(temp + len - 1, "_p");
len++;
}
for (i = 0; i < len; i++)
DEFSYMBOL(Qselected_console);
DEFSYMBOL(Qconst_selected_console);
DEFSYMBOL(Qsetf);
- DEFSYMBOL(Qsymbol_macro);
+ DEFSYMBOL(Qsymbol_macro);
DEFSUBR(Fintern);
DEFSUBR(Fintern_soft);
DEFSUBR(Fdefine_function);
Ffset(intern("defalias"), intern("define-function"));
DEFSUBR (Fspecial_form_p);
- DEFSUBR (Fsubr_name);
+ DEFSUBR (Fsubr_name);
DEFSUBR(Fsetplist);
DEFSUBR(Fsymbol_value_in_buffer);
DEFSUBR(Fsymbol_value_in_console);
/* The current syntax state */
struct syntax_cache syntax_cache;
-/*
+/*
Update syntax_cache to an appropriate setting for position POS
The sign of COUNT gives the relative position of POS wrt the
ELisp unused |comment bits | unused | syntax code
tag | | | | | | | | |
stuff | | | | | | | | |
- | | | | | | | | |
- | | | | | | | | `--> prefix flag
- | | | | | | | |
- | | | | | | | `--> comment end style B, second char
- | | | | | | `----> comment end style A, second char
- | | | | | `------> comment end style B, first char
- | | | | `--------> comment end style A, first char
- | | | `----------> comment start style B, second char
- | | `------------> comment start style A, second char
- | `--------------> comment start style B, first char
- `----------------> comment start style A, first char
+ | | | | | | | | |
+ | | | | | | | | `--> prefix flag
+ | | | | | | | |
+ | | | | | | | `--> comment end style B, second char
+ | | | | | | `----> comment end style A, second char
+ | | | | | `------> comment end style B, first char
+ | | | | `--------> comment end style A, first char
+ | | | `----------> comment start style B, second char
+ | | `------------> comment start style A, second char
+ | `--------------> comment start style B, first char
+ `----------------> comment start style A, first char
In a 64-bit integer, there would be 32 more unused bits between
the tag and the comment bits.
((startp) ? SYNTAX_FIRST_CHAR_START : \
SYNTAX_FIRST_CHAR_END) & (style)) \
&& (SYNTAX_COMMENT_BITS (b) & \
- ((startp) ? SYNTAX_SECOND_CHAR_START : \
+ ((startp) ? SYNTAX_SECOND_CHAR_START : \
SYNTAX_SECOND_CHAR_END) & (style)))
#define SYNTAX_COMMENT_MASK_START(a, b) \
((STYLE_FOUND_P (a, b, 1, SYNTAX_COMMENT_STYLE_A) \
? SYNTAX_COMMENT_STYLE_A \
: (STYLE_FOUND_P (a, b, 1, SYNTAX_COMMENT_STYLE_B) \
- ? SYNTAX_COMMENT_STYLE_B \
+ ? SYNTAX_COMMENT_STYLE_B \
: 0)))
#define SYNTAX_COMMENT_MASK_END(a, b) \
syntax_cache.object = (OBJECT); \
if (NILP (syntax_cache.object)) \
{ \
- XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \
+ XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \
} \
else if (EQ (syntax_cache.object, Qt)) \
{ \
- XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \
+ XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \
} \
else if (STRINGP (syntax_cache.object)) \
{ \
- /* do nothing */; \
+ /* do nothing */; \
} \
else if (BUFFERP (syntax_cache.object)) \
{ \
- syntax_cache.buffer = XBUFFER (syntax_cache.object); \
+ syntax_cache.buffer = XBUFFER (syntax_cache.object); \
} \
else \
{ \
- /* OBJECT must be buffer/string/t/nil */ \
- assert(0); \
+ /* OBJECT must be buffer/string/t/nil */ \
+ assert(0); \
} \
syntax_cache.current_syntax_table \
= syntax_cache.buffer->mirror_syntax_table; \
& (SYNTAX_CODE_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_END))
#define SYNTAX_CODES_COMMENT_MASK_START(a, b) \
- (SYNTAX_CODES_MATCH_START_P (a, b, SYNTAX_COMMENT_STYLE_A) \
+ (SYNTAX_CODES_MATCH_START_P (a, b, SYNTAX_COMMENT_STYLE_A) \
? SYNTAX_COMMENT_STYLE_A \
: (SYNTAX_CODES_MATCH_START_P (a, b, SYNTAX_COMMENT_STYLE_B) \
? SYNTAX_COMMENT_STYLE_B \
: 0))
#define SYNTAX_CODES_COMMENT_MASK_END(a, b) \
- (SYNTAX_CODES_MATCH_END_P (a, b, SYNTAX_COMMENT_STYLE_A) \
+ (SYNTAX_CODES_MATCH_END_P (a, b, SYNTAX_COMMENT_STYLE_A) \
? SYNTAX_COMMENT_STYLE_A \
: (SYNTAX_CODES_MATCH_END_P (a, b, SYNTAX_COMMENT_STYLE_B) \
? SYNTAX_COMMENT_STYLE_B \
*
*/
-#if defined(ORDINARY_LINK)
+#if defined(ORDINARY_LINK)
extern char **environ;
#endif
static int get_process_times_1(long *user_ticks, long *system_ticks)
{
-#if defined (_SC_CLK_TCK) || defined (CLK_TCK)
+#if defined (_SC_CLK_TCK) || defined (CLK_TCK)
/* We have the POSIX times() function available. */
struct tms tttt;
times(&tttt);
* Copyright (C) 2008 Sebastian Freundt
* Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc.
*
- *
+ *
* This file is part of SXEmacs
- *
+ *
* SXEmacs is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* SXEmacs is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
#include <sys/param.h>
-#if defined (NeXT)
+#if defined (NeXT)
/* what is needed from here? Do others need it too? */
# include <sys/fcntl.h>
#endif /* NeXT */
# include <utime.h>
#endif
-#if defined(HAVE_TZNAME)
+#if defined(HAVE_TZNAME)
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others want it this way. */
#endif
EMACS_TIME_EQUAL (TIME1, TIME2) is true iff TIME1 is the same as TIME2.
EMACS_TIME_GREATER (TIME1, TIME2) is true iff TIME1 is greater than
- TIME2.
+ TIME2.
EMACS_TIME_EQUAL_OR_GREATER (TIME1, TIME2) is true iff TIME1 is
- greater than or equal to TIME2.
+ greater than or equal to TIME2.
*/
((time1).tv_sec == (time2).tv_sec && \
(time1).tv_usec >= (time2).tv_usec))
-#define EMACS_SET_SECS_USECS(time, secs, usecs) \
+#define EMACS_SET_SECS_USECS(time, secs, usecs) \
(EMACS_SET_SECS (time, secs), EMACS_SET_USECS (time, usecs))
#ifdef emacs