mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-22 23:31:26 +00:00

* Remove debug stuff from r_bin * Remove outdated r_array stuff from r_util vapi * Minor fixup in r_bin vapi
116 lines
3.5 KiB
Vala
116 lines
3.5 KiB
Vala
/* radare - LGPL - Copyright 2009 pancake<@nopcode.org> */
|
|
|
|
//[Compact]
|
|
//[CCode (cheader_filename="r_util.h", cprefix="r_util_")]
|
|
//public static class Radare.RUtil {
|
|
//public static int hex_str2bin (string input, uint8 *buf);
|
|
//public static int hex_bin2str (uint8 *buf, int len, out string str);
|
|
//public static string hex_bin2strdup (uint8 *buf, int len);
|
|
/* mem */
|
|
//public static uint8 *mem_mem (uint8 *a, int al, uint8 *b, int bl);
|
|
//public static void mem_copyendian (uint8 *dest, uint8 *orig, int size, int endian);
|
|
//public static void mem_copyloop (uint8 *dest, uint8 *orig, int dsize, int osize);
|
|
//public static void mem_cmp_mask (uint8 *dest, uint8 *orig, uint8 *mask, int len);
|
|
/* num */
|
|
//public static uint64 num_get(void *num, string str); // XXX void *
|
|
//public static int offsetof(void *type, void *member);
|
|
//}
|
|
|
|
// ??? wtf
|
|
[CCode (cheader_filename="r_util.h", cprefix="r_str_")]
|
|
public static class RString {
|
|
public RString();
|
|
public int hash(string str);
|
|
}
|
|
|
|
[CCode (cheader_filename="r_util.h", cprefix="r_num_")]
|
|
public static class RNum {
|
|
public RNum(RNumCallback cb, void *user);
|
|
public uint64 get(string str);
|
|
public uint64 math(string str);
|
|
}
|
|
public delegate uint64 RNumCallback (RNum num, string str, int *ok);
|
|
|
|
[CCode (cheader_filename="r_util.h", cprefix="r_log_")]
|
|
public static class RLog {
|
|
public bool msg(string str);
|
|
public bool err(string str);
|
|
}
|
|
|
|
[Compact]
|
|
[CCode (cname="RBuffer", cheader_filename="r_util.h", cprefix="r_buf_")]
|
|
public class RBuffer {
|
|
public RBuffer();
|
|
public int read_at(uint64 addr, uint8 *buf, int len);
|
|
public int write_at(uint64 addr, uint8 *buf, int len);
|
|
public bool set_bytes(uint8 *buf, int len);
|
|
//public bool memcpy(uint64 addr, uint8 *dst, uint8 *src, int len);
|
|
/* ... */
|
|
}
|
|
|
|
/* Generic Iterator interfaced with r_array */
|
|
[CCode (cprefix="r_array_", cheader_filename="r_array.h", cname="void*")]
|
|
public static class RArray<G> {
|
|
[CCode (cname="r_array_iterator")]
|
|
public RArray<G> iterator();
|
|
[CCode (cname="r_array_unref")]
|
|
public void unref(G *arg);
|
|
[CCode (cname="r_array_next")]
|
|
public bool next();
|
|
[CCode (cname="r_array_get")]
|
|
public unowned G @get();
|
|
}
|
|
|
|
#if 0
|
|
/* TODO: to be removed. not fully compliant */
|
|
[Compact]
|
|
[CCode (cprefix="ralist_", cheader_filename="r_types.h,list.h", cname="struct list_head")]
|
|
public class KernelList<G> {
|
|
public KernelList ();
|
|
[CCode (cname="ralist_next")]
|
|
public bool next();
|
|
[CCode (cname="ralist_append")]
|
|
public void append(owned G foo);
|
|
[CCode (cname="")]
|
|
public G @free(G arg);
|
|
[CCode (cname="ralist_get", generic_type_pos=2)]
|
|
public unowned G get();
|
|
[CCode (cname="ralist_iterator")]
|
|
public KernelList<G> iterator();
|
|
}
|
|
#endif
|
|
|
|
[Compact]
|
|
[CCode (cprefix="r_list_", cheader_filename="r_util.h", cname="struct r_list_t")]
|
|
public class RList<G> {
|
|
public RList ();
|
|
public void append(owned G foo);
|
|
public void prepend(owned G foo);
|
|
//public unowned G get();
|
|
//public rListIter<G> iterator();
|
|
}
|
|
|
|
[Compact]
|
|
[CCode (cprefix="r_list_iter_", cheader_filename="r_list.h", cname="struct r_list_iter_t")]
|
|
public class RListIter<G> {
|
|
public bool next();
|
|
// public G @free(G arg);
|
|
public unowned G get();
|
|
}
|
|
|
|
/* TODO: deprecated by r_iter ??? */
|
|
/*
|
|
[Compact]
|
|
[CCode (cprefix="rarray_", cheader_filename="r_types.h", cname="void")]
|
|
public static class rArray<G> {
|
|
[CCode (cname="rarray_next", generic_type_pos=2)]
|
|
public bool next(); //int type=0);
|
|
[CCode (cname="")]
|
|
public G @free(G arg);
|
|
[CCode (cname="rarray_get", generic_type_pos=2)]
|
|
public unowned G get(); //int type=0);
|
|
[CCode (cname="rarray_iterator")] //, generic_type_pos=2)]
|
|
public rArray<G> iterator();
|
|
}
|
|
*/
|