Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
polish perl
Browse files Browse the repository at this point in the history
  • Loading branch information
GeneralGuy4872 committed Oct 7, 2019
1 parent c0c0df0 commit b43b2ee
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ core.autocrlf=false
*.pod = linguist-language=Pod
# *.cl = linguist-language=Lisp
# *.clp = linguist-language=Lisp
# *.scm = linguist-language=Scheme
*.scm = linguist-language=Scheme
# *.sno = linguist-language=SNOBOL4
# *.bas = linguist-language=BASIC
# *.apl = linguist-language=APL
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Iwannafly
=========
*roguelike game library written in C and Perl with extension interface useing minimal external propagating dependencies*
*roguelike game library written in C, Perl, and Guile, with extension interface useing minimal external propagating dependencies*

Dependencies:

Expand Down Expand Up @@ -71,8 +71,8 @@ Depends:
- C library <CODE>\<perl.h\></CODE>
- C library <CODE>"XSUB.h"</CODE>
- C library <CODE>"INLINE.h"</CODE>
- C library <CODE>\<libguile.h\></CODE>
- Perl feature <CODE>"switch"</CODE>
- Perl module <CODE>Safe</CODE>
- Perl module <CODE>boolean</CODE>
- Perl module <CODE>Exporter</CODE>
- Perl module <CODE>optimize::int</CODE>
Expand Down
3 changes: 2 additions & 1 deletion src/iwannaflycurses.messy
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@
#define PERL_NO_GET_CONTEXT
#include <EXTERN.h>
#include <perl.h>
#include "XSUB.h"

/**guile command executor**/
#include <libguile.h>

/**ncurses libraries**/
#include <ncursesw/ncurses.h>
Expand Down
8 changes: 5 additions & 3 deletions src/modules/IWannaFly/Macro.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package IWannaFly;
package IWannaFly'Macro;

use warnings;
use strict;
Expand All @@ -24,6 +24,8 @@ FILTER_ONLY
code => sub { s/NIL/''/g };
FILTER_ONLY
code => sub { s/¤/\$/g };
FILTER_ONLY
code => sub { s/°/\$/g };
FILTER_ONLY
code => sub { s/¢/\$/g };
FILTER_ONLY
Expand All @@ -43,8 +45,8 @@ FILTER_ONLY
FILTER_ONLY
code => sub { s/ERR/-1/ig };
FILTER_ONLY
code => sub { s/«((?!»).*)»[\t]+:\(([\w]+)\)$/$1;\n\tgoto $2;\n/gm };
code => sub { s/«((?!»).*)»[\t]+:\(([\w]+)\)$/$1;\n\tgoto $2;\n/g };
FILTER_ONLY
code => sub { s/«((?!»).*)»[\t]+:S\(([\w]+)\)F\(([\w]+)\)\n$/if ( $1 ) {\n\tgoto $2;\n} else {\n\tgoto $3;\n}/gm };
code => sub { s/«((?!»).*)»[\t]+:S\(([\w]+)\)F\(([\w]+)\)\n$/if ( $1 ) {\n\tgoto $2;\n} else {\n\tgoto $3;\n}/g };
FILTER_ONLY
code => sub { s/: int;/: optimize(int);/g };
22 changes: 16 additions & 6 deletions src/modules/IWannaFly/Types/Struct/classtyp/XSLIB/classtyp.xs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,20 @@
iwfperl_sync_struct_classtype(input)
HV* input
CODE:
struct classtyp* ptr = hv_fetch(input,"Ptr",3,0);
SV** = hv_fetch(input,"Ptr",3,0);
if (ptr != NULL) {
((struct classtyp*)SvIV(*ptr))->role = hv_fetch(foo,"role",4,0);
((struct classtyp*)SvIV(*ptr))->class = hv_fetch(foo,"class",5,0);
((struct classtyp*)SvIV(*ptr))->align = hv_fetch(foo,"align",5,0);
((struct classtyp*)SvIV(*ptr))->charismatic = hv_fetch(foo,"charismatic",11,0);
((struct classtyp*)SvIV(*ptr))->scorned = hv_fetch(foo,"scorned",7,0);
if (hv_fetch(foo,"role",4,0) != NULL) {
((struct classtyp*)SvIV(*ptr))->role = SvIV(*hv_fetch(foo,"role",4,0));
}
if (hv_fetch(foo,"role",4,0) != NULL) {
((struct classtyp*)SvIV(*ptr))->class = SvIV(*hv_fetch(foo,"class",5,0));
}
if (hv_fetch(foo,"align",5,0) != NULL) {
((struct classtyp*)SvIV(*ptr))->align = SvIV(*hv_fetch(foo,"align",5,0));
}
if (hv_fetch(foo,"charismatic",11,0) != NULL) {
((struct classtyp*)SvIV(*ptr))->charismatic = SvIV(*hv_fetch(foo,"charismatic",11,0));
}
if (hv_fetch(foo,"scorned",7,0) != NULL) {
((struct classtyp*)SvIV(*ptr))->scorned = SvIV(*hv_fetch(foo,"scorned",7,0));
}
4 changes: 2 additions & 2 deletions src/modules/IWannaFly/Types/Struct/classtyp/classtyp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package IWannaFly::Types::Struct::classtyp
use warnings;
use strict;
use Hash::Util;
use IWannaFly::Macro
use IWannaFly::Macro;
use IWannaFly::Types::Struct::classtyp'xs;
sub malloc {
Expand All @@ -27,7 +27,7 @@ sub fetch($°) {
my $self = shift;
my °Ptr = shift;
£struct = IWannaFly::Types::Struct::classtyp'xs::iwfperl_fetch_struct_classtyp(°Ptr);
£struct->{sync} = IWannaFly::Types::classtyp'xs::iwfperl_sync_struct_classtype(£struct->{Ptr});
£struct->{SYNC} = IWannaFly::Types::classtyp'xs::iwfperl_sync_struct_classtype(£struct->{Ptr});
lock_keys(%£struct);
bless £struct, $self;
}
1 change: 1 addition & 0 deletions src/modules/IWannaFly/Types/free.pm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package IWannaFly::Types::free
use warnings;
use strict;
use IWannaFly'Macro;
Expand Down

0 comments on commit b43b2ee

Please sign in to comment.