Sha256: 0a4e8f54f1c953e009d05de8829fed298c796ed386a9a9859398c7408e3da103

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

#include "FileMonitor.h"

VALUE	FileMonitor_from_FridaFileMonitor(FridaFileMonitor *handle)
{
    VALUE self;

    if (!handle)
        return (Qnil);
    self = rb_class_new_instance(0, NULL, cFileMonitor);
    GET_GOBJECT_DATA();
    d->handle = handle;
    d->destroy = frida_unref;
    return (self);
}

GVL_FREE_PROXY_FUNC(enable_sync, void *handle)
{
    GError *gerr = NULL;

    frida_file_monitor_enable_sync(handle, NULL, &gerr);
    RETURN_GVL_FREE_RESULT(NULL);
}

/*
    call-seq:
        #enable() -> nil
*/
static VALUE FileMonitor_enable(VALUE self)
{
    GET_GOBJECT_DATA();
    REQUIRE_GOBJECT_HANDLE();

    CALL_GVL_FREE_WITH_RET(void *dummy, enable_sync, d->handle);
    return (Qnil);

    GERROR_BLOCK
}

GVL_FREE_PROXY_FUNC(disable_sync, void *handle)
{
    GError *gerr = NULL;

    frida_file_monitor_disable_sync(handle, NULL, &gerr);
    RETURN_GVL_FREE_RESULT(NULL);
}

/*
    call-seq:
        #disable() -> nil
*/
static VALUE FileMonitor_disable(VALUE self)
{
    GET_GOBJECT_DATA();
    REQUIRE_GOBJECT_HANDLE();

    CALL_GVL_FREE_WITH_RET(void *dummy, disable_sync, d->handle);
    return (Qnil);

    GERROR_BLOCK
}

void	define_FileMonitor()
{
    cFileMonitor = rb_define_class_under(mCFrida, "FileMonitor", cGObject);
    rb_define_method(cFileMonitor, "enable", FileMonitor_enable, 0);
    rb_define_method(cFileMonitor, "disable", FileMonitor_disable, 0);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
frida-0.1.1 ext/c_frida/FileMonitor.c