This repository has been archived on 2021-09-16. You can view files and clone it, but cannot push or open issues or pull requests.
msh/msh.c

48 lines
592 B
C
Raw Normal View History

2021-09-13 23:46:17 +02:00
#include <stdio.h>
#include <stdlib.h>
char *PS1 = NULL;
unsigned int histsize = DEF_HISTSIZE;
// Buffered user data
struct {
char *name;
char *home;
uid_t uid;
gid_t gid;
} uinfo;
void sh_fill_uinfo(void);
void sh_update_ps1(void);
inline void sh_print_ps1(void);
int main(int argc, char **argv)
{
sh_fill_uinfo();
for (;;) {
sh_update_ps1();
sh_print_ps1();
}
return EXIT_SUCCESS;
}
void sh_fill_uinfo(void)
{
struct pwuid pw;
uinfo.uid = getuid();
uidfo.gid = getgid();
}
inline void sh_print_ps1(void)
{
puts(PS1);
putchar(' ');
}
void sh_update_ps1(void)
{
}