File: GLib-Bytes.lua

package info (click to toggle)
lua-lgi 0.9.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,388 kB
  • sloc: ansic: 5,082; makefile: 169; sh: 31
file content (22 lines) | stat: -rw-r--r-- 696 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
------------------------------------------------------------------------------
--
--  lgi GLib Bytes support
--
--  Copyright (c) 2013 Pavel Holejsovsky
--  Licensed under the MIT license:
--  http://www.opensource.org/licenses/mit-license.php
--
------------------------------------------------------------------------------

local select, type, pairs, tostring, setmetatable, error, assert
   = select, type, pairs, tostring, setmetatable, error, assert

local lgi = require 'lgi'
local GLib = lgi.GLib
local Bytes = GLib.Bytes

-- Define length querying operation.
Bytes._len = Bytes.get_size

-- Add support for querying bytes attribute
Bytes._attribute = { data = { get = Bytes.get_data } }