Skip to content

Commit

Permalink
Support the new plugin API (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
guedou authored and radare committed Apr 6, 2017
1 parent ea05bf1 commit 072dd8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rust-asm6502/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use libc::*;
use std::ffi::CString;

const MY_NAME : *const c_char = b"6502.rs\0" as *const [u8] as *const c_char;
const R2_VERSION: &'static [u8] = b"1.2.0-git\0";
const R2_VERSION: &'static [u8] = b"1.4.0-git\0";
const MY_ARCH : &'static [u8] = b"6502\0";
const MY_DESC : &'static [u8] = b"6502 disassembler in Rust\0";
const MY_LICENSE : &'static [u8] = b"MIT\0";
const MY_AUTHOR : &'static [u8] = b"radare";

// order matters because of libr/util/lib.c
#[repr(C,i32)]
Expand All @@ -35,6 +36,8 @@ pub enum RLibType {
pub struct RAsmPlugin {
name: *const c_char,
arch: *const c_char,
author: *const c_char,
version: *const c_char,
cpus: *const c_char,
desc: *const c_char,
license: *const c_char, //c_char,
Expand Down Expand Up @@ -149,6 +152,8 @@ extern "C" fn _set_subarch (asm: *const c_void, arch: *const c_char) -> c_int {
const r_asm_plugin_6502rs: RAsmPlugin = RAsmPlugin {
name : MY_NAME,
arch : MY_ARCH as *const [u8] as *const c_char,
author : MY_AUTHOR as *const [u8] as *const c_char,
version : MY_NAME,
license : MY_LICENSE as *const [u8] as *const c_char,
user : 0,
cpus : b"\0" as *const [u8] as *const c_char,
Expand Down

0 comments on commit 072dd8d

Please sign in to comment.