PERL5004DELTA
Section: Perl Programmers Reference Guide (1)Updated: 2009-02-12
Index Return to Main Contents
NAME
perl5004delta - what's new for perl5.004DESCRIPTION
This document describes differences between the 5.003 release (as documented in Programming Perl, second edition---the Camel Book) and this one.Supported Environments
Perl5.004 builds out of the box on Unix, Plan 9, LynxOS, VMS, OS/2, QNX, AmigaOS, and Windows NT. Perl runs on Windows 95 as well, but it cannot be built there, for lack of a reasonable command interpreter.Core Changes
Most importantly, many bugs were fixed, including several security problems. See the Changes file in the distribution for details.List assignment to %ENV works
"%ENV = ()" and "%ENV = @list" now work as expected (except on VMS where it generates a fatal error).Change to Can't locate Foo.pm in @INC error
The error ``Can't locate Foo.pm in @INC'' now lists the contents of @INC for easier debugging.Compilation option: Binary compatibility with 5.003
There is a new Configure question that asks if you want to maintain binary compatibility with Perl 5.003. If you choose binary compatibility, you do not have to recompile your extensions, but you might have symbol conflicts if you embed Perl in another application, just as in the 5.003 release. By default, binary compatibility is preserved at the expense of symbol table pollution.$PERL5OPT environment variable
You may now put Perl options in the $PERL5OPT environment variable. Unless Perl is running with taint checks, it will interpret this variable as if its contents had appeared on a ``#!perl'' line at the beginning of your script, except that hyphens are optional. PERL5OPT may only be used to set the following switches: -[DIMUdmw].Limitations on -M, -m, and -T options
The "-M" and "-m" options are no longer allowed on the "#!" line of a script. If a script needs a module, it should invoke it with the "use" pragma.The -T option is also forbidden on the "#!" line of a script, unless it was present on the Perl command line. Due to the way "#!" works, this usually means that -T must be in the first argument. Thus:
#!/usr/bin/perl -T -w
will probably work for an executable script invoked as "scriptname", while:
#!/usr/bin/perl -w -T
will probably fail under the same conditions. (Non-Unix systems will probably not follow this rule.) But "perl scriptname" is guaranteed to fail, since then there is no chance of -T being found on the command line before it is found on the "#!" line.
More precise warnings
If you removed the -w option from your Perl 5.003 scripts because it made Perl too verbose, we recommend that you try putting it back when you upgrade to Perl 5.004. Each new perl version tends to remove some undesirable warnings, while adding new warnings that may catch bugs in your scripts.Deprecated: Inherited AUTOLOAD for non-methods
Before Perl 5.004, "AUTOLOAD" functions were looked up as methods (using the @ISA hierarchy), even when the function to be autoloaded was called as a plain function (e.g. "Foo::bar()"), not a method (e.g. "Foo->bar()" or "$obj->bar()").Perl 5.005 will use method lookup only for methods' "AUTOLOAD"s. However, there is a significant base of existing code that may be using the old behavior. So, as an interim step, Perl 5.004 issues an optional warning when a non-method uses an inherited "AUTOLOAD".
The simple rule is: Inheritance will not work when autoloading non-methods. The simple fix for old code is: In any module that used to depend on inheriting "AUTOLOAD" for non-methods from a base class named "BaseClass", execute "*AUTOLOAD = \&BaseClass::AUTOLOAD" during startup.
Previously deprecated %OVERLOAD is no longer usable
Using %OVERLOAD to define overloading was deprecated in 5.003. Overloading is now defined using the overload pragma. %OVERLOAD is still used internally but should not be used by Perl scripts. See overload for more details.Subroutine arguments created only when they're modified
In Perl 5.004, nonexistent array and hash elements used as subroutine parameters are brought into existence only if they are actually assigned to (via @_).Earlier versions of Perl vary in their handling of such arguments. Perl versions 5.002 and 5.003 always brought them into existence. Perl versions 5.000 and 5.001 brought them into existence only if they were not the first argument (which was almost certainly a bug). Earlier versions of Perl never brought them into existence.
For example, given this code:
undef @a; undef %a; sub show { print $_[0] }; sub change { $_[0]++ }; show($a[2]); change($a{b});
After this code executes in Perl 5.004, $a{b} exists but $a[2] does not. In Perl 5.002 and 5.003, both $a{b} and $a[2] would have existed (but $a[2]'s value would have been undefined).
Group vector changeable with $)
The $) special variable has always (well, in Perl 5, at least) reflected not only the current effective group, but also the group list as returned by the "getgroups()" C function (if there is one). However, until this release, there has not been a way to call the "setgroups()" C function from Perl.In Perl 5.004, assigning to $) is exactly symmetrical with examining it: The first number in its string value is used as the effective gid; if there are any numbers after the first one, they are passed to the "setgroups()" C function (if there is one).
Fixed parsing of $$<digit>, &$<digit>, etc.
Perl versions before 5.004 misinterpreted any type marker followed by ``$'' and a digit. For example, ``$$0'' was incorrectly taken to mean ``${$}0'' instead of ``${$0}''. This bug is (mostly) fixed in Perl 5.004.However, the developers of Perl 5.004 could not fix this bug completely, because at least two widely-used modules depend on the old meaning of ``$$0'' in a string. So Perl 5.004 still interprets ``$$<digit>'' in the old (broken) way inside strings; but it generates this message as a warning. And in Perl 5.005, this special treatment will cease.
Fixed localization of $<digit>, $&, etc.
Perl versions before 5.004 did not always properly localize the regex-related special variables. Perl 5.004 does localize them, as the documentation has always said it should. This may result in $1, $2, etc. no longer being set where existing programs use them.No resetting of $. on implicit close
The documentation for Perl 5.0 has always stated that $. is not reset when an already-open file handle is reopened with no intervening call to "close". Due to a bug, perl versions 5.000 through 5.003 did reset $. under that circumstance; Perl 5.004 does not.wantarray may return undef
The "wantarray" operator returns true if a subroutine is expected to return a list, and false otherwise. In Perl 5.004, "wantarray" can also return the undefined value if a subroutine's return value will not be used at all, which allows subroutines to avoid a time-consuming calculation of a return value if it isn't going to be used.eval EXPR determines value of EXPR in scalar context
Perl (version 5) used to determine the value of EXPR inconsistently, sometimes incorrectly using the surrounding context for the determination. Now, the value of EXPR (before being parsed by eval) is always determined in a scalar context. Once parsed, it is executed as before, by providing the context that the scope surrounding the eval provided. This change makes the behavior Perl4 compatible, besides fixing bugs resulting from the inconsistent behavior. This program:
@a = qw(time now is time); print eval @a; print '|', scalar eval @a;
used to print something like ``timenowis881399109|4'', but now (and in perl4) prints ``4|4''.
Changes to tainting checks
A bug in previous versions may have failed to detect some insecure conditions when taint checks are turned on. (Taint checks are used in setuid or setgid scripts, or when explicitly turned on with the "-T" invocation option.) Although it's unlikely, this may cause a previously-working script to now fail --- which should be construed as a blessing, since that indicates a potentially-serious security hole was just plugged.The new restrictions when tainting include:
- No glob() or <*>
- These operators may spawn the C shell (csh), which cannot be made safe. This restriction will be lifted in a future version of Perl when globbing is implemented without the use of an external program.
- No spawning if tainted $CDPATH, $ENV, $BASH_ENV
- These environment variables may alter the behavior of spawned programs (especially shells) in ways that subvert security. So now they are treated as dangerous, in the manner of $IFS and $PATH.
- No spawning if tainted $TERM doesn't look like a terminal name
- Some termcap libraries do unsafe things with $TERM. However, it would be unnecessarily harsh to treat all $TERM values as unsafe, since only shell metacharacters can cause trouble in $TERM. So a tainted $TERM is considered to be safe if it contains only alphanumerics, underscores, dashes, and colons, and unsafe if it contains other characters (including whitespace).
New Opcode module and revised Safe module
A new Opcode module supports the creation, manipulation and application of opcode masks. The revised Safe module has a new API and is implemented using the new Opcode module. Please read the new Opcode and Safe documentation.Embedding improvements
In older versions of Perl it was not possible to create more than one Perl interpreter instance inside a single process without leaking like a sieve and/or crashing. The bugs that caused this behavior have all been fixed. However, you still must take care when embedding Perl in a C program. See the updated perlembed manpage for tips on how to manage your interpreters.Internal change: FileHandle class based on IO::* classes
File handles are now stored internally as type IO::Handle. The FileHandle module is still supported for backwards compatibility, but it is now merely a front end to the IO::* modules --- specifically, IO::Handle, IO::Seekable, and IO::File. We suggest, but do not require, that you use the IO::* modules in new code.In harmony with this change, *GLOB{FILEHANDLE} is now just a backward-compatible synonym for *GLOB{IO}.
Internal change: PerlIO abstraction interface
It is now possible to build Perl with AT&T's sfio IO package instead of stdio. See perlapio for more details, and the INSTALL file for how to use it.New and changed syntax
- $coderef->(PARAMS)
-
A subroutine reference may now be suffixed with an arrow and a
(possibly empty) parameter list. This syntax denotes a call of the
referenced subroutine, with the given parameters (if any).
This new syntax follows the pattern of "$hashref->{FOO}" and "$aryref->[$foo]": You may now write "&$subref($foo)" as "$subref->($foo)". All these arrow terms may be chained; thus, "&{$table->{FOO}}($bar)" may now be written "$table->{FOO}->($bar)".
New and changed builtin constants
- __PACKAGE__
- The current package name at compile time, or the undefined value if there is no current package (due to a "package;" directive). Like "__FILE__" and "__LINE__", "__PACKAGE__" does not interpolate into strings.
New and changed builtin variables
- $^E
- Extended error message on some platforms. (Also known as $EXTENDED_OS_ERROR if you "use English").
- $^H
- The current set of syntax checks enabled by "use strict". See the documentation of "strict" for more details. Not actually new, but newly documented. Because it is intended for internal use by Perl core components, there is no "use English" long name for this variable.
- $^M
-
By default, running out of memory it is not trappable. However, if
compiled for this, Perl may use the contents of $^M as an emergency
pool after die()ing with this message. Suppose that your Perl were
compiled with -DPERL_EMERGENCY_SBRK and used Perl's malloc. Then
$^M = 'a' x (1<<16);
would allocate a 64K buffer for use when in emergency. See the INSTALL file for information on how to enable this option. As a disincentive to casual use of this advanced feature, there is no "use English" long name for this variable.
New and changed builtin functions
- delete on slices
- This now works. (e.g. "delete @ENV{'PATH', 'MANPATH'}")
- flock
- is now supported on more platforms, prefers fcntl to lockf when emulating, and always flushes before (un)locking.
- printf and sprintf
-
Perl now implements these functions itself; it doesn't use the C
library function sprintf() any more, except for floating-point
numbers, and even then only known flags are allowed. As a result, it
is now possible to know which conversions and flags will work, and
what they will do.
The new conversions in Perl's sprintf() are:
%i a synonym for %d %p a pointer (the address of the Perl value, in hexadecimal) %n special: *stores* the number of characters output so far into the next variable in the parameter list
The new flags that go between the "%" and the conversion are:
# prefix octal with "0", hex with "0x" h interpret integer as C type "short" or "unsigned short" V interpret integer as Perl's standard integer type
Also, where a number would appear in the flags, an asterisk (``*'') may be used instead, in which case Perl uses the next item in the parameter list as the given number (that is, as the field width or precision). If a field width obtained through ``*'' is negative, it has the same effect as the '-' flag: left-justification.
See ``sprintf'' in perlfunc for a complete list of conversion and flags.
- keys as an lvalue
-
As an lvalue, "keys" allows you to increase the number of hash buckets
allocated for the given hash. This can gain you a measure of efficiency if
you know the hash is going to get big. (This is similar to pre-extending
an array by assigning a larger number to $#array.) If you say
keys %hash = 200;
then %hash will have at least 200 buckets allocated for it. These buckets will be retained even if you do "%hash = ()"; use "undef %hash" if you want to free the storage while %hash is still in scope. You can't shrink the number of buckets allocated for the hash using "keys" in this way (but you needn't worry about doing this by accident, as trying has no effect).
- my() in Control Structures
-
You can now use my() (with or without the parentheses) in the control
expressions of control structures such as:
while (defined(my $line = <>)) { $line = lc $line; } continue { print $line; } if ((my $answer = <STDIN>) =~ /^y(es)?$/i) { user_agrees(); } elsif ($answer =~ /^n(o)?$/i) { user_disagrees(); } else { chomp $answer; die "`$answer' is neither `yes' nor `no'"; }
Also, you can declare a foreach loop control variable as lexical by preceding it with the word ``my''. For example, in:
foreach my $i (1, 2, 3) { some_function(); }
$i is a lexical variable, and the scope of $i extends to the end of the loop, but not beyond it.
Note that you still cannot use my() on global punctuation variables such as $_ and the like.
- pack() and unpack()
-
A new format 'w' represents a BER compressed integer (as defined in
ASN.1). Its format is a sequence of one or more bytes, each of which
provides seven bits of the total value, with the most significant
first. Bit eight of each byte is set, except for the last byte, in
which bit eight is clear.
If 'p' or 'P' are given undef as values, they now generate a NULL pointer.
Both pack() and unpack() now fail when their templates contain invalid types. (Invalid types used to be ignored.)
- sysseek()
- The new sysseek() operator is a variant of seek() that sets and gets the file's system read/write position, using the lseek(2) system call. It is the only reliable way to seek before using sysread() or syswrite(). Its return value is the new position, or the undefined value on failure.
- use VERSION
- If the first argument to "use" is a number, it is treated as a version number instead of a module name. If the version of the Perl interpreter is less than VERSION, then an error message is printed and Perl exits immediately. Because "use" occurs at compile time, this check happens immediately during the compilation process, unlike "require VERSION", which waits until runtime for the check. This is often useful if you need to check the current Perl version before "use"ing library modules which have changed in incompatible ways from older versions of Perl. (We try not to do this more than we have to.)
- use Module VERSION LIST
-
If the VERSION argument is present between Module and LIST, then the
"use" will call the VERSION method in class Module with the given
version as an argument. The default VERSION method, inherited from
the UNIVERSAL class, croaks if the given version is larger than the
value of the variable $Module::VERSION. (Note that there is not a
comma after VERSION!)
This version-checking mechanism is similar to the one currently used in the Exporter module, but it is faster and can be used with modules that don't use the Exporter. It is the recommended method for new code.
- prototype(FUNCTION)
- Returns the prototype of a function as a string (or "undef" if the function has no prototype). FUNCTION is a reference to or the name of the function whose prototype you want to retrieve. (Not actually new; just never documented before.)
- srand
-
The default seed for "srand", which used to be "time", has been changed.
Now it's a heady mix of difficult-to-predict system-dependent values,
which should be sufficient for most everyday purposes.
Previous to version 5.004, calling "rand" without first calling "srand" would yield the same sequence of random numbers on most or all machines. Now, when perl sees that you're calling "rand" and haven't yet called "srand", it calls "srand" with the default seed. You should still call "srand" manually if your code might ever be run on a pre-5.004 system, of course, or if you want a seed other than the default.
- $_ as Default
- Functions documented in the Camel to default to $_ now in fact do, and all those that do are so documented in perlfunc.
- m//gc does not reset search position on failure
- The "m//g" match iteration construct has always reset its target string's search position (which is visible through the "pos" operator) when a match fails; as a result, the next "m//g" match after a failure starts again at the beginning of the string. With Perl 5.004, this reset may be disabled by adding the ``c'' (for ``continue'') modifier, i.e. "m//gc". This feature, in conjunction with the "\G" zero-width assertion, makes it possible to chain matches together. See perlop and perlre.
- m//x ignores whitespace before ?*+{}
- The "m//x" construct has always been intended to ignore all unescaped whitespace. However, before Perl 5.004, whitespace had the effect of escaping repeat modifiers like ``*'' or ``?''; for example, "/a *b/x" was (mis)interpreted as "/a\*b/x". This bug has been fixed in 5.004.
- nested sub{} closures work now
- Prior to the 5.004 release, nested anonymous functions didn't work right. They do now.
- formats work right on changing lexicals
-
Just like anonymous functions that contain lexical variables
that change (like a lexical index variable for a "foreach" loop),
formats now work properly. For example, this silently failed
before (printed only zeros), but is fine now:
my $i; foreach $i ( 1 .. 10 ) { write; } format = my i is @# $i .
However, it still fails (without a warning) if the foreach is within a subroutine:
my $i; sub foo { foreach $i ( 1 .. 10 ) { write; } } foo; format = my i is @# $i .
New builtin methods
The "UNIVERSAL" package automatically contains the following methods that are inherited by all other classes:- isa(CLASS)
-
"isa" returns true if its object is blessed into a subclass of "CLASS"
"isa" is also exportable and can be called as a sub with two arguments. This allows the ability to check what a reference points to. Example:
use UNIVERSAL qw(isa); if(isa($ref, 'ARRAY')) { ... }
- can(METHOD)
- "can" checks to see if its object has a method called "METHOD", if it does then a reference to the sub is returned; if it does not then undef is returned.
- VERSION( [NEED] )
-
"VERSION" returns the version number of the class (package). If the
NEED argument is given then it will check that the current version (as
defined by the $VERSION variable in the given package) not less than
NEED; it will die if this is not the case. This method is normally
called as a class method. This method is called automatically by the
"VERSION" form of "use".
use A 1.2 qw(some imported subs); # implies: A->VERSION(1.2);
NOTE: "can" directly uses Perl's internal code for method lookup, and "isa" uses a very similar method and caching strategy. This may cause strange effects if the Perl code dynamically changes @ISA in any package.
You may add other methods to the UNIVERSAL class via Perl or XS code. You do not need to "use UNIVERSAL" in order to make these methods available to your program. This is necessary only if you wish to have "isa" available as a plain subroutine in the current package.
TIEHANDLE now supported
See perltie for other kinds of tie()s.- TIEHANDLE classname, LIST
-
This is the constructor for the class. That means it is expected to
return an object of some sort. The reference can be used to
hold some internal information.
sub TIEHANDLE { print "<shout>\n"; my $i; return bless \$i, shift; }
- PRINT this, LIST
-
This method will be triggered every time the tied handle is printed to.
Beyond its self reference it also expects the list that was passed to
the print function.
sub PRINT { $r = shift; $$r++; return print join( $, => map {uc} @_), $\; }
- PRINTF this, LIST
-
This method will be triggered every time the tied handle is printed to
with the "printf()" function.
Beyond its self reference it also expects the format and list that was
passed to the printf function.
sub PRINTF { shift; my $fmt = shift; print sprintf($fmt, @_)."\n"; }
- READ this LIST
-
This method will be called when the handle is read from via the "read"
or "sysread" functions.
sub READ { $r = shift; my($buf,$len,$offset) = @_; print "READ called, \$buf=$buf, \$len=$len, \$offset=$offset"; }
- READLINE this
-
This method will be called when the handle is read from. The method
should return undef when there is no more data.
sub READLINE { $r = shift; return "PRINT called $$r times\n" }
- GETC this
-
This method will be called when the "getc" function is called.
sub GETC { print "Don't GETC, Get Perl"; return "a"; }
- DESTROY this
-
As with the other types of ties, this method will be called when the
tied handle is about to be destroyed. This is useful for debugging and
possibly for cleaning up.
sub DESTROY { print "</shout>\n"; }
Malloc enhancements
If perl is compiled with the malloc included with the perl distribution (that is, if "perl -V:d_mymalloc" is 'define') then you can print memory statistics at runtime by running Perl thusly:
env PERL_DEBUG_MSTATS=2 perl your_script_here
The value of 2 means to print statistics after compilation and on exit; with a value of 1, the statistics are printed only on exit. (If you want the statistics at an arbitrary time, you'll need to install the optional module Devel::Peek.)
Three new compilation flags are recognized by malloc.c. (They have no effect if perl is compiled with system malloc().)
- -DPERL_EMERGENCY_SBRK
- If this macro is defined, running out of memory need not be a fatal error: a memory pool can allocated by assigning to the special variable $^M. See ``$^M''.
- -DPACK_MALLOC
-
Perl memory allocation is by bucket with sizes close to powers of two.
Because of these malloc overhead may be big, especially for data of
size exactly a power of two. If "PACK_MALLOC" is defined, perl uses
a slightly different algorithm for small allocations (up to 64 bytes
long), which makes it possible to have overhead down to 1 byte for
allocations which are powers of two (and appear quite often).
Expected memory savings (with 8-byte alignment in "alignbytes") is about 20% for typical Perl usage. Expected slowdown due to additional malloc overhead is in fractions of a percent (hard to measure, because of the effect of saved memory on speed).
- -DTWO_POT_OPTIMIZE
-
Similarly to "PACK_MALLOC", this macro improves allocations of data
with size close to a power of two; but this works for big allocations
(starting with 16K by default). Such allocations are typical for big
hashes and special-purpose scripts, especially image processing.
On recent systems, the fact that perl requires 2M from system for 1M allocation will not affect speed of execution, since the tail of such a chunk is not going to be touched (and thus will not require real memory). However, it may result in a premature out-of-memory error. So if you will be manipulating very large blocks with sizes close to powers of two, it would be wise to define this macro.
Expected saving of memory is 0-100% (100% in applications which require most memory in such 2**n chunks); expected slowdown is negligible.
Miscellaneous efficiency enhancements
Functions that have an empty prototype and that do nothing but return a fixed value are now inlined (e.g. "sub PI () { 3.14159 }").Each unique hash key is only allocated once, no matter how many hashes have an entry with that key. So even if you have 100 copies of the same hash, the hash keys never have to be reallocated.
Support for More Operating Systems
Support for the following operating systems is new in Perl 5.004.Win32
Perl 5.004 now includes support for building a ``native'' perl under Windows NT, using the Microsoft Visual C++ compiler (versions 2.0 and above) or the Borland C++ compiler (versions 5.02 and above). The resulting perl can be used under Windows 95 (if it is installed in the same directory locations as it got installed in Windows NT). This port includes support for perl extension building tools like MakeMaker and h2xs, so that many extensions available on the Comprehensive Perl Archive Network (CPAN) can now be readily built under Windows NT. See http://www.perl.com/ for more information on CPAN and README.win32 in the perl distribution for more details on how to get started with building this port.There is also support for building perl under the Cygwin32 environment. Cygwin32 is a set of GNU tools that make it possible to compile and run many Unix programs under Windows NT by providing a mostly Unix-like interface for compilation and execution. See README.cygwin32 in the perl distribution for more details on this port and how to obtain the Cygwin32 toolkit.
Plan 9
See README.plan9 in the perl distribution.QNX
See README.qnx in the perl distribution.AmigaOS
See README.amigaos in the perl distribution.Pragmata
Six new pragmatic modules exist:- use autouse MODULE => qw(sub1 sub2 sub3)
- Defers "require MODULE" until someone calls one of the specified subroutines (which must be exported by MODULE). This pragma should be used with caution, and only when necessary.
- use blib
- use blib 'dir'
-
Looks for MakeMaker-like 'blib' directory structure starting in
dir (or current directory) and working back up to five levels of
parent directories.
Intended for use on command line with -M option as a way of testing arbitrary scripts against an uninstalled version of a package.
- use constant NAME => VALUE
- Provides a convenient interface for creating compile-time constants, See ``Constant Functions'' in perlsub.
- use locale
-
Tells the compiler to enable (or disable) the use of POSIX locales for
builtin operations.
When "use locale" is in effect, the current LC_CTYPE locale is used for regular expressions and case mapping; LC_COLLATE for string ordering; and LC_NUMERIC for numeric formatting in printf and sprintf (but not in print). LC_NUMERIC is always used in write, since lexical scoping of formats is problematic at best.
Each "use locale" or "no locale" affects statements to the end of the enclosing BLOCK or, if not inside a BLOCK, to the end of the current file. Locales can be switched and queried with POSIX::setlocale().
See perllocale for more information.
- use ops
- Disable unsafe opcodes, or any named opcodes, when compiling Perl code.
- use vmsish
- Enable VMS-specific language features. Currently, there are three VMS-specific features available: 'status', which makes $? and "system" return genuine VMS status values instead of emulating POSIX; 'exit', which makes "exit" take a genuine VMS status value instead of assuming that "exit 1" is an error; and 'time', which makes all times relative to the local time zone, in the VMS tradition.
Modules
Required Updates
Though Perl 5.004 is compatible with almost all modules that work with Perl 5.003, there are a few exceptions:
Module Required Version for Perl 5.004 ------ ------------------------------- Filter Filter-1.12 LWP libwww-perl-5.08 Tk Tk400.202 (-w makes noise)
Also, the majordomo mailing list program, version 1.94.1, doesn't work with Perl 5.004 (nor with perl 4), because it executes an invalid regular expression. This bug is fixed in majordomo version 1.94.2.
Installation directories
The installperl script now places the Perl source files for extensions in the architecture-specific library directory, which is where the shared libraries for extensions have always been. This change is intended to allow administrators to keep the Perl 5.004 library directory unchanged from a previous version, without running the risk of binary incompatibility between extensions' Perl source and shared libraries.Module information summary
Brand new modules, arranged by topic rather than strictly alphabetically:
CGI.pm Web server interface ("Common Gateway Interface") CGI/Apache.pm Support for Apache's Perl module CGI/Carp.pm Log server errors with helpful context CGI/Fast.pm Support for FastCGI (persistent server process) CGI/Push.pm Support for server push CGI/Switch.pm Simple interface for multiple server types CPAN Interface to Comprehensive Perl Archive Network CPAN::FirstTime Utility for creating CPAN configuration file CPAN::Nox Runs CPAN while avoiding compiled extensions IO.pm Top-level interface to IO::* classes IO/File.pm IO::File extension Perl module IO/Handle.pm IO::Handle extension Perl module IO/Pipe.pm IO::Pipe extension Perl module IO/Seekable.pm IO::Seekable extension Perl module IO/Select.pm IO::Select extension Perl module IO/Socket.pm IO::Socket extension Perl module Opcode.pm Disable named opcodes when compiling Perl code ExtUtils/Embed.pm Utilities for embedding Perl in C programs ExtUtils/testlib.pm Fixes up @INC to use just-built extension FindBin.pm Find path of currently executing program Class/Struct.pm Declare struct-like datatypes as Perl classes File/stat.pm By-name interface to Perl's builtin stat Net/hostent.pm By-name interface to Perl's builtin gethost* Net/netent.pm By-name interface to Perl's builtin getnet* Net/protoent.pm By-name interface to Perl's builtin getproto* Net/servent.pm By-name interface to Perl's builtin getserv* Time/gmtime.pm By-name interface to Perl's builtin gmtime Time/localtime.pm By-name interface to Perl's builtin localtime Time/tm.pm Internal object for Time::{gm,local}time User/grent.pm By-name interface to Perl's builtin getgr* User/pwent.pm By-name interface to Perl's builtin getpw* Tie/RefHash.pm Base class for tied hashes with references as keys UNIVERSAL.pm Base class for *ALL* classes
Fcntl
New constants in the existing Fcntl modules are now supported, provided that your operating system happens to support them:
F_GETOWN F_SETOWN O_ASYNC O_DEFER O_DSYNC O_FSYNC O_SYNC O_EXLOCK O_SHLOCK
These constants are intended for use with the Perl operators sysopen() and fcntl() and the basic database modules like SDBM_File. For the exact meaning of these and other Fcntl constants please refer to your operating system's documentation for fcntl() and open().
In addition, the Fcntl module now provides these constants for use with the Perl operator flock():
LOCK_SH LOCK_EX LOCK_NB LOCK_UN
These constants are defined in all environments (because where there is no flock() system call, Perl emulates it). However, for historical reasons, these constants are not exported unless they are explicitly requested with the ``:flock'' tag (e.g. "use Fcntl ':flock'").
IO
The IO module provides a simple mechanism to load all the IO modules at one go. Currently this includes:
IO::Handle IO::Seekable IO::File IO::Pipe IO::Socket
For more information on any of these modules, please see its respective documentation.
Math::Complex
The Math::Complex module has been totally rewritten, and now supports more operations. These are overloaded:
+ - * / ** <=> neg ~ abs sqrt exp log sin cos atan2 "" (stringify)
And these functions are now exported:
pi i Re Im arg log10 logn ln cbrt root tan csc sec cot asin acos atan acsc asec acot sinh cosh tanh csch sech coth asinh acosh atanh acsch asech acoth cplx cplxe
Math::Trig
This new module provides a simpler interface to parts of Math::Complex for those who need trigonometric functions only for real numbers.DB_File
There have been quite a few changes made to DB_File. Here are a few of the highlights:- *
- Fixed a handful of bugs.
- *
- By public demand, added support for the standard hash function exists().
- *
- Made it compatible with Berkeley DB 1.86.
- *
- Made negative subscripts work with RECNO interface.
- *
- Changed the default flags from O_RDWR to O_CREAT|O_RDWR and the default mode from 0640 to 0666.
- *
- Made DB_File automatically import the open() constants (O_RDWR, O_CREAT etc.) from Fcntl, if available.
- *
- Updated documentation.
Refer to the HISTORY section in DB_File.pm for a complete list of changes. Everything after DB_File 1.01 has been added since 5.003.
Net::Ping
Major rewrite - support added for both udp echo and real icmp pings.Object-oriented overrides for builtin operators
Many of the Perl builtins returning lists now have object-oriented overrides. These are:
File::stat Net::hostent Net::netent Net::protoent Net::servent Time::gmtime Time::localtime User::grent User::pwent
For example, you can now say
use File::stat; use User::pwent; $his = (stat($filename)->st_uid == pwent($whoever)->pw_uid);
Utility Changes
pod2html
- Sends converted HTML to standard output
- The pod2html utility included with Perl 5.004 is entirely new. By default, it sends the converted HTML to its standard output, instead of writing it to a file like Perl 5.003's pod2html did. Use the --outfile=FILENAME option to write to a file.
xsubpp
- void XSUBs now default to returning nothing
-
Due to a documentation/implementation bug in previous versions of
Perl, XSUBs with a return type of "void" have actually been
returning one value. Usually that value was the GV for the XSUB,
but sometimes it was some already freed or reused value, which would
sometimes lead to program failure.
In Perl 5.004, if an XSUB is declared as returning "void", it actually returns no value, i.e. an empty list (though there is a backward-compatibility exception; see below). If your XSUB really does return an SV, you should give it a return type of "SV *".
For backward compatibility, xsubpp tries to guess whether a "void" XSUB is really "void" or if it wants to return an "SV *". It does so by examining the text of the XSUB: if xsubpp finds what looks like an assignment to ST(0), it assumes that the XSUB's return type is really "SV *".
C Language API Changes
- gv_fetchmethod and perl_call_sv
-
The "gv_fetchmethod" function finds a method for an object, just like
in Perl 5.003. The GV it returns may be a method cache entry.
However, in Perl 5.004, method cache entries are not visible to users;
therefore, they can no longer be passed directly to "perl_call_sv".
Instead, you should use the "GvCV" macro on the GV to extract its CV,
and pass the CV to "perl_call_sv".
The most likely symptom of passing the result of "gv_fetchmethod" to "perl_call_sv" is Perl's producing an ``Undefined subroutine called'' error on the second call to a given method (since there is no cache on the first call).
- perl_eval_pv
- A new function handy for eval'ing strings of Perl code inside C code. This function returns the value from the eval statement, which can be used instead of fetching globals from the symbol table. See perlguts, perlembed and perlcall for details and examples.
- Extended API for manipulating hashes
- Internal handling of hash keys has changed. The old hashtable API is still fully supported, and will likely remain so. The additions to the API allow passing keys as "SV*"s, so that "tied" hashes can be given real scalars as keys rather than plain strings (nontied hashes still can only use strings as keys). New extensions must use the new hash access functions and macros if they wish to use "SV*" keys. These additions also make it feasible to manipulate "HE*"s (hash entries), which can be more efficient. See perlguts for details.
Documentation Changes
Many of the base and library pods were updated. These new pods are included in section 1:- perldelta
- This document.
- perlfaq
- Frequently asked questions.
- perllocale
- Locale support (internationalization and localization).
- perltoot
- Tutorial on Perl OO programming.
- perlapio
- Perl internal IO abstraction interface.
- perlmodlib
- Perl module library and recommended practice for module creation. Extracted from perlmod (which is much smaller as a result).
- perldebug
- Although not new, this has been massively updated.
- perlsec
- Although not new, this has been massively updated.
New Diagnostics
Several new conditions will trigger warnings that were silent before. Some only affect certain platforms. The following new warnings and errors outline these. These messages are classified as follows (listed in increasing order of desperation):
(W) A warning (optional). (D) A deprecation (optional). (S) A severe warning (mandatory). (F) A fatal error (trappable). (P) An internal error you should never see (trappable). (X) A very fatal error (nontrappable). (A) An alien error message (not generated by Perl).
- my variable %s masks earlier declaration in same scope
- (W) A lexical variable has been redeclared in the same scope, effectively eliminating all access to the previous instance. This is almost always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure referents to it are destroyed.
- %s argument is not a HASH element or slice
-
(F) The argument to delete() must be either a hash element, such as
$foo{$bar} $ref->[12]->{"susie"}
or a hash slice, such as
@foo{$bar, $baz, $xyzzy} @{$ref->[12]}{"susie", "queue"}
- Allocation too large: %lx
- (X) You can't allocate more than 64K on an MS-DOS machine.
- Allocation too large
- (F) You can't allocate more than 2^31+``small amount'' bytes.
- Applying %s to %s will act on scalar(%s)
- (W) The pattern match (//), substitution (s///), and transliteration (tr///) operators work on scalar values. If you apply one of them to an array or a hash, it will convert the array or hash to a scalar value --- the length of an array, or the population info of a hash --- and then work on that scalar value. This is probably not what you meant to do. See ``grep'' in perlfunc and ``map'' in perlfunc for alternatives.
- Attempt to free nonexistent shared string
- (P) Perl maintains a reference counted internal table of strings to optimize the storage and access of hash keys and other strings. This indicates someone tried to decrement the reference count of a string that can no longer be found in the table.
- Attempt to use reference as lvalue in substr
- (W) You supplied a reference as the first argument to substr() used as an lvalue, which is pretty strange. Perhaps you forgot to dereference it first. See ``substr'' in perlfunc.
- Bareword %s refers to nonexistent package
- (W) You used a qualified bareword of the form "Foo::", but the compiler saw no other uses of that namespace before that point. Perhaps you need to predeclare a package?
- Can't redefine active sort subroutine %s
- (F) Perl optimizes the internal handling of sort subroutines and keeps pointers into them. You tried to redefine one such sort subroutine when it was currently active, which is not allowed. If you really want to do this, you should write "sort { &func } @x" instead of "sort func @x".
- Can't use bareword (%s) as %s ref while strict refs in use
- (F) Only hard references are allowed by ``strict refs''. Symbolic references are disallowed. See perlref.
- Cannot resolve method `%s' overloading `%s' in package `%s'
- (P) Internal error trying to resolve overloading specified by a method name (as opposed to a subroutine reference).
- Constant subroutine %s redefined
- (S) You redefined a subroutine which had previously been eligible for inlining. See ``Constant Functions'' in perlsub for commentary and workarounds.
- Constant subroutine %s undefined
- (S) You undefined a subroutine which had previously been eligible for inlining. See ``Constant Functions'' in perlsub for commentary and workarounds.
- Copy method did not return a reference
- (F) The method which overloads ``='' is buggy. See ``Copy Constructor'' in overload.
- Died
- (F) You passed die() an empty string (the equivalent of "die """) or you called it with no args and both $@ and $_ were empty.
- Exiting pseudo-block via %s
- (W) You are exiting a rather special block construct (like a sort block or subroutine) by unconventional means, such as a goto, or a loop control statement. See ``sort'' in perlfunc.
- Identifier too long
- (F) Perl limits identifiers (names for variables, functions, etc.) to 252 characters for simple names, somewhat more for compound names (like $A::B). You've exceeded Perl's limits. Future versions of Perl are likely to eliminate these arbitrary limitations.
- Illegal character %s (carriage return)
- (F) A carriage return character was found in the input. This is an error, and not a warning, because carriage return characters can break multi-line strings, including here documents (e.g., "print <<EOF;").
- Illegal switch in PERL5OPT: %s
- (X) The PERL5OPT environment variable may only be used to set the following switches: -[DIMUdmw].
- Integer overflow in hex number
- (S) The literal hex number you have specified is too big for your architecture. On a 32-bit architecture the largest hex literal is 0xFFFFFFFF.
- Integer overflow in octal number
- (S) The literal octal number you have specified is too big for your architecture. On a 32-bit architecture the largest octal literal is<PHONE_NUMBER>77.
- internal error: glob failed
- (P) Something went wrong with the external program(s) used for "glob" and "<*.c>". This may mean that your csh (C shell) is broken. If so, you should change all of the csh-related variables in config.sh: If you have tcsh, make the variables refer to it as if it were csh (e.g. "full_csh='/usr/bin/tcsh'"); otherwise, make them all empty (except that "d_csh" should be 'undef') so that Perl will think csh is missing. In either case, after editing config.sh, run "./Configure -S" and rebuild Perl.
- Invalid conversion in %s: %s
- (W) Perl does not understand the given format conversion. See ``sprintf'' in perlfunc.
- Invalid type in pack: '%s'
- (F) The given character is not a valid pack type. See ``pack'' in perlfunc.
- Invalid type in unpack: '%s'
- (F) The given character is not a valid unpack type. See ``unpack'' in perlfunc.
- Name %s::%s used only once: possible typo
- (W) Typographical errors often show up as unique variable names. If you had a good reason for having a unique name, then just mention it again somehow to suppress the message (the "use vars" pragma is provided for just this purpose).
- Null picture in formline
- (F) The first argument to formline must be a valid format picture specification. It was found to be empty, which probably means you supplied it an uninitialized value. See perlform.
- Offset outside string
- (F) You tried to do a read/write/send/recv operation with an offset pointing outside the buffer. This is difficult to imagine. The sole exception to this is that "sysread()"ing past the buffer will extend the buffer and zero pad the new area.
- Out of memory!
-
(X|F) The malloc() function returned 0, indicating there was insufficient
remaining memory (or virtual memory) to satisfy the request.
The request was judged to be small, so the possibility to trap it depends on the way Perl was compiled. By default it is not trappable. However, if compiled for this, Perl may use the contents of $^M as an emergency pool after die()ing with this message. In this case the error is trappable once.
- Out of memory during request for %s
- (F) The malloc() function returned 0, indicating there was insufficient remaining memory (or virtual memory) to satisfy the request. However, the request was judged large enough (compile-time default is 64K), so a possibility to shut down by trapping this error is granted.
- panic: frexp
- (P) The library function frexp() failed, making printf(``%f'') impossible.
- Possible attempt to put comments in qw() list
-
(W) qw() lists contain items separated by whitespace; as with literal
strings, comment characters are not ignored, but are instead treated
as literal data. (You may have used different delimiters than the
parentheses shown here; braces are also frequently used.)
You probably wrote something like this:
@list = qw( a # a comment b # another comment );
when you should have written this:
@list = qw( a b );
If you really want comments, build your list the old-fashioned way, with quotes and commas:
@list = ( 'a', # a comment 'b', # another comment );
- Possible attempt to separate words with commas
-
(W) qw() lists contain items separated by whitespace; therefore commas
aren't needed to separate the items. (You may have used different
delimiters than the parentheses shown here; braces are also frequently
used.)
You probably wrote something like this:
qw! a, b, c !;
which puts literal commas into some of the list items. Write it without commas if you don't want them to appear in your data:
qw! a b c !;
- Scalar value @%s{%s} better written as $%s{%s}
- (W) You've used a hash slice (indicated by @) to select a single element of a hash. Generally it's better to ask for a scalar value (indicated by $). The difference is that $foo{&bar} always behaves like a scalar, both when assigning to it and when evaluating its argument, while @foo{&bar} behaves like a list when you assign to it, and provides a list context to its subscript, which can do weird things if you're expecting only one subscript.
- Stub found while resolving method `%s' overloading `%s' in %s
- (P) Overloading resolution over @ISA tree may be broken by importing stubs. Stubs should never be implicitly created, but explicit calls to "can" may break this.
- Too late for -T option
- (X) The #! line (or local equivalent) in a Perl script contains the -T option, but Perl was not invoked with -T in its argument list. This is an error because, by the time Perl discovers a -T in a script, it's too late to properly taint everything from the environment. So Perl gives up.
- untie attempted while %d inner references still exist
- (W) A copy of the object returned from "tie" (or "tied") was still valid when "untie" was called.
- Unrecognized character %s
- (F) The Perl parser has no idea what to do with the specified character in your Perl script (or eval). Perhaps you tried to run a compressed script, a binary program, or a directory as a Perl program.
- Unsupported function fork
-
(F) Your version of executable does not support forking.
Note that under some systems, like OS/2, there may be different flavors of Perl executables, some of which may support fork, some not. Try changing the name you call Perl by to "perl_", "perl__", and so on.
- Use of $$<digit> to mean ${$}<digit> is deprecated
-
(D) Perl versions before 5.004 misinterpreted any type marker followed
by ``$'' and a digit. For example, ``$$0'' was incorrectly taken to mean
``${$}0'' instead of ``${$0}''. This bug is (mostly) fixed in Perl 5.004.
However, the developers of Perl 5.004 could not fix this bug completely, because at least two widely-used modules depend on the old meaning of ``$$0'' in a string. So Perl 5.004 still interprets ``$$<digit>'' in the old (broken) way inside strings; but it generates this message as a warning. And in Perl 5.005, this special treatment will cease.
- Value of %s can be 0; test with defined()
- (W) In a conditional expression, you used <HANDLE>, <*> (glob), "each()", or "readdir()" as a boolean value. Each of these constructs can return a value of ``0''; that would make the conditional expression false, which is probably not what you intended. When using these constructs in conditional expressions, test their values with the "defined" operator.
- Variable %s may be unavailable
-
(W) An inner (nested) anonymous subroutine is inside a named
subroutine, and outside that is another subroutine; and the anonymous
(innermost) subroutine is referencing a lexical variable defined in
the outermost subroutine. For example:
sub outermost { my $a; sub middle { sub { $a } } }
If the anonymous subroutine is called or referenced (directly or indirectly) from the outermost subroutine, it will share the variable as you would expect. But if the anonymous subroutine is called or referenced when the outermost subroutine is not active, it will see the value of the shared variable as it was before and during the *first* call to the outermost subroutine, which is probably not what you want.
In these circumstances, it is usually best to make the middle subroutine anonymous, using the "sub {}" syntax. Perl has specific support for shared variables in nested anonymous subroutines; a named subroutine in between interferes with this feature.
- Variable %s will not stay shared
-
(W) An inner (nested) named subroutine is referencing a lexical
variable defined in an outer subroutine.
When the inner subroutine is called, it will probably see the value of the outer subroutine's variable as it was before and during the *first* call to the outer subroutine; in this case, after the first call to the outer subroutine is complete, the inner and outer subroutines will no longer share a common value for the variable. In other words, the variable will no longer be shared.
Furthermore, if the outer subroutine is anonymous and references a lexical variable outside itself, then the outer and inner subroutines will never share the given variable.
This problem can usually be solved by making the inner subroutine anonymous, using the "sub {}" syntax. When inner anonymous subs that reference variables in outer subroutines are called or referenced, they are automatically rebound to the current values of such variables.
- Warning: something's wrong
- (W) You passed warn() an empty string (the equivalent of "warn """) or you called it with no args and $_ was empty.
- Ill-formed logical name |%s| in prime_env_iter
- (W) A warning peculiar to VMS. A logical name was encountered when preparing to iterate over %ENV which violates the syntactic rules governing logical names. Since it cannot be translated normally, it is skipped, and will not appear in %ENV. This may be a benign occurrence, as some software packages might directly modify logical name tables and introduce nonstandard names, or it may indicate that a logical name table has been corrupted.
- Got an error from DosAllocMem
- (P) An error peculiar to OS/2. Most probably you're using an obsolete version of Perl, and this should not happen anyway.
- Malformed PERLLIB_PREFIX
-
(F) An error peculiar to OS/2. PERLLIB_PREFIX should be of the form
prefix1;prefix2
or
prefix1 prefix2
with nonempty prefix1 and prefix2. If "prefix1" is indeed a prefix of a builtin library search path, prefix2 is substituted. The error may appear if components are not found, or are too long. See ``PERLLIB_PREFIX'' in README.os2.
- PERL_SH_DIR too long
- (F) An error peculiar to OS/2. PERL_SH_DIR is the directory to find the "sh"-shell in. See ``PERL_SH_DIR'' in README.os2.
- Process terminated by SIG%s
- (W) This is a standard message issued by OS/2 applications, while *nix applications die in silence. It is considered a feature of the OS/2 port. One can easily disable this by appropriate sighandlers, see ``Signals'' in perlipc. See also ``Process terminated by SIGTERM/SIGINT'' in README.os2.
BUGS
If you find what you think is a bug, you might check the headers of recently posted articles in the comp.lang.perl.misc newsgroup. There may also be information at http://www.perl.com/perl/ , the Perl Home Page.If you believe you have an unreported bug, please run the perlbug program included with your release. Make sure you trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of "perl -V", will be sent off to<EMAIL_ADDRESS>to be analysed by the Perl porting team.
SEE ALSO
The Changes file for exhaustive details on what changed.The INSTALL file for how to build Perl. This file has been significantly updated for 5.004, so even veteran users should look through it.
The README file for general stuff.
The Copying file for copyright information.
HISTORY
Constructed by Tom Christiansen, grabbing material with permission from innumerable contributors, with kibitzing by more than a few Perl porters.Last update: Wed May 14 11:14:09 EDT 1997
Index
- NAME
- DESCRIPTION
- Supported Environments
- Core Changes
-
- List assignment to %ENV works
- Change to Can't locate Foo.pm in @INC error
- Compilation option: Binary compatibility with 5.003
- $PERL5OPT environment variable
- Limitations on -M, -m, and -T options
- More precise warnings
- Deprecated: Inherited AUTOLOAD for non-methods
- Previously deprecated %OVERLOAD is no longer usable
- Subroutine arguments created only when they're modified
- Group vector changeable with $)
- Fixed parsing of $$<digit>, &$<digit>, etc.
- Fixed localization of $<digit>, $&, etc.
- No resetting of $. on implicit close
- wantarray may return undef
- eval EXPR determines value of EXPR in scalar context
- Changes to tainting checks
- New Opcode module and revised Safe module
- Embedding improvements
- Internal change: FileHandle class based on IO::* classes
- Internal change: PerlIO abstraction interface
- New and changed syntax
- New and changed builtin constants
- New and changed builtin variables
- New and changed builtin functions
- New builtin methods
- TIEHANDLE now supported
- Malloc enhancements
- Miscellaneous efficiency enhancements
- Support for More Operating Systems
- Pragmata
- Modules
- Utility Changes
- C Language API Changes
- Documentation Changes
- New Diagnostics
- BUGS
- SEE ALSO
- HISTORY
This document was created by man2html, using the manual pages.
Time: 05:29:07 GMT, December 24, 2015


You successfully logged in with your SceneID as {{ user_data.display_name }}, but it's not connected to an account on this site yet. If you already had an account here, you can log in to it and you'll be able to use both login methods from then on. If you don't have an account, you can create a new one without having to use a password to log in.


Go to the source code of this file.
|
| #define | FS_isInputBetween(inputType, min, max) inputType >= min && inputType < max ? true : false |
| |
| #define | FS_isButtion(inputType) FS_isInputBetween(inputType,Button0,LastButton) |
| |
| #define | FS_isDpad(inputType) FS_isInputBetween(inputType,DPadUp,LastDPad) |
| |
| #define | FS_isAxis(inputType) FS_isInputBetween(inputType,XAxis,LastAxis) |
| |
| #define | FS_isTrigger(inputType) FS_isInputBetween(inputType,Trigger1,LastTrigger) |
| |
|
| enum | freestick::FSDeviceInput {
freestick::XAxis,
freestick::YAxis,
freestick::XAxis2,
freestick::YAxis2,
freestick::XAxis3,
freestick::YAxis3,
freestick::LastAxis,
freestick::DPadUp,
freestick::DPadDown,
freestick::DPadLeft,
freestick::DPadRight,
freestick::LastDPad,
freestick::Button0,
freestick::ButtonA = Button0,
freestick::Button1,
freestick::ButtonB = Button1,
freestick::Button2,
freestick::ButtonX = Button2,
freestick::Button3,
freestick::ButtonY = Button3,
freestick::Button4,
freestick::LeftShoulder = Button4,
freestick::Button5,
freestick::RightShoulder = Button5,
freestick::Button6,
freestick::LeftShoulder2 = Button6,
freestick::Button7,
freestick::RightShoulder2 = Button7,
freestick::Button8,
freestick::ButtonSelect = Button8,
freestick::Button9,
freestick::ButtonStart = Button9,
freestick::Button10,
freestick::Axis1Button = Button10,
freestick::Button11,
freestick::Axis2Button = Button11,
freestick::Button12,
freestick::Button13,
freestick::Button14,
freestick::Button15,
freestick::Button16,
freestick::ButtonCenter,
freestick::Button18,
freestick::Button19,
freestick::Button20,
freestick::Button21,
freestick::Button22,
freestick::Button23,
freestick::Button24,
freestick::ButtonHome,
freestick::LastButton,
freestick::Trigger1,
freestick::Trigger2,
freestick::LastTrigger,
freestick::Unknown,
freestick::LastValueUp,
freestick::AllInputs,
freestick::LastInput
} |
| |
| enum | freestick::FSDeviceType {
freestick::FSBaseDeviceType,
freestick::FSUSBDeviceType,
freestick::FSUSBJoystickType,
freestick::FSUSBMACOSXJoystickType,
freestick::FSAndroidJoystickType,
freestick::FSDirectInputJoystickType,
freestick::FSUSBNULLDeviceType
} |
| |
◆ FS_isAxis
◆ FS_isButtion
◆ FS_isDpad
◆ FS_isInputBetween
| #define FS_isInputBetween |
( |
|
inputType, |
|
|
|
min, |
|
|
|
max |
|
) |
| inputType >= min && inputType < max ? true : false |
◆ FS_isTrigger


Use pads by pressing the corresponding key on your keyboard.
Stop pads once they're playing by pressing SHIFT
All keys in red outline are playable.


|
Apache log4cxx
Version 0.10.0
|
This class represents a datagram packet. More...
Inherits ObjectImpl.
Public Member Functions | |
| DatagramPacket (void *buf, int length) | |
Constructs a DatagramPacket for receiving packets of length length . More... | |
| DatagramPacket (void *buf, int length, InetAddressPtr address, int port) | |
Constructs a datagram packet for sending packets of length length to the specified port number on the specified host. More... | |
| DatagramPacket (void *buf, int offset, int length) | |
Constructs a DatagramPacket for receiving packets of length length , specifying an offset into the buffer. More... | |
| DatagramPacket (void *buf, int offset, int length, InetAddressPtr address, int port) | |
Constructs a datagram packet for sending packets of length length with offset offset to the specified port number on the specified host. More... | |
| ~DatagramPacket () | |
| InetAddressPtr | getAddress () const |
| Returns the IP address of the machine to which this datagram is being sent or from which the datagram was received. More... | |
| void * | getData () const |
| Returns the data received or the data to be sent. More... | |
| int | getLength () const |
| Returns the length of the data to be sent or the length of the data received. More... | |
| int | getOffset () const |
| Returns the offset of the data to be sent or the offset of the data received. More... | |
| int | getPort () const |
| Returns the port number on the remote host to which this datagram is being sent or from which the datagram was received. More... | |
| void | setAddress (InetAddressPtr address1) |
| void | setData (void *buf1) |
| Set the data buffer for this packet. More... | |
| void | setData (void *buf1, int offset1, int length1) |
| Set the data buffer for this packet. More... | |
| void | setLength (int length1) |
| Set the length for this packet. More... | |
| void | setPort (int port1) |
| Public Member Functions inherited from ObjectImpl | |
| ObjectImpl () | |
| virtual | ~ObjectImpl () |
| void | addRef () const |
| void | releaseRef () const |
| Public Member Functions inherited from Object | |
| virtual const helpers::Class & | getClass () const |
| virtual | ~Object () |
| virtual bool | instanceof (const Class &clazz) const =0 |
| virtual const void * | cast (const Class &clazz) const =0 |
Protected Attributes | |
| void * | buf |
| the data for this packet. More... | |
| int | offset |
| The offset of the data for this packet. More... | |
| int | length |
| The length of the data for this packet. More... | |
| InetAddressPtr | address |
| The IP address for this packet. More... | |
| int | port |
| The UDP port number of the remote host. More... | |
| Protected Attributes inherited from ObjectImpl | |
| unsigned int volatile | ref |
Additional Inherited Members | |
| Static Public Member Functions inherited from Object | |
| static const helpers::Class & | getStaticClass () |
| static const log4cxx::helpers::ClassRegistration & | registerClass () |
This class represents a datagram packet.
Datagram packets are used to implement a connectionless packet delivery service. Each message is routed from one machine to another based solely on information contained within that packet. Multiple packets sent from one machine to another might be routed differently, and might arrive in any order.
| DatagramPacket | ( | void * | buf, |
| int | length | ||
| ) |
Constructs a DatagramPacket for receiving packets of length length
.
| DatagramPacket | ( | void * | buf, |
| int | length, | ||
| InetAddressPtr | address, | ||
| int | port | ||
| ) |
Constructs a datagram packet for sending packets of length length
to the specified port number on the specified host.
| DatagramPacket | ( | void * | buf, |
| int | offset, | ||
| int | length | ||
| ) |
Constructs a DatagramPacket for receiving packets of length length
, specifying an offset into the buffer.
| DatagramPacket | ( | void * | buf, |
| int | offset, | ||
| int | length, | ||
| InetAddressPtr | address, | ||
| int | port | ||
| ) |
Constructs a datagram packet for sending packets of length length
with offset offset
to the specified port number on the specified host.
| ~DatagramPacket | ( | ) |
|
inline |
Returns the IP address of the machine to which this datagram is being sent or from which the datagram was received.
|
inline |
Returns the data received or the data to be sent.
|
inline |
Returns the length of the data to be sent or the length of the data received.
|
inline |
Returns the offset of the data to be sent or the offset of the data received.
|
inline |
Returns the port number on the remote host to which this datagram is being sent or from which the datagram was received.
|
inline |
|
inline |
Set the data buffer for this packet.
|
inline |
Set the data buffer for this packet.
|
inline |
Set the length for this packet.
|
inline |
|
protected |
The IP address for this packet.
|
protected |
the data for this packet.
|
protected |
The length of the data for this packet.
|
protected |
The offset of the data for this packet.
|
protected |
The UDP port number of the remote host.


Python/Django Engineering Intern
Responsibilities include:
-
Designing and implementing your own features and/or fixes to GitHub issues
-
Coordinating with our dev team to build the open-source community
-
Reviewing code for style and quality
Experience with the following preferred:
-
Python
-
Django
-
Javascript, jQuery
-
Git
-
User experience and visual design principles.
To apply, you’ll need:
-
A brief cover letter (300 words or less on why you’d like to work with us)
-
A link to your resume or LinkedIn
-
A link to any live projects, past projects, and your GitHub account or online portfolio
Ready to apply?
Fill out an application!


|
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
#include <uuart_reg.h>
Data Fields | |
| __IO uint32_t | CTL |
| __IO uint32_t | INTEN |
| __IO uint32_t | BRGEN |
| __IO uint32_t | DATIN0 |
| __IO uint32_t | CTLIN0 |
| __IO uint32_t | CLKIN |
| __IO uint32_t | LINECTL |
| __IO uint32_t | TXDAT |
| __IO uint32_t | RXDAT |
| __IO uint32_t | BUFCTL |
| __IO uint32_t | BUFSTS |
| __IO uint32_t | PDMACTL |
| __IO uint32_t | WKCTL |
| __IO uint32_t | WKSTS |
| __IO uint32_t | PROTCTL |
| __IO uint32_t | PROTIEN |
| __IO uint32_t | PROTSTS |
@addtogroup UUART UART Mode of USCI Controller(UUART) Memory Mapped Structure for UUART Controller
Definition at line 26 of file uuart_reg.h.
| UUART_T::BRGEN |
[0x0008] USCI Baud Rate Generator Register
| Bits | Field | Descriptions |
| [0] | RCLKSEL | Reference Clock Source Selection
This bit selects the source signal of reference clock (fREF_CLK). 0 = Peripheral device clock fPCLK. 1 = Reserved. |
| [1] | PTCLKSEL | Protocol Clock Source Selection
This bit selects the source signal of protocol clock (fPROT_CLK). 0 = Reference clock fREF_CLK. 1 = fREF_CLK2 (its frequency is half of fREF_CLK). |
| [3:2] | SPCLKSEL | Sample Clock Source Selection
This bit field used for the clock source selection of a sample clock (fSAMP_CLK) for the protocol processor. 00 = fSAMP_CLK = fDIV_CLK. 01 = fSAMP_CLK = fPROT_CLK. 10 = fSAMP_CLK = fSCLK. 11 = fSAMP_CLK = fREF_CLK. |
| [4] | TMCNTEN | Timing Measurement Counter Enable Bit
This bit enables the 10-bit timing measurement counter. 0 = Timing measurement counter is Disabled. 1 = Timing measurement counter is Enabled. |
| [5] | TMCNTSRC | Timing Measurement Counter Clock Source Selection
0 = Timing measurement counter with fPROT_CLK. 1 = Timing measurement counter with fDIV_CLK. |
| [9:8] | PDSCNT | Pre-divider for Sample Counter
This bit field defines the divide ratio of the clock division from sample clock fSAMP_CLK The divided frequency fPDS_CNT = fSAMP_CLK / (PDSCNT+1). |
| [14:10] | DSCNT | Denominator for Sample Counter
This bit field defines the divide ratio of the sample clock fSAMP_CLK. The divided frequency fDS_CNT = fPDS_CNT / (DSCNT+1). Note: The maximum value of DSCNT is 0xF on UART mode and suggest to set over 4 to confirm the receiver data is sampled in right value |
| [25:16] | CLKDIV | Clock Divider
This bit field defines the ratio between the protocol clock frequency fPROT_CLK and the clock divider frequency fDIV_CLK (fDIV_CLK = fPROT_CLK / (CLKDIV+1) ). Note: In UART function, it can be updated by hardware in the 4th falling edge of the input data 0x55 when the auto baud rate function (ABREN(USCI_PROTCTL[6])) is enabled The revised value is the average bit time between bit 5 and bit 6 The user can use revised CLKDIV and new BRDETITV (USCI_PROTCTL[24:16]) to calculate the precise baud rate. |
Definition at line 940 of file uuart_reg.h.
| UUART_T::BUFCTL |
[0x0038] USCI Transmit/Receive Buffer Control Register
| Bits | Field | Descriptions |
| [7] | TXCLR | Clear Transmit Buffer
0 = No effect. 1 = The transmit buffer is cleared (filling level is cleared and output pointer is set to input pointer value) Should only be used while the buffer is not taking part in data traffic. Note: It is cleared automatically after one PCLK cycle. |
| [14] | RXOVIEN | Receive Buffer Overrun Error Interrupt Enable Control
0 = Receive overrun interrupt Disabled. 1 = Receive overrun interrupt Enabled. |
| [15] | RXCLR | Clear Receive Buffer
0 = No effect. 1 = The receive buffer is cleared (filling level is cleared and output pointer is set to input pointer value) Should only be used while the buffer is not taking part in data traffic. Note: It is cleared automatically after one PCLK cycle. |
| [16] | TXRST | Transmit Reset
0 = No effect. 1 = Reset the transmit-related counters, state machine, and the content of transmit shift register and data buffer. Note: It is cleared automatically after one PCLK cycle. |
| [17] | RXRST | Receive Reset
0 = No effect. 1 = Reset the receive-related counters, state machine, and the content of receive shift register and data buffer. Note 1: It is cleared automatically after one PCLK cycle. Note 2: It is suggest to check the RXBUSY (USCI_PROTSTS[10]) before this bit will be set to 1. |
Definition at line 956 of file uuart_reg.h.
| UUART_T::BUFSTS |
[0x003c] USCI Transmit/Receive Buffer Status Register
| Bits | Field | Descriptions |
| [0] | RXEMPTY | Receive Buffer Empty Indicator
0 = Receive buffer is not empty. 1 = Receive buffer is empty. |
| [1] | RXFULL | Receive Buffer Full Indicator
0 = Receive buffer is not full. 1 = Receive buffer is full. |
| [3] | RXOVIF | Receive Buffer Over-run Error Interrupt Status
This bit indicates that a receive buffer overrun error event has been detected If RXOVIEN (USCI_BUFCTL[14]) is enabled, the corresponding interrupt request is activated It is cleared by software writes 1 to this bit. 0 = A receive buffer overrun error event has not been detected. 1 = A receive buffer overrun error event has been detected. |
| [8] | TXEMPTY | Transmit Buffer Empty Indicator
0 = Transmit buffer is not empty. 1 = Transmit buffer is empty. |
| [9] | TXFULL | Transmit Buffer Full Indicator
0 = Transmit buffer is not full. 1 = Transmit buffer is full. |
Definition at line 957 of file uuart_reg.h.
| UUART_T::CLKIN |
[0x0028] USCI Input Clock Signal Configuration Register
| Bits | Field | Descriptions |
| [0] | SYNCSEL | Input Synchronization Signal Selection
This bit selects if the un-synchronized input signal or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. 0 = The un-synchronized signal can be taken as input for the data shift unit. 1 = The synchronized signal can be taken as input for the data shift unit. |
Definition at line 952 of file uuart_reg.h.
| UUART_T::CTL |
[0x0000] USCI Control Register
| Bits | Field | Descriptions |
| [2:0] | FUNMODE | Function Mode
This bit field selects the protocol for this USCI controller Selecting a protocol that is not available or a reserved combination disables the USCI When switching between two protocols, the USCI has to be disabled before selecting a new protocol Simultaneously, the USCI will be reset when user write 000 to FUNMODE. 000 = The USCI is disabled. All protocol related state machines are set to idle state. 001 = The SPI protocol is selected. 010 = The UART protocol is selected. 100 = The I2C protocol is selected. Note: Other bit combinations are reserved. |
Definition at line 938 of file uuart_reg.h.
| UUART_T::CTLIN0 |
[0x0020] USCI Input Control Signal Configuration Register 0
| Bits | Field | Descriptions |
| [0] | SYNCSEL | Input Synchronization Signal Selection
This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. 0 = The un-synchronized signal can be taken as input for the data shift unit. 1 = The synchronized signal can be taken as input for the data shift unit. |
| [2] | ININV | Input Signal Inverse Selection
This bit defines the inverter enable of the input asynchronous signal. 0 = The un-synchronized input signal will not be inverted. 1 = The un-synchronized input signal will be inverted. |
Definition at line 948 of file uuart_reg.h.
| UUART_T::DATIN0 |
[0x0010] USCI Input Data Signal Configuration Register 0
| Bits | Field | Descriptions |
| [0] | SYNCSEL | Input Signal Synchronization Selection
This bit selects if the un-synchronized input signal (with optionally inverted) or the synchronized (and optionally filtered) signal can be used as input for the data shift unit. 0 = The un-synchronized signal can be taken as input for the data shift unit. 1 = The synchronized signal can be taken as input for the data shift unit. |
| [2] | ININV | Input Signal Inverse Selection
This bit defines the inverter enable of the input asynchronous signal. 0 = The un-synchronized input signal will not be inverted. 1 = The un-synchronized input signal will be inverted. |
| [4:3] | EDGEDET | Input Signal Edge Detection Mode
This bit field selects which edge actives the trigger event of input data signal. 00 = The trigger event activation is disabled. 01 = A rising edge activates the trigger event of input data signal. 10 = A falling edge activates the trigger event of input data signal. 11 = Both edges activate the trigger event of input data signal. Note: In UART function mode, it is suggested to set this bit field as 10. |
Definition at line 944 of file uuart_reg.h.
| UUART_T::INTEN |
[0x0004] USCI Interrupt Enable Register
| Bits | Field | Descriptions |
| [1] | TXSTIEN | Transmit Start Interrupt Enable Bit
This bit enables the interrupt generation in case of a transmit start event. 0 = The transmit start interrupt is disabled. 1 = The transmit start interrupt is enabled. |
| [2] | TXENDIEN | Transmit End Interrupt Enable Bit
This bit enables the interrupt generation in case of a transmit finish event. 0 = The transmit finish interrupt is disabled. 1 = The transmit finish interrupt is enabled. |
| [3] | RXSTIEN | Receive Start Interrupt Enable BIt
This bit enables the interrupt generation in case of a receive start event. 0 = The receive start interrupt is disabled. 1 = The receive start interrupt is enabled. |
| [4] | RXENDIEN | Receive End Interrupt Enable Bit
This bit enables the interrupt generation in case of a receive finish event. 0 = The receive end interrupt is disabled. 1 = The receive end interrupt is enabled. |
Definition at line 939 of file uuart_reg.h.
| UUART_T::LINECTL |
[0x002c] USCI Line Control Register
| Bits | Field | Descriptions |
| [0] | LSB | LSB First Transmission Selection
0 = The MSB, which bit of transmit/receive data buffer depends on the setting of DWIDTH, is transmitted/received first. 1 = The LSB, the bit 0 of data buffer, will be transmitted/received first. |
| [5] | DATOINV | Data Output Inverse Selection
This bit defines the relation between the internal shift data value and the output data signal of USCIx_DAT1 pin. 0 = The value of USCIx_DAT1 is equal to the data shift register. 1 = The value of USCIx_DAT1 is the inversion of data shift register. |
| [7] | CTLOINV | Control Signal Output Inverse Selection
This bit defines the relation between the internal control signal and the output control signal. 0 = No effect. 1 = The control signal will be inverted before its output. Note: In UART protocol, the control signal means nRTS signal. |
| [11:8] | DWIDTH | Word Length of Transmission
This bit field defines the data word length (amount of bits) for reception and transmission The data word is always right-aligned in the data buffer USCI support word length from 4 to 16 bits. 0x0: The data word contains 16 bits located at bit positions [15:0]. 0x1: Reserved. 0x2: Reserved. 0x3: Reserved. 0x4: The data word contains 4 bits located at bit positions [3:0]. 0x5: The data word contains 5 bits located at bit positions [4:0]. .. 0xF: The data word contains 15 bits located at bit positions [14:0]. Note: In UART protocol, the length can be configured as 6~13 bits. |
Definition at line 953 of file uuart_reg.h.
| UUART_T::PDMACTL |
[0x0040] USCI PDMA Control Register
| Bits | Field | Descriptions |
| [0] | PDMARST | PDMA Reset
0 = No effect. 1 = Reset the USCI's PDMA control logic. This bit will be cleared to 0 automatically. |
| [1] | TXPDMAEN | PDMA Transmit Channel Available
0 = Transmit PDMA function Disabled. 1 = Transmit PDMA function Enabled. |
| [2] | RXPDMAEN | PDMA Receive Channel Available
0 = Receive PDMA function Disabled. 1 = Receive PDMA function Enabled. |
| [3] | PDMAEN | PDMA Mode Enable Bit
0 = PDMA function Disabled. 1 = PDMA function Enabled. |
Definition at line 958 of file uuart_reg.h.
| UUART_T::PROTCTL |
[0x005c] USCI Protocol Control Register
| Bits | Field | Descriptions |
| [0] | STOPB | Stop Bits
This bit defines the number of stop bits in an UART frame. 0 = The number of stop bits is 1. 1 = The number of stop bits is 2. |
| [1] | PARITYEN | Parity Enable Bit
This bit defines the parity bit is enabled in an UART frame. 0 = The parity bit Disabled. 1 = The parity bit Enabled. |
| [2] | EVENPARITY | Even Parity Enable Bit
0 = Odd number of logic 1's is transmitted and checked in each word. 1 = Even number of logic 1's is transmitted and checked in each word. Note: This bit has effect only when PARITYEN is set. |
| [3] | RTSAUTOEN | nRTS Auto-flow Control Enable Bit
When nRTS auto-flow is enabled, if the receiver buffer is full (RXFULL (USCI_BUFSTS[1] = 1'b1)), the UART will de-assert nRTS signal. 0 = nRTS auto-flow control Disabled. 1 = nRTS auto-flow control Enabled. Note: This bit has effect only when the RTSAUDIREN is not set. |
| [4] | CTSAUTOEN | nCTS Auto-flow Control Enable Bit
When nCTS auto-flow is enabled, the UART will send data to external device when nCTS input assert (UART will not send data to device if nCTS input is dis-asserted). 0 = nCTS auto-flow control Disabled. 1 = nCTS auto-flow control Enabled. |
| [5] | RTSAUDIREN | nRTS Auto Direction Enable Bit
When nRTS auto direction is enabled, if the transmitted bytes in the TX buffer is empty, the UART asserted nRTS signal automatically. 0 = nRTS auto direction control Disabled. 1 = nRTS auto direction control Enabled. Note 1: This bit is used for nRTS auto direction control for RS485. Note 2: This bit has effect only when the RTSAUTOEN is not set. |
| [6] | ABREN | Auto-baud Rate Detect Enable Bit
0 = Auto-baud rate detect function Disabled. 1 = Auto-baud rate detect function Enabled. Note: When the auto - baud rate detect operation finishes, hardware will clear this bit The associated interrupt ABRDETIF (USCI_PROTST[9]) will be generated (If ARBIEN (USCI_PROTIEN [1]) is enabled). |
| [9] | DATWKEN | Data Wake-up Mode Enable Bit
0 = Data wake-up mode Disabled. 1 = Data wake-up mode Enabled. |
| [10] | CTSWKEN | nCTS Wake-up Mode Enable Bit
0 = nCTS wake-up mode Disabled. 1 = nCTS wake-up mode Enabled. |
| [14:11] | WAKECNT | Wake-up Counter
These bits field indicate how many clock cycle selected by fPDS_CNT do the slave can get the 1st bit (start bit) when the device is wake-up from Power-down mode. |
| [24:16] | BRDETITV | Baud Rate Detection Interval
This bit fields indicate how many clock cycle selected by TMCNTSRC (USCI_BRGEN [5]) does the slave calculates the baud rate in one bits The order of the bus shall be 1 and 0 step by step (e.g. the input data pattern shall be 0x55) The user can read the value to know the current input baud rate of the bus whenever the ABRDETIF (USCI_PROTCTL[9]) is set. Note: This bit can be cleared to 0 by software writing '0' to the BRDETITV. |
| [26] | STICKEN | Stick Parity Enable Bit
0 = Stick parity Disabled. 1 = Stick parity Enabled. Note: Refer to RS-485 Support section for detail information. |
| [29] | BCEN | Transmit Break Control Enable Bit
0 = Transmit Break Control Disabled. 1 = Transmit Break Control Enabled. Note: When this bit is set to logic 1, the serial data output (TX) is forced to the Spacing State (logic 0) This bit acts only on TX line and has no effect on the transmitter logic. |
| [31] | PROTEN | UART Protocol Enable Bit
0 = UART Protocol Disabled. 1 = UART Protocol Enabled. |
Definition at line 964 of file uuart_reg.h.
| UUART_T::PROTIEN |
[0x0060] USCI Protocol Interrupt Enable Register
| Bits | Field | Descriptions |
| [1] | ABRIEN | Auto-baud Rate Interrupt Enable Bit
0 = Auto-baud rate interrupt Disabled. 1 = Auto-baud rate interrupt Enabled. |
| [2] | RLSIEN | Receive Line Status Interrupt Enable Bit
0 = Receive line status interrupt Disabled. 1 = Receive line status interrupt Enabled. Note: USCI_PROTSTS[7:5] indicates the current interrupt event for receive line status interrupt. |
Definition at line 965 of file uuart_reg.h.
| UUART_T::PROTSTS |
[0x0064] USCI Protocol Status Register
| Bits | Field | Descriptions |
| [1] | TXSTIF | Transmit Start Interrupt Flag
0 = A transmit start interrupt status has not occurred. 1 = A transmit start interrupt status has occurred. Note 1: It is cleared by software writing one into this bit. Note 2: Used for user to load next transmit data when there is no data in transmit buffer. |
| [2] | TXENDIF | Transmit End Interrupt Flag
0 = A transmit end interrupt status has not occurred. 1 = A transmit end interrupt status has occurred. Note: It is cleared by software writing one into this bit. |
| [3] | RXSTIF | Receive Start Interrupt Flag
0 = A receive start interrupt status has not occurred. 1 = A receive start interrupt status has occurred. Note: It is cleared by software writing one into this bit. |
| [4] | RXENDIF | Receive End Interrupt Flag
0 = A receive finish interrupt status has not occurred. 1 = A receive finish interrupt status has occurred. Note: It is cleared by software writing one into this bit. |
| [5] | PARITYERR | Parity Error Flag
This bit is set to logic 1 whenever the received character does not have a valid 'parity bit'. 0 = No parity error is generated. 1 = Parity error is generated. Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. |
| [6] | FRMERR | Framing Error Flag
This bit is set to logic 1 whenever the received character does not have a valid 'stop bit' (that is, the stop bit following the last data bit or parity bit is detected as logic 0). 0 = No framing error is generated. 1 = Framing error is generated. Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. |
| [7] | BREAK | Break Flag
This bit is set to logic 1 whenever the received data input (RX) is held in the 'spacing state' (logic 0) for longer than a full word transmission time (that is, the total time of start bit + data bits + parity + stop bits). 0 = No Break is generated. 1 = Break is generated in the receiver bus. Note: This bit can be cleared by write '1' among the BREAK, FRMERR and PARITYERR bits. |
| [9] | ABRDETIF | Auto-baud Rate Interrupt Flag
This bit is set when auto-baud rate detection is done among the falling edge of the input data If the ABRIEN (USCI_PROTCTL[6]) is set, the auto-baud rate interrupt will be generated This bit can be set 4 times when the input data pattern is 0x55 and it is cleared before the next falling edge of the input bus. 0 = Auto-baud rate detect function is not done. 1 = One Bit auto-baud rate detect function is done. Note: This bit can be cleared by writing '1' to it. |
| [10] | RXBUSY | RX Bus Status Flag (Read Only)
This bit indicates the busy status of the receiver. 0 = The receiver is Idle. 1 = The receiver is BUSY. |
| [11] | ABERRSTS | Auto-baud Rate Error Status
This bit is set when auto-baud rate detection counter overrun When the auto-baud rate counter overrun, the user shall revise the CLKDIV (USCI_BRGEN[25:16]) value and enable ABREN (USCI_PROTCTL[6]) to detect the correct baud rate again. 0 = Auto-baud rate detect counter is not overrun. 1 = Auto-baud rate detect counter is overrun. Note 1: This bit is set at the same time of ABRDETIF. Note 2: This bit can be cleared by writing '1' to ABRDETIF or ABERRSTS. |
| [16] | CTSSYNCLV | nCTS Synchronized Level Status (Read Only)
This bit used to indicate the current status of the internal synchronized nCTS signal. 0 = The internal synchronized nCTS is low. 1 = The internal synchronized nCTS is high. |
| [17] | CTSLV | nCTS Pin Status (Read Only)
This bit used to monitor the current status of nCTS pin input. 0 = nCTS pin input is low level voltage logic state. 1 = nCTS pin input is high level voltage logic state. |
Definition at line 966 of file uuart_reg.h.
| UUART_T::RXDAT |
[0x0034] USCI Receive Data Register
| Bits | Field | Descriptions |
| [15:0] | RXDAT | Received Data
This bit field monitors the received data which stored in receive data buffer. Note: RXDAT[15:13] indicate the same frame status of BREAK, FRMERR and PARITYERR (USCI_PROTSTS[7:5]). |
Definition at line 955 of file uuart_reg.h.
| UUART_T::TXDAT |
[0x0030] USCI Transmit Data Register
| Bits | Field | Descriptions |
| [15:0] | TXDAT | Transmit Data
Software can use this bit field to write 16-bit transmit data for transmission. |
Definition at line 954 of file uuart_reg.h.
| UUART_T::WKCTL |
[0x0054] USCI Wake-up Control Register
| Bits | Field | Descriptions |
| [0] | WKEN | Wake-up Enable Bit
0 = Wake-up function Disabled. 1 = Wake-up function Enabled. |
| [2] | PDBOPT | Power Down Blocking Option
0 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, MCU will stop the transfer and enter Power-down mode immediately. 1 = If user attempts to enter Power-down mode by executing WFI while the protocol is in transferring, the on-going transfer will not be stopped and MCU will enter idle mode immediately. |
Definition at line 962 of file uuart_reg.h.
| UUART_T::WKSTS |
[0x0058] USCI Wake-up Status Register
| Bits | Field | Descriptions |
| [0] | WKF | Wake-up Flag
When chip is woken up from Power-down mode, this bit is set to 1 Software can write 1 to clear this bit. |
Definition at line 963 of file uuart_reg.h.


potential virus outbreak Ebola stage haemorrhagic disease epidemic Health {border-style data admin px;} #ffffff;} collab: fever locations regions risk Marburg National disease, index Africa Crimean–Congo districts environmental spread subnational (eg, stages viral Stage analysis framework infectious international local potential, spillover at-risk fever, outbreaks pandemic used existing health highest index-case receptivity zoonotic × Lassa factors information national response study suitability time transmission case cases future global key pathogens populations quintile rank ranked values widespread (figure African Data Global World maps preparedness px; rankings units using variation western {font-family (stage Africa, Institute Med Soc South Trop based composite emerging final font-size geographic human indicator median niche possible secondary work (grant International Metrics Republic Wellcome areas assessing assessment assessments connectivity continued double; evaluated funded highly however, identified identify important included likely population previous proactive provide ranking records regional travel uncertainty Congo Democratic Dise Gates June Melinda Nigeria Risk Sudan administrative analyses analysis, approaches assessed available available. border-color border-width capacity covariate covariates different disease), establish focus geometric greatest high identification inform infrastructure initial nearest new occurrence particularly pathogen similar solid; source spatial specific supported susceptible use vulnerabilities {font-style {font-weight (%), (ie, (supplementary Bank DMP, Department Development Disease Figure Foundation IHME Infect Negl OPP, SIH Sci Trust absence allow allows assess assistance better bold coloured component considered contributed courier; developed differences diseases distribution drivers effective em; estimates evaluate funding grant highlights improved instance, level localised locations, methods middle modelling number online outbreaks, people places populations, previously progression pt;} quantified reflect resources row) scale standardised subsequent surveillance transition transmission. trends unit value


This tutorial shows you ways in which muppy can be used to track down memory leaks. From my experience, this can be done in 3 steps, each answering a different question.
My first real-life test for muppy was IDLE, which is “the Python IDE built with the Tkinter GUI toolkit.” It offers the following features:
Because it is integrated in every Python distribution, runs locally and provides easy interactive feedback, it was a nice first candidate to test the tools of muppy.
The task was to check if IDLE leaks memory, if so, what objects are leaking, and finally, why are they leaking.
IDLE is part of every Python distribution and can be found at Lib/idlelib. The modified version which makes use of muppy can be found at http://code.google.com/p/muppy/source/browse/trunk#trunk/playground/idlelib.
With IDLE having a GUI, I also wanted to be able to interact with muppy through the GUI. This can be done in Lib/idlelib/Bindings.py and Lib/idlelib/PyShell.py. For details, please refer to the modified version mentioned above.
At first, we need to find out if there are any objects leaking at all. We will have a look at the objects, invoke an action, and look at the objects again.
from pympler import tracker
self.memory_tracker = tracker.SummaryTracker()
self.memory_tracker.print_diff()
The last step is repeated after each invocation. Let’s start with something simple which should not leak. We will check the Windows resize. You can invoke it in the menu at Windows->Zoom Height.
At first call print_diff till it has calibrated. That is, the first one or two times, you will get some output because there is still something going on in the background. But then you should get this:
types | # objects | total size
====== | =========== | ============
Which means nothing has changed since the last invocation of print_diff. Now let’s call Windows->Zoom Height and invoke print_diff again.:
types | # objects | total size
================== | =========== | ============
dict | 1 | 280 B
list | 1 | 176 B
_sre.SRE_Pattern | 1 | 88 B
tuple | 1 | 80 B
str | 0 | 7 B
Seems as this requires some of the above mentioned objects. Let’s repeat it.:
types | # objects | total size
====== | =========== | ============
Okay, nothing changed, so nothing is leaking. But we see that often, the first call to a function creates some objects, which then exist on a second invocation.
Next, we try something different. We will open a new window. Let’s have a look at the Path Browser at File->Path Browser.:
types | # objects | total size
===================================================== | =========== | ============
dict | 18 | 14.26 KB
tuple | 146 | 13.17 KB
list | 2 | 11.67 KB
str | 97 | 7.85 KB
code | 46 | 5.52 KB
function | 45 | 5.40 KB
classobj | 9 | 864 B
instancemethod (<function wakeup>) | 3 | 240 B
instancemethod (<function __call__>) | 3 | 240 B
instance(<class Tkinter.CallWrapper>) | 3 | 216 B
module | 3 | 168 B
instance(<class idlelib.WindowList.ListedToplevel>) | 1 | 72 B
Let’s repeat it.:
types | # objects | total size
===================================================== | =========== | ============
dict | 5 | 2.17 KB
list | 0 | 384 B
str | 5 | 259 B
instancemethod (<function wakeup>) | 3 | 240 B
instancemethod (<function __call__>) | 3 | 240 B
instance(<class Tkinter.CallWrapper>) | 3 | 216 B
instance(<class idlelib.WindowList.ListedToplevel>) | 1 | 72 B
Mh, still some new objects. Repeating this procedure several times will reveal that here indeed we have a leak.
So let’s have a closer look at the diff. We see 5 new dicts and strings, a bit more memory usage by lists, 3 wakeup and __call__ instance methods, 3 CallWrapper and 1 ListedToplevel. We know the standard types, but the last couple of objects seem to be from IDLE.
We ignore the standard type objects for now. It is more likely that these are only children of some other instances which are causing the leak.
We start with the ListedTopLevel object. One invocation of File->Path Browser and one more of this type looks like this object is not garbage collected, although it should have been. Searching for ListedTopLevel in idlelib/ reveals that is the base class to all window objects of IDLE. We can assume that opening the Path Browser, a new window object is created, but closing the window does not remove the reference.
Next, we take a look at the wakeup instance method of which we have three more on each invocation. Searching the code, we find it to be defined in idlelib/WindowList.py. This piece of code is used to give users of IDLE a list of currently open windows. Every time a new window is created, it will be added to the Windows menu, from where the user can select any open window. wakeup is the method which will bring the selected window up front. Adding a window calls menu.add_command, linking menu and the wakeup command together.
So we are getting closer. Only __call__ and Tkinter.CallWrapper are left. As the name indicates, the latter is located in the Tkinter module, which is part of the standard library of Python. So let’s dive into it. The CallWrapper docstring states:
Internal class. Stores function to call when some user defined Tcl function is
called e.g. after an event occurred.
Also, CallWrapper contains a method called __call__, which is used to invoke the stored function call. A CallWrapper is created by the method _register which then creates a command (Tk speak) and adds it’s name to a list called self._tclCommands.
So what do we know so far? Every time a Path Browser is opened, a window is created, but not deleted when closed again. It has something to do with the wakeup method of the window. This method is wrapped as a Tcl command and then linked to the window list menu. Also, we have traced this wrapping back to Tkinter library, where names of the function wrappers are stored in a attribute called _tclCommands.
This brings us to the third question.
_tclCommands stores the names of all commands linked to a widget. The base class for interior widgets (of which the menu is one), has a method called destroy which:
Delete all Tcl commands created for this widget in the Tcl
interpreter.
as well as a method deletecommand which deletes a single Tcl command. Both remove commands as by there name. Among them, we find our CallWrappers’ __call__ used to wrap the wakeup of the Path Browser window.
So we should expect at least either one to be invoked when a window is closed (best would be the invocation of only deletecommand). This would also go in line with menu.add_command we identified above. And indeed, in idlelib/EditorWindow.py, menu.delete is called. So where is the problem?
We return to Tkinter.py and have a closer look at delete method:
def delete(self, index1, index2=None):
"""Delete menu items between INDEX1 and INDEX2 (not included)."""
self.tk.call(self._w, 'delete', index1, index2)
Mh, it looks like the menu item is deleted, but what about the attached command? Let’s ask the Web for “tkinter deletecommand”. Turns out that somebody some years ago filed a bug (see bugreport) which states:
Tkinter.Menu.delete does not delete the commands
defined for the entries it deletes. Those objects
will be retained until the menu itself is deleted.
[..]
the command function will still be referenced and
kept in memory - until the menu object itself is
destroyed.
Well, this seems to be the root of our memory leak. Let’s adapt the delete method a bit, so that the associated commands are deleted as well:
def delete(self, index1, index2=None):
"""Delete menu items between INDEX1 and INDEX2 (not included)."""
if index2 is None:
index2 = index1
cmds = []
(num_index1, num_index2) = (self.index(index1), self.index(index2))
if (num_index1 is not None) and (num_index2 is not None):
for i in range(num_index1, num_index2 + 1):
if 'command' in self.entryconfig(i):
c = str(self.entrycget(i, 'command'))
if c in self._tclCommands:
cmds.append(c)
self.tk.call(self._w, 'delete', index1, index2)
for c in cmds:
self.deletecommand(c)
Now we restart IDLE, calibrate our tracker and do another round of print_diff. After the first time the Path Browser is opened we get this:
types | # objects | total size
========== | =========== | ============
tuple | 146 | 13.17 KB
dict | 13 | 12.01 KB
list | 2 | 11.26 KB
str | 92 | 7.59 KB
code | 46 | 5.52 KB
function | 45 | 5.40 KB
classobj | 9 | 864 B
module | 3 | 168 B
Okay, still some objects created, but no more instances and instance methods. Let’s do it again.:
types | # objects | total size
======= | =========== | ============
Yes, this looks definitely better. The memory leak is gone.
The problem is fixed for Python versions 2.5 and higher so updated installations will not face this leak.


Introduction to Sensu
"Sensu intends to provide an open framework for building comprehensive monitoring solutions, without imposing restrictions or being overly opinionated." Sensu is an open source project that is watched over by Sean Porter and the team at Heavy Water Ops.
Why Sensu?
There are lots of tools in the monitoring space.
So why pick Sensu? Because those SaaS solutions have external dependencies on publishing agent data to them.Sensu can run on your network, keeping your data to yourself, live behind a firewall, and not rack up monthly charges to the SaaS provider. Plus, you can run it all locally on a laptop for testing and validation.
Installing Sensu
Sensu is a Ruby app/gem. It runs on Linux and Windows. It has a dependency on RabbitMQ and Redis for the server components. As such, there is a Chef cookbook or Puppet module to install Sensu and get all dependencies installed as well.
Alternatively, you can just use a Docker container with Sensu installed, like arcus/sensu.
Extending Sensu
What makes Jenkins great?
What also makes Sensu great?
THE PLUGINS! - or more specifically - the plugins.
What is even better? Sensu has been developed from the start to use all the Nagios monitors you've probably got laying around. So don't waste the effort it took to develop them. Just use them on a nicer platform!
Workout
We are going to complete the following actions with Sensu
- Get in the
sensu
directory of our app andvagrant up
our trusty VM - Start up a Sensu server using a Docker container.
sudo docker run -d -p 8090:8080 -p 4567:4567 arcus/sensu
- Install the Sensu package on the VM (which is running Ubuntu) so it will become a Sensu Agent.
- Enable and start the Agent as a service on the VM.
- Start up Jenkins on the VM, same as how you did before.
- Get the
check-jenkins.rb
from the Jenkins plugins for Sensu - Install it as a Sensu Check on the VM
- View the Sensu Dashboard
- Stop Jenkins
ctrl-c
and watch the Sensu Dashboard again


Glyn Webster has been reading How I Found Livingstone by Henry M Stanley, and sends this splendid extract:
Mpwapwa, though the traveller from the coast will feel grateful for the milk it furnished after being so long deprived of it, will be kept in mind as a most remarkable place for earwigs. In my tent they might be counted by thousands; in my slung cot they were by hundreds; on my clothes they were by fifties; on my neck and head they were by scores. The several plagues of locusts, fleas, and lice sink into utter insignificance compared with this fearful one of earwigs. It is true they did not bite, and they did not irritate the cuticle, but what their presence and numbers suggested was something so horrible that it drove one nearly insane to think of it. Who will come to East Africa without reading the experiences of Burton and Speke? Who is he that having read them will not remember with horror the dreadful account given by Speke of his encounters with these pests? My intense nervous watchfulness alone, I believe, saved me from a like calamity.
Mr Webster adds:
I haven't been able to learn more! Not of Burton and Speke's earwig experiences nor the nature of unnamed horror a plague of earwigs implies.
I am going to embark on further research myself, but in the meantime if any reader knows what Stanley is getting all worked up about please leave a note in the Comments.


Command Shell
Enter a shell command to execute in the text field below. The cd command may be used to change directory for subsequent commands.
Warning:
You need to have a good knowledge of Linux commands before you can use the commends effectively.
Module Config
Execute Command
Command: