#![feature(lang_items)]
#![feature(start)]
#![feature(no_std)]
#![no_std]

extern crate libc;

pub mod hex;

#[start]
fn start(argc: isize, argv: *const *const u8) -> isize {
    let mut buffer: [u8; 64] = [0; 64];
    let mut out: [u8; 129] = [0; 129];
    out[128] = 0;
    loop {
        let read = unsafe{ libc::read(libc::STDIN_FILENO, buffer.as_mut_ptr() as _, 64) }; //input.read(&mut buffer);

        hex::create_line(&buffer, &mut out, 0);
        unsafe { libc::puts(out.as_ptr() as *const _); }
    }
}