Permalink
Browse files

Start of perlvariables iteration N+1

New plan: the C <-> perl interface deals entirely with strings. Storage
is entirely perl-side. C does not know and doesn't care about the
underlying perl-side types. Note that this means an "int" variable in C
land and an "int" variable in perl land have no relation.
  • Loading branch information...
1 parent 06e04a9 commit 353719a2ddec4d6a8458ee42af37514fedbd80bf @davidben davidben committed Jun 9, 2012
Showing with 234 additions and 957 deletions.
  1. +8 −3 Makefile.am
  2. +2 −0 commands.c
  3. +0 −396 gmarshal_funcs.c
  4. +0 −89 gmarshal_funcs.h
  5. +1 −13 marshal_types
  6. +19 −26 owl.h
  7. +0 −8 perlconfig.c
  8. +2 −0 perlglue.xs
  9. +0 −4 tester.c
  10. +202 −418 variable.c
View
@@ -38,7 +38,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/ \
$(GIT_FLAGS)
CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
- commands.c global.c text.c fmtext.c gmarshal_funcs.c editwin.c \
+ commands.c global.c text.c fmtext.c editwin.c \
util.c logging.c \
perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
@@ -51,8 +51,8 @@ NORMAL_SRCS = filterproc.c window.c windowcb.c
BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
-GEN_C = varstubs.c perlglue.c
-GEN_H = owl_prototypes.h
+GEN_C = varstubs.c perlglue.c gmarshal_funcs.c
+GEN_H = owl_prototypes.h gmarshal_funcs.h
BUILT_SOURCES = $(GEN_C) $(GEN_H)
@@ -74,6 +74,11 @@ varstubs.c: stubgen.pl variable.c
owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS)
$(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
+gmarshal_funcs.h: marshal_types
+ glib-genmarshal --header $< > $@
+gmarshal_funcs.c: marshal_types
+ glib-genmarshal --body $< > $@
+
# For emacs flymake-mode
check-syntax: proto
$(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
View
@@ -1604,6 +1604,7 @@ char *owl_command_set(int argc, const char *const *argv, const char *buff)
if (v == NULL) {
if (!silent) owl_function_error("Unknown variable '%s'", var);
} else if (requirebool && owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
+ // FIXME: The above won't work when we make perl variables OWL_VARIABLE_SV
if (!silent) owl_function_error("Variable '%s' is not a boolean", var);
} else {
owl_variable_set_fromstring(v, val, !silent);
@@ -1633,6 +1634,7 @@ char *owl_command_unset(int argc, const char *const *argv, const char *buff)
if (v == NULL) {
if (!silent) owl_function_error("Unknown variable '%s'", var);
} else if (owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
+ // FIXME: The above won't work when we make perl variables OWL_VARIABLE_SV
if (!silent) owl_function_error("Variable '%s' is not a boolean", var);
} else {
owl_variable_set_fromstring(v, val, !silent);
Oops, something went wrong. Retry.

0 comments on commit 353719a

Please sign in to comment.