Changeset 8071


Ignore:
Timestamp:
Mar 17, 2009, 6:08:02 PM (13 years ago)
Author:
charles
Message:

(trunk libT) make tr-getopt C++ friendly

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r7907 r8071  
    13321332}
    13331333
     1334char*
     1335tr_bencToJSON( const tr_benc * top )
     1336{
     1337    char * ret;
     1338    struct evbuffer * buf = evbuffer_new( );
     1339    tr_bencSaveAsJSON( top, buf );
     1340    ret = tr_strndup( EVBUFFER_DATA( buf ), EVBUFFER_LENGTH( buf ) );
     1341    evbuffer_free( buf );
     1342    return ret;
     1343}
     1344
    13341345/***
    13351346****
  • trunk/libtransmission/bencode.h

    r7663 r8071  
    8080
    8181char*     tr_bencSaveAsJSON( const tr_benc * top, struct evbuffer * out );
     82
     83char*     tr_bencToJSON( const tr_benc * top );
    8284
    8385int       tr_bencSaveFile( const char * filename, const tr_benc * );
  • trunk/libtransmission/tr-getopt.c

    r7783 r8071  
    217217    return o->val;
    218218}
    219 
  • trunk/libtransmission/tr-getopt.h

    r7888 r8071  
    2525#ifndef TR_GETOPT_H
    2626#define TR_GETOPT_H
     27
     28#ifdef __cplusplus
     29extern "C" {
     30#endif
    2731
    2832extern int tr_optind;
     
    6670                      const tr_option * opts );
    6771
     72#ifdef __cplusplus
     73} /* extern "C" */
     74#endif
     75
    6876#endif /* TR_GETOPT_H */
Note: See TracChangeset for help on using the changeset viewer.