Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.174.467 Times

C::DynaLib::Struct 0.55

  Date Added: April 18, 2010  |  Visits: 764

C::DynaLib::Struct

Report Broken Link
Printer Friendly Version


Product Homepage
Download (98 downloads)



C::DynaLib::Struct is a tool for handling the C `struct data type. SYNOPSIS use C::DynaLib::Struct; Define C::DynaLib::Struct( $struct_tag, $template0, @field_names0, [$template1, @field_names1,] ... ); $rstruct = tie( $struct, $struct_tag [, @initializer_list] ); $value = $rstruct->my_field(); $rstruct->my_field( $new_value ); $pointer_to_struct = pack( p, $struct ); $struct = $new_struct; # assigns all fields at once # after passing pointer-to-struct to a C function: $rstruct->Unpack(); $returned_value = $rstruct->my_field(); When mixing Perl and C, the conversion of data types can be rather tedious and error-prone. This module provides an abstraction from Perls pack and unpack operators for using structures whose member data types and positions do not change. Here are some examples of C code that deals with a struct. On the right are some possible Perl equivalents. C Perl - ---- typedef struct { use C::DynaLib::Struct; int m_int; Define C::DynaLib::Struct( double m_double; Foo, char * m_string; i => [m_int], } Foo; d => [m_double], p => [m_string] ); # or, equivalently, Define C::DynaLib::Struct(Foo, idp, [qw(m_int m_double m_string)]); Foo foo; Foo *pfoo = &foo; $rfoo = tie ($foo, Foo); i = pfoo->m_int; $i = $rfoo->m_int; d = foo.m_double; $d = (tied $foo)->m_double; pfoo->m_string = "hi"; $rfoo->m_string("hi"); Foo bar; tie ($bar, Foo); bar = foo; $bar = $foo; void do_foo(Foo *arg); use C::DynaLib; $lib = new C::DynaLib("-lfoo"); $do_foo = $lib->DeclareSub("do_foo","","P"); # or you could write an XSUB. do_foo(&foo); &$do_foo($foo); returned_i = foo.m_int; $rfoo->Unpack(); $returned_i = $rfoo->m_int;.

Requirements: No special requirements
Platforms: Linux
Keyword: Cdynalibstruct Define C Double Dynalib Foo Int Libraries Programming Struct
Users rating: 0/10

License: Freeware Size: 35.84 KB
USER REVIEWS
More Reviews or Write Review


C::DYNALIB::STRUCT RELATED
Libraries  -  Inline::Struct 0.06
Inline::Struct is a Perl module that manipulate C structures directly from Perl. SYNOPSIS use Inline C => Config => Structs => [Foo]; my $obj = Inline::Struct::Foo->new; $obj->num(10); $obj->str("Hello"); myfunc($obj); __END__ __C__...
8.19 KB  
Libraries  -  Catalyst 5.7007
Catalyst is a Perl module that contains the elegant MVC web application framework. SYNOPSIS See the Catalyst::Manual distribution for comprehensive documentation and tutorials. # Install Catalyst::Devel for helpers and other development...
143.36 KB  
Libraries  -  Easy Game Library 20040323
Easy Game Library is library of C++ classes designed to make game programming easier. Now it consists only of easy_sprite library which consists of classes for using sprites. It should compile on different platforms because it uses SDL library...
58.37 KB  
Libraries  -  C::DynaLib 0.55
C::DynaLib is a Perl interface to C compiled code. SYNOPSIS use C::DynaLib; use sigtrap; # recommended $lib = new C::DynaLib( $linker_arg ); $func = $lib->DeclareSub( $symbol_name [, $return_type [, @arg_types] ] ); # or $func =...
35.84 KB  
Libraries  -  Inline::C 0.44
Inline::C is a Perl module that can Write Perl Subroutines in C. Inline::C is a module that allows you to write Perl subroutines in C. Since version 0.30 the Inline module supports multiple programming languages and each language has its own...
92.16 KB  
Libraries  -  Aapl C++ Template Library 2.14
Aapl is a C++ template library for generic programming. Aapl supports different generic programming paradigms by providing variations of standard data structures. For example, a by-value linked list template may be used to store a user supplied...
122.88 KB  
Libraries  -  Instant 0.9
Instant is a Python module that allows for instant inlining of C and C++ code in Python. Instant is a small Python module built on top of SWIG. Example of use: >>> c_code = """ double sum(double a, double b){ return a+b; } """ >>> import...
34.82 KB  
Libraries  -  C++ xml 1.0.0
C++ xml is a C++ library that provides an API for XML document handling. Similar to the JDOM Java interface, a XML document can be parsed, traced and generated by the provided methods. Furthermore, this library is a good example for the usage of...
194.56 KB  
Libraries  -  The C++ Cmdline Library 0.3
The C++ Cmdline Library provides a framework for handling command line options and arguments. Either variables (of any type) are set to values given at the command line. Or user defined functions are called with arguments (of any type) read from...
849.92 KB  
Libraries  -  c-ares 1.4.0
c-ares project is a C library that resolves names asynchronously. Whats New in This Release: - ares_save_options, ares_destroy_options, ares_process_fd, and ares_parse_ns_reply were added. - The transaction IDs were made "secure". - A few...
430.08 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB