All pastes #98275 Raw Edit

Something

public c v1 · immutable
#98275 ·published 2006-07-24 12:31 UTC
rendered paste body
Right now I have to domake bin/pnic--test.dskWhich I don't very much like, any suggestions?---- commandline/commands/test.c ----#include "command.h"static int cmd_test_exec ( cmd_line* cmd, int argc, char **argv ) {        cmdl_printf(cmd, "Woogah!\n");        return 0;}struct command test_command __command = {        .name = "test",        .usage = "The test command\nIt does nothing at all",        .desc = "Does nothing",        .exec = cmd_test_exec,};---- include/command.h ----#ifndef COMMAND_H#define COMMAND_H#include "cmdlinelib.h"#include <gpxe/tables.h>struct command {        const char *name;                                       // The name of the command        const char *usage;                                      // Description of how to use the command        const char *desc;                                       // Short description of the command        int ( *exec ) ( cmd_line* cmd, int argc, char **argv);          // The command function, returns an error code, takes command line pointer and params specified in param_list};#define __command __table ( commands, 01 )#endif---- snippet from  commandline/cmdlinelib.c ----        /* List the commands */        struct command *cmd;        for ( cmd = cmd_start ; cmd < cmd_end ; cmd++ ) {                printf ( "<DEBUG> Compiled in command: \"%s\"\n", cmd->name );        }