Main > Free Download Search >

Free printf software for linux

printf

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 123
MP4::Info 1.11

MP4::Info 1.11


MP4::Info is a Perl module that can fetch info from MPEG-4 files (.mp4, .m4a, .m4p, .3gp). more>>
MP4::Info is a Perl module that can fetch info from MPEG-4 files (.mp4, .m4a, .m4p, .3gp).

SYNOPSIS

#!perl -w
use MP4::Info;
my $file = Pearls_Before_Swine.m4a;

my $tag = get_mp4tag($file) or die "No TAG info";
printf "$file is a %s trackn", $tag->{GENRE};

my $info = get_mp4info($file);
printf "$file length is %d:%dn", $info->{MM}, $info->{SS};

my $mp4 = new MP4::Info $file;
printf "$file length is %s, title is %sn",
$mp4->time, $mp4->title;

The MP4::Info module can be used to extract tag and meta information from MPEG-4 audio (AAC) and video files. It is designed as a drop-in replacement for MP3::Info.

<<less
Download (0.13MB)
Added: 2006-11-15 License: Perl Artistic License Price:
1120 downloads
passwd_info 0.1

passwd_info 0.1


passwd_info is a simple program that can query the /etc/passwd file for current user or specified user. more>>
passwd_info is a simple program that can query the /etc/passwd file for current user or specified user.

USAGE: passwd_info [username]

Sample:

#include < unistd.h >
#include < stdlib.h >
#include < stdio.h >
#include < sys/types.h >
#include < pwd.h >
#include < string.h >

struct passwd *pw;

void print_usage(void);

int main( int argc, char *argv[] )
{
if ( argc > 2 ) {
print_usage();
exit(1);
}

char *name;
uid_t uid;
gid_t gid;
char *gecos;
char *dir;
char *shell;

char *user_arg;

if ( argv[1] != NULL ) {
user_arg=(char *)malloc(strlen(argv[1]));
strcpy( user_arg, argv[1] );
if ( (pw = getpwnam(user_arg) ) == NULL ) {
fprintf( stderr, "Error: user %s does not existn", user_arg );
exit(1);
}
uid = pw->pw_uid;
free(user_arg);
}
else /* get for current user */
{
uid = getuid();
pw = getpwuid(uid);
}

name = pw->pw_name;
gid = pw->pw_gid;
gecos = pw->pw_gecos;
dir = pw->pw_dir;
shell = pw->pw_shell;

printf( "/etc/passwd file information for %sn", name );
printf( "Username = %stUID = %dtGID = %dn", name, (int)uid, (int)gid );
printf( "GECOS = %snHome = %stShell = %sn", gecos, dir, shell );

exit(0);
}

void print_usage( void )
{
fprintf( stderr, "USAGE: passwd_info [username]n" );
}
<<less
Download (MB)
Added: 2007-03-13 License: GPL (GNU General Public License) Price:
956 downloads
Persistent::mSQL 0.50

Persistent::mSQL 0.50


Persistent::mSQL is a persistent class implemented using a mSQL database. more>>
Persistent::mSQL is a persistent class implemented using a mSQL database.

SYNOPSIS

use Persistent::mSQL;
use English; # import readable variable names like $EVAL_ERROR

eval { ### in case an exception is thrown ###

### allocate a persistent object ###
my $emp = new Persistent::mSQL($data_source, undef, undef, $table);

### define attributes of the object ###
$emp->add_attribute(empno, ID, Number, undef, 4);
$emp->add_attribute(ename, Persistent, VarChar, undef, 10);
$emp->add_attribute(job, Persistent, VarChar, undef, 9);
$emp->add_attribute(mgr, Persistent, Number, undef, 4);
$emp->add_attribute(hiredate, Persistent, DateTime, undef);
$emp->add_attribute(sal, Persistent, Number, undef, 7, 2);
$emp->add_attribute(comm, Persistent, Number, undef, 7, 2);
$emp->add_attribute(deptno, Persistent, Number, undef, 2);

### query the datastore for some objects ###
$emp->restore_where(qq{
sal > 1000 and
job = CLERK and
ename LIKE M%
}, "sal, ename");
while ($emp->restore_next()) {
printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn",
$emp->ename, $emp->empno, $emp->sal, $emp->hiredate;
}
};

if ($EVAL_ERROR) { ### catch those exceptions! ###
print "An error occurred: $EVAL_ERRORn";
}

ABSTRACT

This is a Persistent class that uses a mSQL database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes.

<<less
Download (0.010MB)
Added: 2007-05-22 License: Perl Artistic License Price:
885 downloads
Persistent::Sybase 0.50

Persistent::Sybase 0.50


Persistent::Sybase is a persistent class implemented using a Sybase database. more>>
Persistent::Sybase is a persistent class implemented using a Sybase database.

SYNOPSIS

use Persistent::Sybase;
use English; # import readable variable names like $EVAL_ERROR

eval { ### in case an exception is thrown ###

### allocate a persistent object ###
my $emp = new Persistent::Sybase($data_source, $username, $password, $table);

### define attributes of the object ###
$emp->add_attribute(empno, ID, Number, undef, 4);
$emp->add_attribute(ename, Persistent, VarChar, undef, 10);
$emp->add_attribute(job, Persistent, VarChar, undef, 9);
$emp->add_attribute(mgr, Persistent, Number, undef, 4);
$emp->add_attribute(hiredate, Persistent, DateTime, undef);
$emp->add_attribute(sal, Persistent, Number, undef, 7, 2);
$emp->add_attribute(comm, Persistent, Number, undef, 7, 2);
$emp->add_attribute(deptno, Persistent, Number, undef, 2);

### query the datastore for some objects ###
$emp->restore_where(qq{
sal > 1000 and
job = CLERK and
ename LIKE M%
}, "sal, ename");
while ($emp->restore_next()) {
printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn",
$emp->ename, $emp->empno, $emp->sal, $emp->hiredate;
}
};

if ($EVAL_ERROR) { ### catch those exceptions! ###
print "An error occurred: $EVAL_ERRORn";
}

ABSTRACT

This is a Persistent class that uses a Sybase database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes.

<<less
Download (0.010MB)
Added: 2007-05-22 License: Perl Artistic License Price:
886 downloads
Persistent::Oracle 0.50

Persistent::Oracle 0.50


Persistent::Oracle is a persistent class implemented using an Oracle database. more>>
Persistent::Oracle is a persistent class implemented using an Oracle database.

SYNOPSIS

use Persistent::Oracle;
use English; # import readable variable names like $EVAL_ERROR

eval { ### in case an exception is thrown ###

### allocate a persistent object ###
my $emp = new Persistent::Oracle(dbi:Oracle:ORCL,
scott, tiger, emp);

### define attributes of the object ###
$emp->add_attribute(empno, ID, Number, undef, 4);
$emp->add_attribute(ename, Persistent, VarChar, undef, 10);
$emp->add_attribute(job, Persistent, VarChar, undef, 9);
$emp->add_attribute(mgr, Persistent, Number, undef, 4);
$emp->add_attribute(hiredate, Persistent, DateTime, undef);
$emp->add_attribute(sal, Persistent, Number, undef, 7, 2);
$emp->add_attribute(comm, Persistent, Number, undef, 7, 2);
$emp->add_attribute(deptno, Persistent, Number, undef, 2);

### query the datastore for some objects ###
$emp->restore_where(qq{
sal > 1000 and
job = CLERK and
ename LIKE M%
}, "sal, ename");
while ($emp->restore_next()) {
printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn",
$emp->ename, $emp->empno, $emp->sal, $emp->hiredate;
}
};

if ($EVAL_ERROR) { ### catch those exceptions! ###
print "An error occurred: $EVAL_ERRORn";
}

ABSTRACT

This is a Persistent class that uses an Oracle database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes.

<<less
Download (0.011MB)
Added: 2007-05-19 License: Perl Artistic License Price:
889 downloads
SimpleIni 4.3

SimpleIni 4.3


SimpleIni is a cross-platform library that provides a simple API to read and write INI-style configuration files. more>>
SimpleIni is a cross-platform library that provides a simple API to read and write INI-style configuration files. It supports data files in ASCII, MBCS and Unicode.
It is designed explicitly to be portable to any platform and has been tested on Windows and Linux. Released as open-source and free using the MIT licence.
Examples:
These snippets are included with the distribution in the file snippets.cpp.
LOADING DATA
load from a data file
CSimpleIniA ini(a_bIsUtf8, a_bUseMultiKey, a_bUseMultiLine);
SI_Error rc = ini.LoadFile(a_pszFile);
if (rc < 0) return false;
load from a string
std::string strData;
rc = ini.Load(strData.c_str(), strData.size());
if (rc < 0) return false;
GETTING SECTIONS AND KEYS
get all sections
CSimpleIniA::TNamesDepend sections;
ini.GetAllSections(sections);
get all keys in a section
CSimpleIniA::TNamesDepend keys;
ini.GetAllKeys("section-name", keys);
GETTING VALUES
get the value of a key
const char * pszValue = ini.GetValue("section-name",
"key-name", NULL /*default*/);
get the value of a key which may have multiple values. If bHasMultipleValues is true, then just one value has been returned
bool bHasMultipleValues;
pszValue = ini.GetValue("section-name", "key-name",
NULL /*default*/, &bHasMultipleValues);
get all values of a key with multiple values
CSimpleIniA::TNamesDepend values;
ini.GetAllValues("section-name", "key-name", values);
sort the values into the original load order
values.sort(CSimpleIniA::Entry::LoadOrder());
output all of the items
CSimpleIniA::TNamesDepend::const_iterator i;
for (i = values.begin(); i != values.end(); ++i) {
printf("key-name = %sn", i->pItem);
}
MODIFYING DATA
adding a new section
rc = ini.SetValue("new-section", NULL, NULL);
if (rc < 0) return false;
printf("section: %sn", rc == SI_INSERTED ?
"inserted" : "updated");
adding a new key ("new-section" will be added automatically if it doesnt already exist)
rc = ini.SetValue("new-section", "new-key", "value");
if (rc < 0) return false;
printf("key: %sn", rc == SI_INSERTED ?
"inserted" : "updated");
changing the value of a key
rc = ini.SetValue("section", "key", "updated-value");
if (rc < 0) return false;
printf("key: %sn", rc == SI_INSERTED ?
"inserted" : "updated");
DELETING DATA
deleting a key from a section. Optionally the entire section may be deleted if it is now empty.
ini.Delete("section-name", "key-name",
true /*delete the section if empty*/);
deleting an entire section and all keys in it
ini.Delete("section-name", NULL);
SAVING DATA
save the data to a string
rc = ini.Save(strData);
if (rc < 0) return false;
save the data back to the file
rc = ini.SaveFile(a_pszFile);
if (rc < 0) return false;
Enhancements:
- Fixed a bug causing multi-line values and comments to get corrupted. This affects only files with CR LF line endings (Windows) and wchar_t/ICU interface (Unicode).
<<less
Download (0.041MB)
Added: 2007-07-05 License: MIT/X Consortium License Price:
843 downloads
genproto 0.4.1

genproto 0.4.1


genproto a tool that generates prototypes from C/C++ code. more>>
genproto generates prototypes from C/C++ code. It does not touch the original files, and the output format can be changed via printf-style format strings.

Unlike cproto it does not rely on external programms, such as gcc or cpp.

Example

me@home:~/src/genproto-0.2> ./genproto main.c
/* generated by genproto */

void Usage(char *name);
char * CharCopy(char *buf, int len);
char * AddTokens(char **TokenList, int FirstToken, int LastToken);
void AddPrototype(char **TokenList, int ClassNamePos, int FunctionNamePos, int ParamPos);
void ScanOneFile(void);
void SortPrototypes(struct function **T, int Gauche, int Droite);
void Swap(struct function **T, int i, int j);
int CompareFunctions(struct function *pF1, struct function *pF2);
void CopyListToTable(void);
void PrintOnePrototype(struct function *pF);
void PrintPrototypes(void);
void DeletePrototypes(void);
void MyExit(void);
void * MyAlloc(size_t size);
int main(int argc, char **argv);
<<less
Download (0.027MB)
Added: 2005-04-22 License: Freely Distributable Price:
1645 downloads
MP3::Find 0.06

MP3::Find 0.06


MP3::Find is a Perl module to search and sort MP3 files based on their ID3 tags. more>>
MP3::Find is a Perl module to search and sort MP3 files based on their ID3 tags.

SYNOPSIS

# select with backend you want
use MP3::Find qw(Filesystem);

print "$_n" foreach find_mp3s(
dir => /home/peter/cds,
query => {
artist => ilyaimy,
title => deep in the am,
},
ignore_case => 1,
exact_match => 1,
sort => [qw(year album tracknum)],
printf => %2n. %a - %t (%b: %y),
);

This module allows you to search for MP3 files by their ID3 tags. You can ask for the results to be sorted by one or more of those tags, and return either the list of filenames (the deault), a printf-style formatted string for each file using its ID3 tags, or the actual Perl data structure representing the results.

There are currently two backends to this module: MP3::Find::Filesystem and MP3::Find::DB. You choose which one you want by passing its name as the argument to you use statement; MP3::Find will look for a MP3::Find::$BACKEND module. If no backend name is given, it will default to using MP3::Find::Filesystem.
Note: Im still working out some kinks in the DB backend, so it is currently not as stable as the Filesystem backend.

Note the second: This whole project is still in the alpha stage, so I can make no guarentees that there wont be significant interface changes in the next few versions or so. Also, comments about what about the API rocks (or sucks!) are appreciated.

<<less
Download (0.029MB)
Added: 2006-11-07 License: Perl Artistic License Price:
1081 downloads
Algorithm::Diff 1.1902

Algorithm::Diff 1.1902


Algorithm::Diff is a Perl module to compute `intelligent differences between two files / lists. more>>
Algorithm::Diff is a Perl module to compute `intelligent differences between two files / lists.

SYNOPSIS

require Algorithm::Diff;

# This example produces traditional diff output:

my $diff = Algorithm::Diff->new( @seq1, @seq2 );

$diff->Base( 1 ); # Return line numbers, not indices
while( $diff->Next() ) {
next if $diff->Same();
my $sep = ;
if( ! $diff->Items(2) ) {
printf "%d,%dd%dn",
$diff->Get(qw( Min1 Max1 Max2 ));
} elsif( ! $diff->Items(1) ) {
printf "%da%d,%dn",
$diff->Get(qw( Max1 Min2 Max2 ));
} else {
$sep = "---n";
printf "%d,%dc%d,%dn",
$diff->Get(qw( Min1 Max1 Min2 Max2 ));
}
print "< $_" for $diff->Items(1);
print $sep;
print "> $_" for $diff->Items(2);
}


# Alternate interfaces:

use Algorithm::Diff qw(
LCS LCS_length LCSidx
diff sdiff compact_diff
traverse_sequences traverse_balanced );

@lcs = LCS( @seq1, @seq2 );
$lcsref = LCS( @seq1, @seq2 );
$count = LCS_length( @seq1, @seq2 );

( $seq1idxref, $seq2idxref ) = LCSidx( @seq1, @seq2 );


# Complicated interfaces:

@diffs = diff( @seq1, @seq2 );

@sdiffs = sdiff( @seq1, @seq2 );

@cdiffs = compact_diff( @seq1, @seq2 );

traverse_sequences(
@seq1,
@seq2,
{ MATCH => &callback1,
DISCARD_A => &callback2,
DISCARD_B => &callback3,
},
&key_generator,
@extra_args,
);

traverse_balanced(
@seq1,
@seq2,
{ MATCH => &callback1,
DISCARD_A => &callback2,
DISCARD_B => &callback3,
CHANGE => &callback4,
},
&key_generator,
@extra_args,
);

<<less
Download (0.033MB)
Added: 2007-06-28 License: Perl Artistic License Price:
848 downloads
HTTP::MobileAgent::Vodafone 0.26

HTTP::MobileAgent::Vodafone 0.26


HTTP::MobileAgent::Vodafone is a Perl module with a Vodafone implementation. more>>
HTTP::MobileAgent::Vodafone is a Perl module with a Vodafone implementation.

SYNOPSIS

use HTTP::MobileAgent;

local $ENV{HTTP_USER_AGENT} = "J-PHONE/2.0/J-DN02";
my $agent = HTTP::MobileAgent->new;

