Ignore:
Timestamp:
May 14, 2011, 3:06:27 AM (9 years ago)
Author:
Sam Hocevar
Message:

build: add a --disable-network compilation flag and get rid of most of
the CELLOS_LV2 ifdefs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/nfclient.cpp

    r555 r651  
    3030#include "cache.h"
    3131
    32 #include "gserver.h"
    33 
    34 #if !defined __CELLOS_LV2__
     32#include "net/gserver.h"
    3533
    3634void remove_client(int client_number) { ; }
     
    115113  }
    116114
    117 
     115#if HAVE_NETWORK
    118116  if (local_only)
    119117  {
     118#endif
    120119    local=new jFILE(filename,mode);
    121120    if (local->open_failure()) { delete local; local=NULL; }
     121#if HAVE_NETWORK
    122122  }
    123123  else
    124124  {
    125 
    126 
    127125    char nm[256];
    128126    strcpy(nm,filename);
     
    135133    }
    136134  }
     135#endif
    137136}
    138137
     
    149148  if (local)
    150149    return local->read(buf,count);
     150#if HAVE_NETWORK
    151151  else if (nfs_fd>=0)
    152152  {
     
    158158    return a;
    159159  }
     160#endif
    160161  else return 0;
    161162}
     
    165166  if (local)
    166167    return local->write(buf,count);
     168#if HAVE_NETWORK
    167169  else
    168170  {
     
    170172    exit(0);
    171173  }
     174#endif
    172175  return 0;
    173176}
     
    178181  if (local)
    179182    return local->seek(off,whence);
     183#if HAVE_NETWORK
    180184  else if (nfs_fd>=0)
    181185  {
     
    185189      return NF_seek(nfs_fd,off);
    186190  }
     191#endif
    187192  return 0;
    188193}
     
    191196{
    192197  if (local)          return local->tell();
     198#if HAVE_NETWORK
    193199  else if (nfs_fd>=0) return NF_tell(nfs_fd);
     200#endif
    194201  else                return 0;
    195202}
     
    199206{
    200207  if (local)          return local->file_size();
     208#if HAVE_NETWORK
    201209  else if (nfs_fd>=0) return NF_filelength(nfs_fd);
     210#endif
    202211  else                return 0;
    203212}
     
    207216  flush_writes();
    208217  if (local)          delete local;
     218#if HAVE_NETWORK
    209219  else if (nfs_fd>=0) NF_close(nfs_fd);
     220#endif
    210221}
    211222
    212223int set_file_server(net_address *addr)
    213224{
     225#if HAVE_NETWORK
    214226  if (NF_set_file_server(addr))
    215227  {
     
    229241    return 1;
    230242  }
     243#endif
    231244  return 0;
    232245}
     
    247260}
    248261
    249 #endif
    250 
Note: See TracChangeset for help on using the changeset viewer.