Skip to content

Move most of the logic from main into functions? #19

@kaushalmodi

Description

@kaushalmodi

Hello,

I am using the Nim language (https://nim-lang.org) which interfaces with C language seamlessly.

I'd like to use your project as a library where the input is a pointer to array of strings (and all the smenu options) and output is an another pointer to an array of strings.

Would it be possible for you to pack the core of smenu into such function whose API you provide via smenu.h?

In main, you then probably just parse the command line switches and pass the appropriate args to the smenu function.

Thoughts?


PS: I started with wrapping the smenu.h here, but then realized that I cannot do much with it as most of the smenu code is inline in the main.

To use smenu via Nim, I'd then need to literally translate all the C code to Nim manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions