Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The source isn't that big, I just downloaded 2.21 source and it is one directory with about ~45 files, and the majority of bytes are for /doc/dvi binaries, only 5 c files and a post Yacc'd tab file for parsing the units definitions file. Surprisingly simple now that I look at it.

Heck... I was going ask you to write it, but now I'm thinking this could be a fun weekend project.

I can see one function in that library:

    bool convert(const char *from, const char *to, double input, double *output);
No need to make it more complex for starters. If you want to make an .hxx Boost-like class around it, that's outta my league!

EDIT: markdown help

EDIT: added a status return instead of val return to check for conversion correctness (bool is newer C)



> (...how the heck do I make a literal asterisk in HN markdown?)

Spaces on both sides: const char * from

But also you are supposed to mark up code by indenting with four spaces, and then everything will be treated as verbatim text:

    const char *from




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: