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

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

Serving Software Downloads in 976 Categories, Downloaded 29.541.183 Times

C::DynaLib::Struct 0.55

  Date Added: April 18, 2010  |  Visits: 534

C::DynaLib::Struct

Report Broken Link
Printer Friendly Version


Product Homepage
Download (72 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  -  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  -  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  -  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  -  Boost::Graph 1.4
Boost::Graph is a Perl interface to the Boost-Graph C++ libraries. SYNOPSIS use Boost::Graph; # Create an empty instance of a Graph my $graph = new Boost::Graph(directed=>0, net_name=>Graph Name, net_id=>1000); # add edges...
2.4 MB  
Libraries  -  libhcritsec 0.20
hcritsec is a C++ class for Critical Sections in programs. hcritsec can be used to define a critical section in a program. It can be used in a recursive way. So functions that are nested can call the enter and leave functions recursively (see...
9.22 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  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB