GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
X11::Xlib::Struct(3) User Contributed Perl Documentation X11::Xlib::Struct(3)
 

X11::Xlib::Struct - Base class for X11 packed structures

Base class for the various exposed C-structs of Xlib, which are represented as a blessed scalar-ref of the raw bytes of the struct. This makes them more efficient than fully inflating/deflating perl hashrefs for every Xlib call.
All attribute accessors are defined in XS.

This is a 'magic' attribute that can be attached to all structs (except for XEvent where it is a real attribute). Many times a struct will have

  my $struct= X11::Xlib::....->new( %optional_fields );
The constructor sets all fields to their initial value (i.e. zero) and then applies the list of key/value pairs. Warns on un-known field names.

Set all struct fields to a sensible initial value (like zero)

  $struct->pack( \%fields, $consume, $warn );
Pack field values into the bytes of the struct. Only %fields is required.
If $consume is true, then remove any key of %fields that was processed.
If $warn is true, then emit a warning if any un-recognized field was given.

  $struct->apply( \%fields );
  $struct->apply( field => $val, ... );
Alias for " pack(\%fields, 1, 1) ". For each given field, update that member of the struct. Emits a warning if the hash contains unknown fields.

  my $hashref= $struct->unpack();
Extract all fields as Perl data.

Access the scalar holding the bytes of the struct.

Olivier Thauvin, <nanardon@nanardon.zarb.org>
Michael Conrad, <mike@nrdvana.net>

Copyright (C) 2009-2010 by Olivier Thauvin
Copyright (C) 2017 by Michael Conrad
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
2018-06-06 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.