亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
视频在线在亚洲| 99精品桃花视频在线观看| 在线免费观看日韩欧美| 久久日一线二线三线suv| 蜜桃免费网站一区二区三区| 95精品视频在线| 欧美精品一区二区久久婷婷| 五月天激情小说综合| 99久久久无码国产精品| 精品国产一区二区在线观看| 日本欧美大码aⅴ在线播放| 色八戒一区二区三区| 亚洲一区二区三区视频在线| 91久久国产综合久久| 亚洲女同一区二区| 欧美日韩在线电影| 日本视频免费一区| 久久综合久色欧美综合狠狠| 国产a视频精品免费观看| 亚洲欧美日韩一区二区| 欧美日韩一级片在线观看| 日本91福利区| 亚洲欧美日韩国产手机在线| 51精品视频一区二区三区| 久久99国产精品久久| 亚洲欧美经典视频| 日韩欧美在线不卡| proumb性欧美在线观看| 偷窥国产亚洲免费视频| 欧美精品一区二区久久婷婷| 色拍拍在线精品视频8848| 久久成人羞羞网站| 亚洲精品综合在线| 国产免费成人在线视频| 91麻豆精品国产91久久久 | 99精品桃花视频在线观看| 午夜av一区二区| 91精品国产综合久久久久久久| 国产在线看一区| 日本中文一区二区三区| 亚洲乱码中文字幕| 国产精品无码永久免费888| 日韩一级大片在线观看| 精品污污网站免费看| www.欧美日韩国产在线| 国产精品自在欧美一区| 美女在线一区二区| 午夜精彩视频在线观看不卡| 伊人婷婷欧美激情| 亚洲精品乱码久久久久| 亚洲天堂中文字幕| 国产精品福利一区二区| 国产欧美在线观看一区| 欧美不卡123| 精品福利在线导航| 精品国产伦一区二区三区免费| 色一区在线观看| 欧美日韩中字一区| 4438x亚洲最大成人网| 日韩免费福利电影在线观看| 精品国产一区二区三区忘忧草| 精品国产免费人成电影在线观看四季| 精品国产免费视频| 中文字幕日韩一区二区| 夜夜操天天操亚洲| 精久久久久久久久久久| 国产一区二区成人久久免费影院| 成人午夜在线视频| 日本电影欧美片| 日韩精品一区二区三区蜜臀| 国产视频一区不卡| 亚洲一级二级在线| 国产在线不卡一卡二卡三卡四卡| 成人综合在线网站| 91.成人天堂一区| 亚洲视频在线观看三级| 日韩精品高清不卡| 国产一区视频导航| 9191成人精品久久| 国产精品卡一卡二| 久久99久久久久久久久久久| 99精品热视频| 91麻豆精品国产91久久久久久 | 爽爽淫人综合网网站| 国产成人精品免费| 欧美日韩国产美女| 亚洲日本丝袜连裤袜办公室| 美日韩一级片在线观看| 欧美综合欧美视频| 久久久久久久久久看片| 日本欧美一区二区| 欧美日韩国产高清一区二区| 国产精品女人毛片| 国产福利一区二区三区| 久久久久综合网| 国产酒店精品激情| 久久―日本道色综合久久 | 亚洲成人中文在线| 成人国产电影网| 欧美激情在线看| 丁香激情综合国产| 国产精品久久久久久久第一福利 | 国产日韩v精品一区二区| 日韩精彩视频在线观看| 日韩一区二区三区高清免费看看| 亚洲不卡在线观看| 日韩亚洲欧美高清| 狠狠色综合日日| 精品免费一区二区三区| 国产成人自拍在线| 国产精品大尺度| youjizz久久| 亚洲激情综合网| 日韩欧美在线影院| 高清不卡在线观看av| 一二三区精品视频| 欧美zozozo| 色综合一区二区三区| 蜜桃视频一区二区| 国产欧美日韩在线视频| a级精品国产片在线观看| 亚洲一区二区av在线| 久久久国产一区二区三区四区小说| 99久久久精品免费观看国产蜜| 一级精品视频在线观看宜春院| 日韩久久免费av| 欧美日韩午夜在线视频| 国产一区二三区好的| 亚洲精品乱码久久久久| 国产日韩欧美综合一区| 欧美成人官网二区| 91久久精品网| 一本色道a无线码一区v| 国产成人综合在线观看| 蜜臀av一区二区三区| 一区二区激情小说| 亚洲欧美一区二区在线观看| 26uuu精品一区二区| 91精品国产91久久久久久最新毛片| 91黄色免费网站| 91麻豆swag| 91在线小视频| 99久久久免费精品国产一区二区| 国产盗摄精品一区二区三区在线 | 91一区二区在线| 成熟亚洲日本毛茸茸凸凹| 日本不卡一区二区三区| 日本成人在线电影网| 日韩高清不卡一区二区三区| 天天综合天天做天天综合| 欧美极品美女视频| 国产精品久久久久影院老司| 国产精品麻豆一区二区| 国产精品三级久久久久三级| 久久婷婷成人综合色| 国产精品午夜电影| 国产精品久久久久久久久果冻传媒| 1区2区3区精品视频| 午夜精品一区在线观看| 激情图片小说一区| 国产jizzjizz一区二区| 欧美亚洲另类激情小说| 日韩精品资源二区在线| 亚洲欧洲99久久| 亚洲成av人在线观看| 蜜桃av一区二区在线观看 | 亚洲一区二区三区在线看| 麻豆一区二区三| 色综合久久中文字幕| 日韩一区二区在线观看视频| 国产无一区二区| 午夜精品一区二区三区免费视频| 韩国成人精品a∨在线观看| 91成人在线观看喷潮| 2021久久国产精品不只是精品| 亚洲福利视频一区| av高清不卡在线| 精品国产亚洲在线| 亚洲va在线va天堂| 成人看片黄a免费看在线| 精品久久久久久久久久久久包黑料 | 欧美日韩视频在线第一区| 国产亚洲精品aa| 五月婷婷另类国产| 欧美伊人久久久久久久久影院| 国产精品福利一区二区三区| 欧美亚洲动漫精品| 亚洲精品欧美在线| 97久久人人超碰| 久久久久久久久岛国免费| 韩国精品久久久| 久久噜噜亚洲综合| 韩国理伦片一区二区三区在线播放| 在线免费观看日本一区| 亚洲精品大片www| 欧美日韩国产另类不卡| 亚洲男女一区二区三区| 懂色av中文一区二区三区| 中文成人综合网| 精品国产在天天线2019|