ARB
Classes | Macros | Functions | Variables
adtcp.cxx File Reference
#include <ctime>
#include <sys/stat.h>
#include <arbdbt.h>
#include <arb_str.h>
#include "gb_local.h"
Include dependency graph for adtcp.cxx:

Go to the source code of this file.

Classes

class  ArbTcpDat
 

Macros

#define MAXLINELEN   512
 
#define MAXTOKENS   10
 

Functions

charGB_arbtcpdat_path ()
 
const charGBS_scan_arb_tcp_param (const char *ipPort, const char *wantedParam)
 
const charGBS_nameserver_tag (const char *add_field)
 
const charGBS_ptserver_tag (int id)
 
const charGBS_read_arb_tcp (const char *env)
 
const char *const * GBS_get_arb_tcp_entries (const char *matching)
 
const charGBS_ptserver_logname ()
 
void GBS_add_ptserver_logentry (const char *entry)
 
charGBS_ptserver_id_to_choice (int i, int showBuild)
 

Variables

static ArbTcpDat arb_tcp_dat
 

Macro Definition Documentation

#define MAXLINELEN   512

Definition at line 106 of file adtcp.cxx.

#define MAXTOKENS   10

Definition at line 107 of file adtcp.cxx.

Function Documentation

char* GB_arbtcpdat_path ( void  )

Definition at line 215 of file adtcp.cxx.

References GB_lib_file().

Referenced by awt_edit_arbtcpdat_cb(), and ArbTcpDat::update().

const char* GBS_scan_arb_tcp_param ( const char ipPort,
const char wantedParam 
)
const char* GBS_nameserver_tag ( const char add_field)

Definition at line 303 of file adtcp.cxx.

References ARB_strupper(), GBS_global_string_copy(), and RETURN_LOCAL_ALLOC.

Referenced by ARB_main(), and NameServerConnection::connect().

const char* GBS_ptserver_tag ( int  id)
const char* GBS_read_arb_tcp ( const char env)

Find an entry in the $ARBHOME/lib/arb_tcp.dat file

Be aware: GBS_read_arb_tcp returns a quite unusual string containing several string delimiters (0-characters). It contains all words (separated by space or tab in arb_tcp.dat) of the corresponding line in arb_tcp.dat. These words get concatenated (separated by 0 characters).

The first word (which matches the parameter env) is skipped. The second word (the socket info = "host:port") is returned directly as result. The third word is the server executable name. The fourth and following words are parameters to the executable.

To access these words follow this example:

const char *ipPort = GBS_read_arb_tcp(GBS_nameserver_tag(NULp)); if (ipPort) { const char *serverExe = strchr(ipPort, 0)+1; const char *para1 = strchr(serverExe, 0)+1; // always exists! const char *para2 = strchr(para1, 0)+1; if (para2[0]) { // para2 exists } } else { // handle error! }

see also GBS_read_arb_tcp_param() above

Returns NULp on error (which is exported in that case)

Definition at line 325 of file adtcp.cxx.

References error(), gb_assert, GB_export_error(), GB_getenvUSER(), GBS_global_string(), GBS_global_string_copy(), ArbTcpDat::get_entry(), ArbTcpDat::get_filename(), NULp, result, and ArbTcpDat::update().

Referenced by AP_probe_pt_look_for_server(), arb_look_and_kill_server(), arb_look_and_start_server(), ARB_main(), arb_start_server(), AW_select_nameserver(), NameServerConnection::connect(), gbcm_open_socket(), GBS_ptserver_id_to_choice(), MP_probe_pt_look_for_server(), pd_export_pt_server(), PD_probe_pt_look_for_server(), pd_query_pt_server(), run_command(), and sina_start().

const char* const* GBS_get_arb_tcp_entries ( const char matching)

returns a list of all matching non-user-specific entries found in arb_tcp.dat match is performed by GBS_string_matches (e.g. use "ARB_PT_SERVER*")

Definition at line 396 of file adtcp.cxx.

References error(), GB_export_error(), GB_MIND_CASE, GBS_string_matches(), ArbTcpDat::get_server_count(), ArbTcpDat::get_serverID(), id, NULp, and ArbTcpDat::update().

Referenced by AW_select_nameserver(), PT_selection::fill(), and pd_kill_pt_server().

const char* GBS_ptserver_logname ( void  )
void GBS_add_ptserver_logentry ( const char entry)

Definition at line 435 of file adtcp.cxx.

References GBS_ptserver_logname(), and NULp.

Referenced by enter_stage_1_build_tree(), pd_export_pt_server(), and run_command().

char* GBS_ptserver_id_to_choice ( int  i,
int  showBuild 
)

Variable Documentation

ArbTcpDat arb_tcp_dat
static

Definition at line 271 of file adtcp.cxx.

Referenced by arb_look_and_start_server().