ruby-x11/lib/X11.rb
2012-03-08 21:51:31 -08:00

13 lines
365 B
Ruby

require 'socket'
require 'active_support'
require 'hexdump'
require 'X11/protocol'
require 'X11/auth'
require 'X11/display'
module X11
# Return a format string, suitable for pack(), for a string padded to a multiple
# of 4 bytes. For instance, C<pack(padded('Hello'), 'Hello')> gives
# C<"Hello\0\0\0">.
def self.pad(x); x + "\0"*(-x.length & 3); end
end