mirror of
https://github.com/vidarh/ruby-x11
synced 2024-12-27 09:59:21 +01:00
14 lines
384 B
Ruby
14 lines
384 B
Ruby
require 'rubygems'
|
|
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
|