File: README

package info (click to toggle)
libconvert-binary-c-perl 0.79-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 9,100 kB
  • sloc: ansic: 63,694; perl: 18,580; yacc: 2,143; makefile: 31
file content (217 lines) | stat: -rw-r--r-- 6,439 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
CONTENTS

1. DESCRIPTION
2. INSTALLATION
3. UPGRADING
4. DOCUMENTATION
5. MAILING LIST
6. CONFIGURATION
7. COMPATIBILITY
8. FEATURES
9. COPYRIGHT


--------------
1. DESCRIPTION
--------------

Convert::Binary::C is a preprocessor and parser for C type definitions.
It is highly configurable and should support arbitrarily complex data
structures. Its object-oriented interface has pack and unpack methods
that act as replacements for Perl's pack and unpack and allow to use the
C types instead of a string representation of the data structure for
conversion of binary data from and to Perl's complex data structures.

Actually, what Convert::Binary::C does is not very different from what
a C compiler does, just that it doesn't compile the source code into
an object file or executable, but only parses the code and allows Perl
to use the enumerations, structs, unions and typedefs that have been
defined within your C source for binary data conversion, similar to
Perl's pack and unpack.

Beyond that, the module offers a lot of convenience methods to retrieve
information about the C types that have been parsed.

---------------
2. INSTALLATION
---------------

Installation of the Convert::Binary::C module follows the standard
Perl Way and should not be harder than:

  perl Makefile.PL
  make
  make test
  make install

Note that you may need to become superuser to 'make install'.

If you're building the module under Windows, you may need to use a
different make program, such as 'nmake', instead of 'make'.

When running 'make test' on on slower systems please be patient,
since some of the tests are quite time consuming. The time required
for running the whole test suite depends on your Perl version, the
features you're building the module with, and of course your machine.

------------
3. UPGRADING
------------

If you are upgrading from a previous release of Convert::Binary::C,
please check the Changes file. In its current state, the module is
still subject to changes that may affect compatibility with older
releases.

----------------
4. DOCUMENTATION
----------------

To see the documentation, use the perldoc command:

  perldoc Convert::Binary::C
  perldoc Convert::Binary::C::Cached

You can also visit CPAN Search and see the documentation online as
pretty nice HTML. This is also where you will find the most recent
version of this module:

  http://search.cpan.org/~mhx/Convert-Binary-C/

Even though the documentation contains some example code, you might
want some working example scripts. You can find them in the

  examples

subdirectory after you've built the module. These scripts normally
require Convert::Binary::C to be installed on your system. If you
want to test the examples prior to installing Convert::Binary::C,
you can start the examples like this after building the module:

  perl -Mblib examples/script.pl

Otherwise just run the example scripts like any other Perl script.

---------------
5. MAILING LIST
---------------

There's also a mailing list that you can join:

  convert-binary-c@yahoogroups.com

To subscribe, simply send mail to:

  convert-binary-c-subscribe@yahoogroups.com

----------------
6. CONFIGURATION
----------------

Configuring a Convert::Binary::C object correctly can be quite
painful if you don't know every little detail about your compiler.

However, if you're lucky, you can use the 'ccconfig' tool that
comes with this package. It was written to automatically retrieve
the complete compiler configuration. This may not work always,
or retrieve the complete configuration, but it should at least
give you some point to start from.

Just run

  ccconfig -c compiler

with 'compiler' being the name of your compiler executable.

You can see the documentation for 'ccconfig' using the perldoc
command:

  perldoc ccconfig

As the tool is very experimental, any feedback on 'ccconfig'
is really appreciated!

----------------
7. COMPATIBILITY
----------------

The module should build on most of the platforms that Perl runs on.
I have tested it on:

  - Various Linux systems
  - Various BSD systems
  - HP-UX
  - Compaq/HP Tru64 Unix
  - Mac-OS X
  - Cygwin
  - Windows 98/NT/2000/XP

Also, most architectures should be supported. Tests were done on:

  - Various Intel Pentium and Itanium systems
  - Various Alpha systems
  - HP PA-RISC
  - Power-PC
  - StrongARM (the module worked fine on an IPAQ system)

The module should build with any perl from 5.005 up to the latest
development version. It will also build with perl 5.004, but then
the test suite cannot be run completely.

Multithreaded perl binaries are explicitly supported, as the module
is intended to be thread-safe.

-----------
8. FEATURES
-----------

You can enable or disable certain features at compile time by adding
options to the Makefile.PL call. However, you can safely leave them
at their default.

Available features are 'debug' to build the module with debugging
support and 'ieeefp' to explicitly enable or disable IEEE floating
point support.

The 'debug' feature depend on how your perl binary was built. If it
was built with the DEBUGGING flag, the 'debug' feature is enabled,
otherwise it is disabled by default.

The 'ieeefp' feature depends on how your machine stores floating point
values. If they are stored in IEEE format, this feature will be enabled
automatically. You should really only change the default if you know
what you're doing.

You can enable or disable features explicitly by adding the arguments

  enable-feature
  disable-feature

to the Makefile.PL call. To explicitly build the module with debugging
enabled, you would say:

  perl Makefile.PL enable-debug

This will still allow you to pass other 'standard' arguments to
Makefile.PL, like

  perl Makefile.PL enable-debug OPTIMIZE=-O3

------------
9. COPYRIGHT
------------

Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

The ucpp library is (c) 1998-2002 Thomas Pornin. For license
and redistribution details refer to 'ctlib/ucpp/README'.

Portions copyright (c) 1989, 1990 James A. Roskind.

The include files located in 'tests/include/include', which are used in
some of the test scripts are (c) 1991-1999, 2000, 2001 Free Software
Foundation, Inc. They are neither required to create the binary nor
linked to the source code of this module in any other way.