[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 588cfb0f63 130/166: BUILD: Inline sweep.h in sw
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 588cfb0f63 130/166: BUILD: Inline sweep.h in sweep.c |
Date: |
Fri, 30 Sep 2022 04:59:31 -0400 (EDT) |
branch: elpa/sweeprolog
commit 588cfb0f636b1bf873b83aee1cd6de75f5973de4
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
BUILD: Inline sweep.h in sweep.c
---
sweep.c | 32 +++++++++++++++++++-------------
sweep.h | 47 -----------------------------------------------
2 files changed, 19 insertions(+), 60 deletions(-)
diff --git a/sweep.c b/sweep.c
index e55496e15b..847d9817ac 100644
--- a/sweep.c
+++ b/sweep.c
@@ -30,16 +30,30 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sweep.h"
+#include "emacs-module.h"
+#include <SWI-Prolog.h>
+#include <SWI-Stream.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int plugin_is_GPL_compatible;
-term_t o = 0;
+term_t output_term = 0;
emacs_env * current_env = NULL;
+static int value_to_term(emacs_env*, emacs_value, term_t);
+static emacs_value term_to_value(emacs_env*, term_t);
+
+void
+ethrow(emacs_env *env, const char * message) {
+ ptrdiff_t len = strlen(message);
+
+ emacs_value str = env->make_string(env, message, len);
+ emacs_value arg = env->funcall (env, env->intern (env, "list"), 1, &str);
+ env->non_local_exit_signal(env, env->intern(env, "error"), arg);
+}
+
char*
estring_to_cstring(emacs_env *eenv, emacs_value estring, ptrdiff_t *len_p) {
char * buf = NULL;
@@ -93,14 +107,6 @@ ecdr(emacs_env *env, emacs_value cons) {
return env->funcall (env, env->intern (env, "cdr"), 1, &cons);
}
-void
-ethrow(emacs_env *env, const char * message) {
- ptrdiff_t len = strlen(message);
-
- emacs_value str = env->make_string(env, message, len);
- emacs_value arg = env->funcall (env, env->intern (env, "list"), 1, &str);
- env->non_local_exit_signal(env, env->intern(env, "error"), arg);
-}
emacs_value
enil(emacs_env *env) { return env->intern(env, "nil"); }
@@ -373,9 +379,9 @@ sweep_next_solution(emacs_env *env, ptrdiff_t nargs,
emacs_value *args, void *da
case PL_S_FALSE:
return enil(env);
case PL_S_TRUE:
- return econs(env, et(env), term_to_value(env, o));
+ return econs(env, et(env), term_to_value(env, output_term));
case PL_S_LAST:
- return econs(env, env->intern(env, "!"), term_to_value(env, o));
+ return econs(env, env->intern(env, "!"), term_to_value(env, output_term));
default:
return NULL;
}
@@ -429,7 +435,7 @@ sweep_open_query(emacs_env *env, ptrdiff_t nargs,
emacs_value *args, void *data)
PL_open_query(n, PL_Q_NODEBUG | PL_Q_EXT_STATUS | PL_Q_CATCH_EXCEPTION, p,
a);
- o = a+(env->is_not_nil(env, s) ? 0 : 1);
+ output_term = a+(env->is_not_nil(env, s) ? 0 : 1);
r = et(env);
diff --git a/sweep.h b/sweep.h
deleted file mode 100644
index bc0d950774..0000000000
--- a/sweep.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Author: Eshel Yaron
- E-mail: eshel@swi-prolog.org
- Copyright (c) 2022, SWI-Prolog Solutions b.v.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- 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.
-*/
-
-#ifndef _SWEEP_H
-#define _SWEEP_H
-
-#include "emacs-module.h"
-#include <SWI-Prolog.h>
-#include <SWI-Stream.h>
-
-static int value_to_term(emacs_env*, emacs_value, term_t);
-static emacs_value term_to_value(emacs_env*, term_t);
-static char * estring_to_cstring(emacs_env*, emacs_value, ptrdiff_t*);
-static void ethrow(emacs_env*, const char*);
-/* static int estring_to_atom(emacs_env*, emacs_value, term_t); */
-/* static IOSTREAM * estring_to_stream(emacs_env*, emacs_value); */
-
-#endif /*_SWEEP_H*/
- [nongnu] elpa/sweeprolog 8ac0e7afb9 065/166: ENHANCED: also complete predicate names from xref, (continued)
- [nongnu] elpa/sweeprolog 8ac0e7afb9 065/166: ENHANCED: also complete predicate names from xref, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 85ca3a5dc2 067/166: FIXED: bind SourceId in xref based completions, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 21a4475306 112/166: Makefile: Allow specifying the path to emacs, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ec01154a41 102/166: PORT: sweep.el: require Emacs version 28 for RTLD_GLOBAL, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog e991b1a92c 097/166: ENHANCED: (sweep-load-buffer): use read-buffer to choose a buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c69c6bad3c 084/166: FIXED: correctly identify the predicate defined at start of clause, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 586521712e 110/166: DOC: README.org: add ^:{} option, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0b545cc192 114/166: ADDED: (sweep-indent-line-ends-with-prefix-operator): New function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c60df8e7e3 101/166: DOC: Loading buffers: new section, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 4c1e510bbf 125/166: FIXED: handle some more color terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 588cfb0f63 130/166: BUILD: Inline sweep.h in sweep.c,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 12bddb3f75 117/166: ENHANCED: don't record one-character inputs in the top level history, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f82827fdb0 093/166: ENHANCED: Display message if unable to find predicate location, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0f1119fb75 118/166: FIXED: indentation after with inline comments, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f9218dc461 123/166: PORT: use (eql sweep) instead of (eql 'sweep) in cl-defmethods..., ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0db900634f 120/166: DOC: update commentary section in sweep.el, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6f7aa88050 100/166: ENHANCED: (sweep-load-buffer): report results, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 12fbadf13b 137/166: sweep.el: remove outdated sweep--compile-module function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c6066eabb9 144/166: ADDED: support imenu in sweep-mode buffers, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 8179cb4204 135/166: FIXED: qualify calls to sweep_funcall/2, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 7085c2e830 142/166: ADDED: sweep-mode: make sexp-based commands work on Prolog terms, ELPA Syncer, 2022/09/30