2009-08-21 19:09:48 +00:00
|
|
|
/* radare - LGPL - Copyright 2009 pancake<@nopcode.org> */
|
2009-03-10 01:49:24 +00:00
|
|
|
|
|
|
|
[CCode (cheader_filename="r_util.h", cprefix="r_util_", lower_case_cprefix="r_util_")]
|
|
|
|
namespace Radare {
|
|
|
|
[Compact]
|
|
|
|
[CCode (cprefix="r_")]
|
|
|
|
public static class Util {
|
2009-07-27 12:22:08 +00:00
|
|
|
public static int hex_str2bin (string input, uint8 *buf);
|
2009-07-24 13:38:53 +00:00
|
|
|
//public static int hex_bin2str (uint8 *buf, int len, out string str);
|
|
|
|
public static string hex_bin2strdup (uint8 *buf, int len);
|
2009-07-16 00:30:20 +00:00
|
|
|
/* mem */
|
2009-07-16 13:08:23 +02:00
|
|
|
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 *
|
2009-07-22 17:30:21 +02:00
|
|
|
//public static int offsetof(void *type, void *member);
|
2009-03-10 01:49:24 +00:00
|
|
|
}
|
|
|
|
|
2009-09-08 02:14:19 +00:00
|
|
|
// ???
|
|
|
|
[CCode (cprefix="r_str")]
|
|
|
|
public static class Str {
|
|
|
|
public Str();
|
2009-09-15 00:06:37 +02:00
|
|
|
public int hash(string str);
|
2009-09-08 02:14:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[CCode (cprefix="r_buf")]
|
|
|
|
public class Buffer {
|
|
|
|
public Buffer();
|
|
|
|
public int read(uint64 addr, uint8 *buf, int len);
|
|
|
|
/* ... */
|
|
|
|
}
|
|
|
|
|
2009-08-21 19:09:48 +00:00
|
|
|
/* Generic Iterator interfaced with r_iter */
|
2009-09-03 11:17:00 +00:00
|
|
|
[Compact]
|
|
|
|
[CCode (cprefix="r_iter_", cname="void")]
|
2009-09-05 23:58:02 +00:00
|
|
|
public class Iter<G> {
|
|
|
|
public Iter (int size);
|
2009-09-03 11:17:00 +00:00
|
|
|
public unowned G get ();
|
2009-09-05 23:58:02 +00:00
|
|
|
public unowned Iter<G> next ();
|
|
|
|
public unowned Iter<G> next_n (int idx);
|
2009-09-03 11:17:00 +00:00
|
|
|
public unowned G prev ();
|
|
|
|
public void delete ();
|
|
|
|
public unowned G first ();
|
|
|
|
public bool last ();
|
|
|
|
// TODO: foreach()
|
|
|
|
public unowned G free ();
|
|
|
|
public void set (int idx, owned G data);
|
|
|
|
}
|
2009-09-05 23:58:02 +00:00
|
|
|
|
|
|
|
[Compact]
|
2009-09-15 13:24:28 +02:00
|
|
|
[CCode (cprefix="ralist_", cheader_filename="list.h", cname="struct list_head")]
|
2009-09-15 00:06:37 +02:00
|
|
|
public static class List<G> {
|
2009-09-05 23:58:02 +00:00
|
|
|
[CCode (cname="ralist_next")]
|
|
|
|
public bool next();
|
|
|
|
[CCode (cname="")]
|
|
|
|
public G @free(G arg);
|
2009-09-15 02:18:19 +02:00
|
|
|
[CCode (cname="ralist_get", generic_type_pos=2)]
|
2009-09-15 00:06:37 +02:00
|
|
|
public unowned G get();
|
2009-09-15 02:18:19 +02:00
|
|
|
[CCode (cname="ralist_iterator")]
|
2009-09-15 00:06:37 +02:00
|
|
|
public List<unowned G> iterator();
|
2009-09-05 23:58:02 +00:00
|
|
|
}
|
2009-09-22 13:27:33 +02:00
|
|
|
|
2009-09-24 12:29:05 +02:00
|
|
|
/*
|
|
|
|
[Compact]
|
|
|
|
[CCode (cprefix="rarray_", cheader_filename="r_types.h", cname="rarray_t")]
|
|
|
|
public static struct RarrayFoo<G> {
|
|
|
|
[CCode (cname="rarray_next", generic_type_pos=2)]
|
|
|
|
public bool next();
|
|
|
|
[CCode (cname="")]
|
|
|
|
public G @free(G arg);
|
|
|
|
[CCode (cname="rarray_get", generic_type_pos=2)]
|
|
|
|
public unowned G get();
|
|
|
|
[CCode (cname="rarray_iterator")] //, generic_type_pos=2)]
|
|
|
|
public RarrayFoo<G> iterator();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2009-09-22 13:27:33 +02:00
|
|
|
[Compact]
|
2009-09-22 19:23:49 +02:00
|
|
|
[CCode (cprefix="rarray_", cheader_filename="r_types.h", cname="void")]
|
2009-09-22 13:27:33 +02:00
|
|
|
public static class Rarray<G> {
|
2009-09-22 19:23:49 +02:00
|
|
|
[CCode (cname="rarray_next", generic_type_pos=2)]
|
2009-09-22 13:27:33 +02:00
|
|
|
public bool next();
|
|
|
|
[CCode (cname="")]
|
|
|
|
public G @free(G arg);
|
2009-09-22 19:23:49 +02:00
|
|
|
[CCode (cname="rarray_get", generic_type_pos=2)]
|
2009-09-22 13:27:33 +02:00
|
|
|
public unowned G get();
|
2009-09-24 12:29:05 +02:00
|
|
|
[CCode (cname="rarray_iterator")] //, generic_type_pos=2)]
|
|
|
|
public Rarray<G> iterator();
|
2009-09-22 13:27:33 +02:00
|
|
|
}
|
2009-09-03 11:17:00 +00:00
|
|
|
}
|