gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, easter-eggs/detect-local, updated. gawk-


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, easter-eggs/detect-local, updated. gawk-4.1.0-2440-g6985181
Date: Thu, 23 Feb 2017 13:50:54 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, easter-eggs/detect-local has been updated
       via  6985181ce58fa980f3007e866aa3a30b4c54048c (commit)
      from  9ed206b61dc20af209ceca5b26c536bdb7b2edad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6985181ce58fa980f3007e866aa3a30b4c54048c

commit 6985181ce58fa980f3007e866aa3a30b4c54048c
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Feb 23 20:50:30 2017 +0200

    Add extension/islocal.c (oops); small fix in gawkapi.h.

diff --git a/extension/islocal.c b/extension/islocal.c
new file mode 100644
index 0000000..da05ce2
--- /dev/null
+++ b/extension/islocal.c
@@ -0,0 +1,77 @@
+/*
+ * islocal.c - Return true if a parameter came from a local variable.
+ */
+
+/*
+ * Copyright (C) 2017 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK 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.
+ *
+ * GAWK 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid)  gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api;  /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "islocal extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
+
+int plugin_is_GPL_compatible;
+
+/*  do_islocal --- check if a variable is local or not */
+
+static awk_value_t *
+do_islocal(int nargs, awk_value_t *result, struct awk_ext_func *unused)
+{
+       awk_value_t param;
+       int ret = -1;
+
+       assert(result != NULL);
+
+       if (get_argument(0, AWK_UNDEFINED, &param)) {
+               ret = param.is_local;
+       }
+
+       /* Set the return value */
+       return make_number(ret, result);
+}
+
+static awk_ext_func_t func_table[] = {
+       { "islocal", do_islocal, 1, 1, awk_false, NULL },
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, islocal, "")
diff --git a/gawkapi.h b/gawkapi.h
index 9ef5688..2c304ef 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -326,7 +326,7 @@ typedef struct awk_value {
                awk_scalar_t    scl;
                awk_value_cookie_t vc;
        } u;
-       int is_local;   /* true if parameter was a truly local variable */
+       awk_bool_t is_local;    /* true if parameter was a truly local variable 
*/
 #define str_value      u.s
 #define strnum_value   str_value
 #define regex_value    str_value

-----------------------------------------------------------------------

Summary of changes:
 extension/{ordchr.c => islocal.c} | 60 +++++++++------------------------------
 gawkapi.h                         |  2 +-
 2 files changed, 14 insertions(+), 48 deletions(-)
 copy extension/{ordchr.c => islocal.c} (52%)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]