Changeset 6297


Ignore:
Timestamp:
Jul 8, 2008, 2:29:05 PM (13 years ago)
Author:
charles
Message:

fold the rewritten getopt code into libT

Location:
trunk
Files:
2 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/Makefile.am

    r6294 r6297  
    2121    $(PTHREAD_LIBS) -lm
    2222
    23 noinst_HEADERS = getopts.h
    24 
    2523transmission_daemon_SOURCES = daemon.c
    26 transmission_remote_SOURCES = remote.c getopts.c
     24transmission_remote_SOURCES = remote.c
  • trunk/daemon/remote.c

    r6296 r6297  
    2424#include <libtransmission/rpc.h>
    2525#include <libtransmission/json.h>
     26#include <libtransmission/tr-getopt.h>
    2627#include <libtransmission/utils.h>
    2728#include <libtransmission/version.h>
    28 
    29 #include "getopts.h"
    3029
    3130#define MY_NAME "transmission-remote"
     
    4645}
    4746
    48 static struct options opts[] =
     47static tr_option opts[] =
    4948{
    5049    { 'a', "add",          "Add torrent files", "a", 0, NULL },
     
    7776showUsage( void )
    7877{
    79     getopts_usage( MY_NAME, getUsage(), opts );
     78    tr_getopt_usage( MY_NAME, getUsage(), opts );
    8079    exit( 0 );
    8180}
     
    142141    *id = '\0';
    143142
    144     while(( c = getopts( getUsage(), argc, argv, opts, &optarg )))
     143    while(( c = tr_getopt( getUsage(), argc, argv, opts, &optarg )))
    145144    {
    146145        char buf[MAX_PATH_LENGTH];
     
    153152        switch( c )
    154153        {
    155             case -2:  /* special case: recognize options we didn't set above */
     154            case TR_OPT_UNK:
    156155                      if( addingTorrents ) {
    157156                          char * tmp;
  • trunk/libtransmission/Makefile.am

    r6237 r6297  
    3838    torrent.c \
    3939    torrent-ctor.c \
     40    tr-getopt.c \
    4041    tracker.c \
    4142    trevent.c \
     
    8283    torrent.h \
    8384    tracker.h \
     85    tr-getopt.h \
    8486    transmission.h \
    8587    trevent.h \
Note: See TracChangeset for help on using the changeset viewer.