printf "Name: %sn", $agent->name; # "J-PHONE"
printf "Version: %sn", $agent->version; # 2.0
printf "Model: %sn", $agent->model; # "J-DN02"
print "Packet is compliant.n" if $agent->packet_compliant; # false

# only availabe in Java compliant
# e.g.) "J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0"
printf "Serial: %sn", $agent->serial_number; # XXXXXXXXXX
printf "Vendor: %sn", $agent->vendor; # SH
printf "Vender Version: %sn", $agent->vendor_version; # "0001a"

my $info = $self->java_info; # hash reference
print map { "$_: $info->{$_}n" } keys %$info;

<<less
Download (0.023MB)
Added: 2007-06-09 License: Perl Artistic License Price:
877 downloads
Libsf 0.1

Libsf 0.1


Libsf is a stack fingerprinting library. more>>
Libsf is a stack fingerprinting library.

Libsf allows the following:

libsf_t *s;

s = libsf_init(LIBSF_ACTIVE, device, argv[optind], 0, 1, flags, errbuf);
libsf_active_id(s);

/* get the total number of matches */
tm = libsf_os_get_tm(s);

/* get the high score */
hs = libsf_os_get_hs(s);

printf("%d potential matches (highest score of %d)n", tm, hs);
printf("Highest scored OS guesses:n");

/* run through the OS list, dumping string that matches score */
while ((guess = libsf_os_get_match(s, hs)))
{
printf("%sn", guess);
}

libsf_destroy(s);

Installation:

0. nroff -man man/sf.3 | less
1. Youll need to build and install:
a. libnet 1.1.0 (http://www.packetfactory.net/libnet)
b. libpcap 0.6.x+ (http://www.tcpdump.org)
c. libdb old API - should be included with most modern OS releases - (http://www.sleepycat.com/)
2. ./configure && make && make install
3. cd import ; ./db_import -a fp-file
4. cp libsf.db /usr/local/share/libsf
<<less
Download (0.14MB)
Added: 2006-03-10 License: GPL (GNU General Public License) Price:
755 downloads
PScan 1.0

PScan 1.0


PScan scans C source files for problematic uses of printf style functions more>>
PScan scans C source files for problematic uses of printf style functions, such as "sprintf(buffer, variable);" instead of "sprintf(buffer, "", variable);". These sort of problems have been the source of many security holes. PSCan looks for them, and nothing else. It does not make your program safe, but it can help to make it safer.

See the Format bugs post to BUGTRAQ for a good explanation of the security problems associated with sprintf(buffer, variable);. These security issues also currently involve being able to bypass stack protection mechanisms like StackGuard. I have submitted a paper to BUGTRAQ describing the issue.

All of these security problems can also occur with any printf-style function. It is simple to fall into the trap of misusing printf and friends, thus, the need for PScan.

What PScan cant do:

Scan for traditional buffer over-flows.
You should use a bounds-checking compiler for that.

Scan for any other mis-use of function parameters.

The functionality given by PScan is limited. Yet it may be useful. Im not going to claim its the be-all and end-all of security scanners, but it does one thing, and it does it simply, and reasonable well.

Analyzing and correcting the security breaches is up to the programmer.
<<less
Download (0.010MB)
Added: 2006-07-13 License: GPL (GNU General Public License) Price:
761 downloads
SNMP::NPAdmin 1.0

SNMP::NPAdmin 1.0


SNMP::NPAdmin is a high-level API to query printers via SNMP. more>>
SNMP::NPAdmin is a high-level API to query printers via SNMP.

SYNOPSIS

# object-oriented
$p= SNMP::NPAdmin->new(
printer => porky,
community => corpslp
);
printf "Your printer, %s, does%s support PCL.n",
$printer, ( $p->pcl() ? "" : " not");

# procedural
$p= npa_connect(
printer => porky,
community => corpslp
);
printf "Your printer, %s, does%s support PCL.n",
$printer, ( npa_pcl( $p) ? "" : " not");

The SNMP::NPAdmin package is a complete port of a SNMP/printer utility called npadmin that provides a high-level interface to query printers via SNMP without specific knowledge of SNMP MIBs or the printers vendor-specific configuration.

The original npadmin was written in C++ by Ben Woodard who continues to maintain it on SourceForge.

The primary objective in this port is to have a maintainable and extensible version of the same functionality that the original npadmin provides.
It is not optimized for performance at all; it is optimized for extensibility and maintainability. The original npadmin is very much extremely performance, the idea being to query many printers very quickly, especially since SNMP can be quite slow.

To be fair, SNMP::NPAdmin might even be slow by Perl standards due to the extensive use of run-time compilation through the AUTOLOAD subroutine. I dont necessarily believe this since a programmer/sys-admin frequently will not use all of the available methods/subroutines which would typically be compiled during startup; given that only a few methods/subroutines will be called, then only a few will be compiled during the processs lifetime. Probably the difference in speed due to this will be insignificant either way.

The design was chosen in order to get as much information into a maintainable table format and make the logic as generic as possible; not for speed.

So this is your choice. If you have some unsupported printers and you want to be able to modify the code to support them then use SNMP::NPAdmin. If you need to support a lot of printers continuously with this kind of utility then you should use Ben Woodards npadmin.

<<less
Download (0.062MB)
Added: 2007-04-19 License: Perl Artistic License Price:
919 downloads
Cspot 0.0.5

Cspot 0.0.5


Cspot is a semantic annotator designed only for the C programming language. more>>
Cspot is a semantic annotator designed only for the C programming language. It is quite similar to cscope, but some more functionality.

Cspot project can be used to find the declarations, definitions, and usages of functions, variables, macros, typedefs, and structs.

It can also find visible identifiers at some position in the source, functions called by a function, global variables used by a function, usages of local variable declarations, unused global variables, unused function definitions, and more. Because it uses sparse, cspot knows more about semantics than cscope.

cspot usage ( cspot -h )
cspot -db spot.db -regexp reg ;; prints all identifiers of project matching reg (extended regexp)
cspot -db spot.db -fc printf ;; prints all declarations of function printf
cspot -db spot.db -fu printf ;; prints all usages of function printf
cspot -db spot.db -vu stdout ;; prints all usages of variable stdout
cspot -db spot.db -sc my_sruct ;; prints places of forward declaration of struct my_struct
cspot -db spot.db -sf my_sruct ;; prints places of definition of struct my_struct
cspot -db spot.db -su my_sruct ;; prints places of usage of struct my_struct
cspot -db spot.db -si my_sruct ;; prints places of definition and variables in struct my_struct
etc.

cspot -va source.c 254 21 ;; prints all visible identifiers at source.c line 254 pos 21
cspot -vla source.c 254 21 ;; prints all visible identifiers (declared in file source.c) at source.c line 254 pos 21

commands for visible functions, macros, variable, called functions by function, global variables used by function ...

cspot -db spot.db -fu printf
printfs all usages of function printf in project (usage = call, assigning to variable)

printf at `base/cmd/commands.h 249:7
printf at `base/cmd/commands.h 327:8
printf at `base/cmd/commands.h 337:8
printf at `base/cmd.c 313:3
printf at `base/cmd.c 318:7
printf at `base/cmd.c 319:36
printf at `base/cmd.c 321:36
printf at `base/cmd.c 322:36
printf at `base/cmd.c 323:36
<<less
Download (0.26MB)
Added: 2006-09-04 License: GPL (GNU General Public License) Price:
1145 downloads
Inline::Struct 0.06

Inline::Struct 0.06


Inline::Struct is a Perl module that manipulate C structures directly from Perl. more>>
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__

struct Foo {
int num;
char *str;
};

void myfunc(Foo *f) {
printf("myfunc: num=%i, str=%sn", f->num, f->str);
}
This complete program prints:
myfunc: num=10, str=Hello

Inline::Struct is not a new language. Its a language extension designed to be used by Inline::C. It parses struct definitions and creates typemaps and XS code which bind each struct into a Perl class. This code is passed to Inline::C, which compiles it in the normal way.

NOTE: Inline::Struct parses only C-style structs. It doesnt know about any C++ extensions to structs like scopes, constructors or methods. If you want such functionality you should use Inline::CPP to parse your structs.

<<less
Download (0.008MB)
Added: 2006-07-06 License: Perl Artistic License Price:
1205 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5