File: convlex.c

package info (click to toggle)
rtklib 2.4.3%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 41,796 kB
  • sloc: cpp: 51,592; ansic: 50,584; fortran: 987; makefile: 861; sh: 45
file content (29 lines) | stat: -rw-r--r-- 996 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*------------------------------------------------------------------------------
* convlex.c : convert lex binary to lex log
*
* history : 2010/08/24  1.0  new
*           2011/07/01  1.1  add -h option
*-----------------------------------------------------------------------------*/
#include "rtklib.h"

/* main ----------------------------------------------------------------------*/
int main(int argc, char **argv)
{
    const char *usage="lexconvbin [-h] [-t type] infile [-o outfile]";
    char *infile="",*outfile="";
    int i,type=0,format=0;
    
    for (i=0;i<argc;i++) {
        if      (!strcmp(argv[i],"-h")) format=1;
        else if (!strcmp(argv[i],"-t")&&i+1<argc) type=atoi(argv[++i]);
        else if (!strcmp(argv[i],"-o")&&i+1<argc) outfile=argv[++i];
        else if (!strcmp(argv[i],"-")) {
            fprintf(stderr,"usage: %s\n",usage);
            return 0;
        }
        else infile=argv[i];
    }
    lexconvbin(type,format,infile,outfile);
    
    return 0;
}