We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Might be useful told hold an enum value in arg_hdr to have the ability to cast back from void*.
arg_hdr
void*
The text was updated successfully, but these errors were encountered:
I implemented this in my code. It's kinda gross but looks like this essentially:
enum arg_type { ARG_LITERAL, ARG_STRING, ARG_INTEGER, ARG_END };
...
void *arg_table[] = { help, dump_args, base_url, app_dir, temp_dir, pids, end }; /* We need type information to dump parameters generically */ enum arg_type arg_table_types[] = { ARG_LITERAL, ARG_LITERAL, ARG_STRING, ARG_STRING, ARG_STRING, ARG_INTEGER, ARG_END }; if (dump_args->count > 0) { for (int i = 0; i < arg_table_sz; ++i) { const arg_type type = arg_table_types[i]; switch (type) { case ARG_LITERAL: print_literal_arg((struct arg_lit*)arg_table[i]); break; case ARG_STRING: print_string_arg((struct arg_str*)arg_table[i]); break; case ARG_INTEGER: print_integer_arg((struct arg_int*)arg_table[i]); break; case ARG_END: print_end_arg((struct arg_end*)arg_table[i]); break; } } }
this let's me generically print each argument and their values.
Sorry, something went wrong.
You can try the information in const char* arg_hdr::datatype.
const char* arg_hdr::datatype
tomghuang
No branches or pull requests
Might be useful told hold an enum value in
arg_hdr
to have the ability to cast back fromvoid*
.The text was updated successfully, but these errors were encountered: