亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? commands.c

?? linux下的dvb收看解析軟件代碼; 帶參考程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*Copyright (C) 2006  Adam CharrettThis program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USAcommands.cCommand Processing and command functions.*/#include <limits.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <getopt.h>#include <ctype.h>#include <readline/readline.h>#include <readline/history.h>#include "multiplexes.h"#include "services.h"#include "dvb.h"#include "ts.h"#include "udpoutput.h"#include "logging.h"#include "cache.h"#include "outputs.h"#include "main.h"#define PROMPT "DVBStream>"#define MAX_ARGS (10)typedef struct Command_t{    char *command;    bool  tokenise;    int   minargs;    int   maxargs;    char *shorthelp;    char *longhelp;    void (*commandfunc)(int argc, char **argv);}Command_t;static void GetCommand(char **command, char **argument);static char **AttemptComplete (const char *text, int start, int end);static char *CompleteCommand(const char *text, int state);static bool ProcessCommand(char *command, char *argument);static char **Tokenise(char *arguments, int *argc);static void ParseLine(char *line, char **command, char **argument);static char *Trim(char *str);static void CommandQuit(int argc, char **argv);static void CommandServices(int argc, char **argv);static void CommandMultiplex(int argc, char **argv);static void CommandSelect(int argc, char **argv);static void CommandCurrent(int argc, char **argv);static void CommandPids(int argc, char **argv);static void CommandStats(int argc, char **argv);static void CommandAddOutput(int argc, char **argv);static void CommandRmOutput(int argc, char **argv);static void CommandOutputs(int argc, char **argv);static void CommandAddPID(int argc, char **argv);static void CommandRmPID(int argc, char **argv);static void CommandOutputPIDs(int argc, char **argv);static void CommandAddSSF(int argc, char **argv);static void CommandRemoveSSF(int argc, char **argv);static void CommandSSFS(int argc, char **argv);static void CommandSetSSF(int argc, char **argv);static void CommandFEStatus(int argc, char **argv);static void CommandHelp(int argc, char **argv);static int ParsePID(char *argument);static char *PIDFilterNames[] = {                                    "PAT",                                    "PMT",                                    "SDT",                                    "Service",                                };static Command_t commands[] = {                                  {                                      "quit",                                      FALSE, 0, 0,                                      "Exit the program",                                      "Exit the program, can be used in the startup file to stop further processing.",                                      CommandQuit                                  },                                  {                                      "services",                                      FALSE, 0, 0,                                      "List all available services",                                      "Lists all the services currently in the database. This list will be "                                      "updated as updates to the PAT are detected.",                                      CommandServices                                  },                                  {                                      "multiplex",                                      FALSE, 0, 0,                                      "List all the services on the current multiplex",                                      "List only the services on the same multiplex as the currently selected service.",                                      CommandMultiplex,                                  },                                  {                                      "select",                                      FALSE, 1, 1,                                      "Select a new service to stream",                                      "select <service name>\n"                                      "Sets <service name> as the current service, this may mean tuning to a different "                                      "multiplex.",                                      CommandSelect                                  },								  {                                      "current",                                      FALSE, 0, 0,                                      "Print out the service currently being streamed.",                                      "Shows the service that is currently being streamed to the default output.",                                      CommandCurrent                                  },                                  {                                      "pids",                                      FALSE, 1, 1,                                      "List the PIDs for a specified service",                                      "pids <service name>\n"                                      "List the PIDs for <service name>.",                                      CommandPids                                  },                                  {                                      "stats",                                      FALSE, 0, 0,                                      "Display the stats for the PAT,PMT and service PID filters",                                      "Display the number of packets processed and the number of packets "                                      "filtered by each filter.",                                      CommandStats                                  },                                  {                                      "addoutput",                                      TRUE, 2, 2,                                      "Add a new destination for manually filtered PIDs.",                                      "addoutput <output name> <ipaddress>:<udp port>\n"                                      "Adds a new destination for sending packets to. This is only used for "                                      "manually filtered packets. "                                      "To send packets to this destination you'll need to also call \'filterpid\' "                                      "with this output as an argument.",                                      CommandAddOutput                                  },                                  {                                      "rmoutput",                                      TRUE, 1, 1,                                      "Remove a destination for manually filtered PIDs.",                                      "rmoutput <output name>\n"                                      "Removes the destination and stops all filters associated with this output.",                                      CommandRmOutput                                  },                                  {                                      "lsoutputs",                                      FALSE, 0, 0,                                      "List current outputs",                                      "List all active additonal output names and destinations.",                                      CommandOutputs                                  },                                  {                                      "addpid",                                      TRUE, 2, 2,                                      "Adds a PID to filter to an output",                                      "addpid <output name> <pid>\n"                                      "Adds a PID to the filter to be sent to the specified output.",                                      CommandAddPID                                  },                                  {                                      "rmpid",                                      TRUE, 2, 2,                                      "Removes a PID to filter from an output",                                      "rmpid <output name> <pid>\n"                                      "Removes the PID from the filter that is sending packets to the specified output.",                                      CommandRmPID                                  },                                  {                                      "lspids",                                      TRUE, 1, 1,                                      "List PIDs for output",                                      "lspids <output name>\n"                                      "List the PIDs being filtered for a specific output",                                      CommandOutputPIDs                                  },                                  {                                      "addsf",                                      TRUE, 2, 2,                                      "Add a service filter for secondary services",                                      "addsf <output name> <ipaddress>:<udp port>\n"                                      "Adds a new destination for sending a secondary service to.",                                      CommandAddSSF                                  },                                  {                                      "rmsf",                                      TRUE, 1, 1,                                      "Remove a service filter for secondary services",                                      "rmsf <output name>\n"                                      "Remove a destination for sending secondary services to.",                                      CommandRemoveSSF                                  },                                  {                                      "lssfs",                                      FALSE,0,0,                                      "List all secondary service filters",                                      "List all secondary service filters their names, destinations and currently selected service.",                                      CommandSSFS                                  },                                  {                                      "setsf",                                      FALSE, 1, 1,                                      "Select a service to stream to a secondary service output",                                      "setsf <output name> <service name>\n"                                      "Stream the specified service to the secondary service output.",                                      CommandSetSSF                                  },                                  {                                      "festatus",                                      0, 0, 0,                                      "Displays the status of the tuner.",                                      "Displays whether the front end is locked, the bit error rate and signal to noise"                                      "ratio and the signal strength",                                      CommandFEStatus                                  },                                  {                                      "help",                                      TRUE, 0, 1,                                      "Display the list of commands or help on a specific command",                                      "help <command>\n"                                      "Displays help for the specified command.",                                      CommandHelp                                  },                                  {NULL, FALSE, 0, 0, NULL,NULL}                              };static char *args[MAX_ARGS];static bool quit = FALSE;int CommandInit(void){    rl_readline_name = "DVBStreamer";    rl_attempted_completion_function = AttemptComplete;    return 0;}void CommandDeInit(void){    /* Nothing to do for now */}/**************** Command Loop/Startup file functions ************************/void CommandLoop(void){    char *command;    char *argument;    quit = FALSE;    /* Start Command loop */    while(!quit && !ExitProgram)    {        GetCommand(&command, &argument);        if (command)        {            if (!ProcessCommand(command, argument))            {                fprintf(rl_outstream, "Unknown command \"%s\"\n", command);            }            free(command);            if (argument)            {                free(argument);            }        }    }}int CommandProcessFile(char *file){    int lineno = 0;    FILE *fp;    char *command;    char *argument;    char line[256];    char *nl;    fp = fopen(file, "r");    if (!fp)    {        return 1;    }    quit = FALSE;    while(!feof(fp) && !quit)    {        fgets(line, sizeof(line), fp);        nl = strchr(line, '\n');        if (nl)        {            *nl = 0;        }        nl = strchr(line, '\r');        if (nl)        {            *nl = 0;        }        lineno ++;        ParseLine(line, &command, &argument);        if (command && (strlen(command) > 0))        {            if (!ProcessCommand(command, argument))            {                fprintf(stderr, "%s(%d): Unknown command \"%s\"\n", file, lineno, command);            }            free(command);            if (argument)            {                free(argument);            }        }    }    fclose(fp);    return 0;}/*************** Command parsing functions ***********************************/static void GetCommand(char **command, char **argument){    char *line = readline(PROMPT);    *command = NULL;    *argument = NULL;    /* If the user has entered a non blank line process it */    if (line && line[0])    {        add_history(line);        ParseLine(line, command, argument);    }    /* Make sure we free the line buffer */    if (line)    {        free(line);    }}static char **AttemptComplete (const char *text, int start, int end){    char **matches = (char **)NULL;    if (start == 0)    {        matches = rl_completion_matches (text, CompleteCommand);    }    else    {        rl_attempted_completion_over = 1;    }    return (matches);}static char *CompleteCommand(const char *text, int state){    static int lastIndex = -1, textlen;    int i;    if (state == 0)    {        lastIndex = -1;        textlen = strlen(text);    }    for ( i = lastIndex + 1; commands[i].command; i ++)    {        if (strncasecmp(text, commands[i].command, textlen) == 0)        {            lastIndex = i;            return strdup(commands[i].command);        }    }    return NULL;}static bool ProcessCommand(char *command, char *argument){    char **argv = NULL;    int argc = 0;    int i;    bool commandFound = FALSE;    for (i = 0; commands[i].command; i ++)    {        if (strcasecmp(command,commands[i].command) == 0)        {            if (argument)            {                if (commands[i].tokenise)                {                    argv = Tokenise(argument, &argc);                }                else                {                    argc = 1;                    argv = args;                    args[0] = argument;                }            }            else            {                argc = 0;                argv = args;                args[0] = NULL;            }            if ((argc >= commands[i].minargs) && (argc <= commands[i].maxargs))            {                commands[i].commandfunc(argc, argv );            }            else            {                fprintf(rl_outstream, "Incorrect number of arguments see help for more information!\n\n%s\n\n",commands[i].longhelp);            }            if (commands[i].tokenise)            {                int a;                /* Free the arguments but not the array as that is a static array */                for (a = 0; a < argc; a ++)                {                    free(argv[a]);                }            }            commandFound = TRUE;            break;        }    }    return commandFound;}static void ParseLine(char *line, char **command, char **argument){    char *space;    char *hash;    *command = NULL;    *argument = NULL;    /* Trim leading spaces */    for (;*line && isspace(*line); line ++);    /* Handle null/comment lines */    if (*line == '#')    {        return;    }    /* Handle end of line comments */    hash = strchr(line, '#');    if (hash)    {        *hash = 0;    }    /* Find first space after command */    space = strchr(line, ' ');    if (space)    {        char *tmp;        *space = 0;        tmp = Trim(space + 1);        if (strlen(tmp) > 0)        {            *argument = strdup(tmp);        }    }    *command = strdup(line);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频 欧洲视频| 国产呦萝稀缺另类资源| 日韩专区在线视频| 韩国av一区二区三区四区| 国产老妇另类xxxxx| 99国产欧美久久久精品| 7777精品伊人久久久大香线蕉经典版下载| 欧美日韩一区二区三区视频| 久久久久久久久99精品| 一区二区三区视频在线看| 视频一区中文字幕| 国产高清视频一区| 欧美色精品在线视频| 亚洲精品在线三区| 伊人一区二区三区| 国产一区二区女| 欧美在线三级电影| 日韩毛片精品高清免费| 久久成人免费日本黄色| 日本美女视频一区二区| 东方欧美亚洲色图在线| 亚洲天堂精品视频| 在线免费观看日本欧美| 丝袜诱惑制服诱惑色一区在线观看| 欧美久久久久久久久久| 国产欧美一区在线| 狠狠色丁香九九婷婷综合五月 | 91麻豆精品国产91| 香蕉影视欧美成人| 欧美亚洲动漫精品| 亚洲乱码国产乱码精品精98午夜| 国产精品一区2区| 精品成a人在线观看| 精品一区二区综合| 欧美一区二区美女| 亚洲国产精品尤物yw在线观看| 波多野结衣欧美| 久久网这里都是精品| 蜜臀av国产精品久久久久| 亚洲人成伊人成综合网小说| 一区二区三区高清| 成人一区二区三区视频 | 日韩精品一区二区在线| 亚洲成av人影院在线观看网| 91官网在线免费观看| 亚洲第一福利视频在线| 欧美在线free| 丝袜诱惑制服诱惑色一区在线观看| 从欧美一区二区三区| 国产精品色一区二区三区| 成人成人成人在线视频| 国产精品久久久久一区二区三区 | www.欧美日韩国产在线| 中文字幕在线不卡一区二区三区| 久久99国产精品尤物| 久久久久亚洲蜜桃| 国产福利91精品| 国产日韩欧美亚洲| av在线不卡网| 午夜欧美在线一二页| 精品国产3级a| 色嗨嗨av一区二区三区| 麻豆成人免费电影| 国产精品福利一区二区三区| 日韩欧美国产综合一区 | 国产在线一区二区| 一区二区三区.www| 国产精品毛片久久久久久| 欧美日韩免费高清一区色橹橹 | 成人一道本在线| 美腿丝袜亚洲综合| 亚洲夂夂婷婷色拍ww47| 国产三级精品在线| 日韩一区二区三区av| 91丨九色丨尤物| 欧美a级一区二区| 国产精品无码永久免费888| 7799精品视频| 色综合中文字幕国产 | 欧美美女直播网站| 欧美专区在线观看一区| 99久久精品国产一区二区三区| 久久99九九99精品| 蜜桃久久久久久久| 日韩精品久久理论片| 亚洲一二三区视频在线观看| 国产精品久久久久婷婷二区次| 久久久久久黄色| 日本一区二区三区免费乱视频 | 秋霞电影网一区二区| 爽爽淫人综合网网站| 亚洲一区二区四区蜜桃| 性感美女极品91精品| 亚洲成人免费观看| 香蕉av福利精品导航| 日韩黄色片在线观看| 日本午夜精品视频在线观看| 午夜精品在线视频一区| 视频一区国产视频| 丝袜美腿亚洲综合| 久久精品国产一区二区| 韩国成人福利片在线播放| 国产精品亚洲午夜一区二区三区| 国内精品久久久久影院色| 国产激情视频一区二区在线观看 | 成人av资源站| 欧美影视一区在线| 欧美一区二区啪啪| 久久精品网站免费观看| 国产精品国产三级国产aⅴ中文| 五月天久久比比资源色| 亚洲国产精品一区二区久久恐怖片 | 成人免费高清在线| 在线亚洲一区二区| 日韩精品一区二区三区在线| 国产精品网曝门| 天天色综合天天| 国产成人a级片| 91麻豆精品国产无毒不卡在线观看| 久久蜜桃一区二区| 一个色妞综合视频在线观看| 国产麻豆成人精品| 欧美性猛交xxxx乱大交退制版| 精品国产青草久久久久福利| 亚洲日本丝袜连裤袜办公室| 黄色资源网久久资源365| 欧美日韩国产一级二级| 国产精品人成在线观看免费 | 国模少妇一区二区三区| 色吧成人激情小说| 中文字幕精品一区二区三区精品| 午夜av电影一区| 91老师片黄在线观看| 久久久噜噜噜久久人人看 | 久久精品国产999大香线蕉| 91网站在线播放| 国产精品国产三级国产a| 国产一二三精品| 日韩欧美精品在线视频| 性做久久久久久| 欧美日韩视频在线观看一区二区三区 | 色婷婷久久99综合精品jk白丝 | 精品欧美乱码久久久久久1区2区| 亚洲一区二区在线播放相泽| 色综合久久天天| 一区二区三区加勒比av| 色成人在线视频| 午夜欧美在线一二页| 欧美日韩精品久久久| 亚洲一区二区三区四区不卡| 欧美日韩中文字幕精品| 青青草国产成人av片免费| 538在线一区二区精品国产| 午夜视频在线观看一区| 91精品国产综合久久精品app | gogogo免费视频观看亚洲一| 国产精品短视频| 一本久久综合亚洲鲁鲁五月天| 亚洲同性同志一二三专区| 91黄色免费版| 精品一区二区久久| 国产视频视频一区| 在线观看免费一区| 精品一区二区三区在线播放| 精品成人一区二区| www.欧美色图| 日本色综合中文字幕| 国产亚洲精久久久久久| 91福利在线导航| 国产一区二区毛片| 一区二区三区日韩精品| 91精品久久久久久久91蜜桃| 成人精品在线视频观看| 亚洲h在线观看| 国产精品蜜臀av| 日韩美一区二区三区| 91蜜桃免费观看视频| 国内精品第一页| 五月天一区二区三区| 国产精品麻豆久久久| 欧美成人三级电影在线| 欧美日韩一区二区三区四区五区| 成人激情免费网站| 国产高清一区日本| 日韩福利电影在线| 一区二区激情视频| 国产精品麻豆视频| 国产日韩亚洲欧美综合| 欧美精品一区二区三区在线播放| 97成人超碰视| av中文字幕不卡| 成人午夜激情视频| 精品一区二区免费看| 免费在线观看不卡| 蜜桃久久av一区| 免费xxxx性欧美18vr| 日本女优在线视频一区二区| 天堂成人免费av电影一区| 亚洲午夜视频在线观看| 亚洲日本丝袜连裤袜办公室|