Exemplo n.º 1
0
int main(int argc, char *argv[]) {
    signal(SIGINT, ctrlCHandler);
    do {
        char currentDir[100];
        getcwd(currentDir, sizeof(currentDir));
        printf("%s$ ", currentDir);
        char *input = getInput();
        exeCommand(input);
    } while(1);
    return 0;
}
Exemplo n.º 2
0
void * readCommand (void * args)
{
    char command[CMDSIZE];
    while (1)
    {
    GETCMD:
        putchar('>');
        memset(command, 0, sizeof(command));
        scanf("%[^\n]", command);
        exeCommand(command);
        getchar();
    }
    return NULL;
}
Exemplo n.º 3
0
bool KNMusicBackendMpvThread::loadFile(const QString &filePath)
{
    //Check out the file path.
    if(m_filePath==filePath)
    {
        ;
    }
    //Save the load file path.
    m_filePath=filePath;
    //Reset the thread data first.
    m_totalDuration=-1;
    resetParameter();
    //Open file path in the mpv handle.
    //Prepare load file commands.
    const char *args[] = {"loadfile",
                          filePath.toUtf8().constData(),
                          NULL};
    //Launch command.
    exeCommand(args);
    //Give back loaded signal.
    return true;
}