Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Class::HPLOO::InlineC 0.23

    Download button

    No screenshots available
    Downloads: 346  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    3 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Graciliano M. P. | More programs
    Perl Artistic License / FREE
    January 3rd, 2008, 16:02 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::HPLOO::InlineC description

    Class::HPLOO::InlineC is a Perl module that adds a pseudo syntax over C to work easier with SV*, AV*, HV* and RV*.

    Class::HPLOO::InlineC is a Perl module that adds a pseudo syntax over C to work easier with SV*, AV*, HV* and RV*.

    Who have worked with XS and perlapi knows that to access values from AV* and HV*, and work with references is not very friendly. To work arounf that I have added a pseudo syntax over the C syntax, that helps to work easily with SV*, AV*, HV* and RV*.

    USAGE

    use Class::HPLOO ;

    class Point {

    sub Point ($x , $y) {
    $this->{x} = $x ;
    $this->{y} = $y ;
    }

    sub move_x( $mv_x ) {
    $this->{x} += $mv_x ;
    }

    sub[C] void move_y( SV* self , int mv_y ) {
    int y = self->{y}->int + mv_y ;
    self->{y} = int2sv(y) ;
    }

    sub[C] SV* get_xy_ref( SV* self ) {
    AV* ret = newAV() ;

    ret->[0] = self->{x} ;
    ret->[1] = self->{y} ;

    return {ret} ;
    }

    }

    my $p = Point->new(10,20) ;

    $p->move_x(100) ;
    $p->move_y(100) ;

    my $xy = $p->get_xy_ref() ; ## returns an ARRAY reference.
    print "XY> @$xyn" ; ## XY> 110 120

    As you can see, is very easy to access and set an integer value from $Point->{y} (at self). Also is simple to create an ARRAY and return a reference to it.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    pseudo syntax | C syntax | Perl module | SV | AV | HV

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM