Subversion Repositories HelenOS-historic

Rev

Rev 510 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 510 Rev 517
Line 27... Line 27...
27
 */
27
 */
28
 
28
 
29
#ifndef __KCONSOLE_H__
29
#ifndef __KCONSOLE_H__
30
#define __KCONSOLE_H__
30
#define __KCONSOLE_H__
31
 
31
 
-
 
32
#include <typedefs.h>
-
 
33
#include <list.h>
-
 
34
#include <synch/spinlock.h>
-
 
35
 
-
 
36
enum cmd_arg_type {
-
 
37
    ARG_TYPE_INVALID = 0,
-
 
38
    ARG_TYPE_INT,
-
 
39
    ARG_TYPE_STRING
-
 
40
};
-
 
41
 
-
 
42
/** Structure representing one argument of kconsole command line. */
-
 
43
struct cmd_arg {
-
 
44
    cmd_arg_type_t type;        /**< Type descriptor. */
-
 
45
    void *buffer;           /**< Buffer where to store data. */
-
 
46
    size_t buflen;          /**< Size of the buffer. */
-
 
47
};
-
 
48
 
-
 
49
/** Structure representing one kconsole command. */
-
 
50
struct cmd_info {
-
 
51
    link_t link;            /**< Command list link. */
-
 
52
    spinlock_t lock;        /**< This lock protects everything below. */
-
 
53
    const char *name;       /**< Command name. */
-
 
54
    const char *description;    /**< Textual description. */
-
 
55
    int (* func)(cmd_arg_t *cmd);   /**< Function implementing the command. */
-
 
56
    count_t argc;           /**< Number of arguments. */
-
 
57
    cmd_arg_t *argv;        /**< Argument vector. */
-
 
58
};
-
 
59
 
-
 
60
extern spinlock_t cmd_lock;
-
 
61
extern link_t cmd_head;
-
 
62
 
-
 
63
extern void kconsole_init(void);
32
extern void kconsole(void *arg);
64
extern void kconsole(void *arg);
33
 
65
 
-
 
66
extern int cmd_register(cmd_info_t *cmd);
-
 
67
 
34
#endif
68
#endif