Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 Kevin 1
#include <stdbool.h>
2
#include <stdio.h>
3
#include "../esh.h"
4
 
5
static bool 
6
init_plugin(struct esh_shell *shell)
7
{
8
    printf("Plugin 'prompt' initialized...\n");
9
    return true;
10
}
11
 
12
static char * 
13
prompt(void)
14
{
15
    // the prompt must be dynamically allocated
16
    return strdup("custom prompt> ");
17
}
18
 
19
struct esh_plugin esh_module = {
20
    .rank = 10,
21
    .init = init_plugin,
22
    .make_prompt = prompt
23
};