⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ogsoptions.c

📁 C写的用软件无线电实现的GPS模拟程序
💻 C
字号:
/* ******************************************************************   *                                                                *   *                          Open GPS Sim                          *   *                                                                *   * -------------------------------------------------------------- *   *                                                                *   *   Modul: ogsoptions.c                                          *   *                                                                *   *   Autor: gnu                                                   *   *                                                                *   *   Datum: 19.09.91                                              *   *                                                                *   * -------------------------------------------------------------- *   *                                                                *   *   Zweck: Verarbeitung von Optionen                             *   *                                                                *   ****************************************************************** *//* ************************* Aenderungen ****************************   01.01.92 -   ****************************************************************** *//* --------------------------- includes ----------------------------- *//* Parse command line arguments for bison,   Copyright (C) 1984, 1986, 1989 Free Software Foundation, Inc.This file is part of Bison, the GNU Compiler Compiler.Bison is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 1, or (at your option)any later version.Bison 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 Bison; see the file COPYING.  If not, write tothe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  *//* ---------------------- includes ---------------------------- */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#if defined(__TURBOC__) && !defined(__TOS__)# include <io.h>#endif#include "ogsdefine.h"#include "ogsstructs.h"#include "ogsextern.h"#include "ogsprototypes.h"#include "ogslibrary.h"/* ---------------------- prototypen -------------------------------- */int getopt( int argc, char **argv, char *optstring);void usage( void);/* ---------------------- globals ----------------------------------- */char *OutputFileName = "ogsraw.dat";char *NavFilePattern;int OverWrite;long CounterStartValue = 1000;/* ---------------------- procedures -------------------------------- */void getargs( int argc, char *argv[]){  register int c;//  char  *Ptr = NULL;//        *TmpStr = NULL;//  unsigned int Last = 0;  extern int optind;  extern char *optarg;/*  getopt( argc, argv, "?hvel:m:n:o:s:txyz:") */  while ((c = getopt( argc, argv, "?hvfo:n:")) != EOF)  {    switch (c)    {      case '?':      case 'h':        usage();        break;      case 'v':        Verbose = 1;        break;      case 'f':        OverWrite = 1;        break;      case 'n':        assert( optarg);        NavFilePattern = conmalloc( strlen( optarg)+1);        strcpy( NavFilePattern, optarg);        break;      case 'o':        assert( optarg);        OutputFileName = conmalloc( strlen( optarg)+1);        strcpy( OutputFileName, optarg);        break;#if 0      case 'i':       OutputIQ = 1;       break;      case 'r':       OutputCarFrq = 1;       break;      case 'e':       ReadUntilEOF = TRUE;       break;      case 'l':        assert( optarg);        if (( Ptr = strchr( optarg, '-')) != NULL)        {          BisLine = atoi( Ptr+1);          if ( optarg[0] != '-')            VonLine = atoi( optarg);        }        else          NofSkipLines = atoi( optarg);        break;      case 'm':        assert( optarg);        MissingValueSet = TRUE;        MissingValue = atof( optarg);        break;      case 'n':        assert( MatrixName && optarg);        if ( strlen( optarg) >= MATNAMELEN)          optarg[ MATNAMELEN-1] = '\0';        strcpy( MatrixName, optarg);        break;      case 'o':        assert( optarg);        assert( OutputFile);        strcpy( OutputFile, optarg);        break;#endif      default:        fprintf( stderr, "unknown qualifier -%c\n", c);        break;    }  }  if ( optind < argc - 1)    fprintf( stderr, "warning: extra arguments ignored\n");  return;  }/* ============================== Eof =============================== */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -