ARB
|
#include <ctime>
#include <sys/stat.h>
#include <arbdbt.h>
#include <arb_str.h>
#include "gb_local.h"
Go to the source code of this file.
Classes | |
class | ArbTcpDat |
Macros | |
#define | MAXLINELEN 512 |
#define | MAXTOKENS 10 |
Functions | |
char * | GB_arbtcpdat_path () |
const char * | GBS_scan_arb_tcp_param (const char *ipPort, const char *wantedParam) |
const char * | GBS_nameserver_tag (const char *add_field) |
const char * | GBS_ptserver_tag (int id) |
const char * | GBS_read_arb_tcp (const char *env) |
const char *const * | GBS_get_arb_tcp_entries (const char *matching) |
const char * | GBS_ptserver_logname () |
void | GBS_add_ptserver_logentry (const char *entry) |
char * | GBS_ptserver_id_to_choice (int i, int showBuild) |
Variables | |
static ArbTcpDat | arb_tcp_dat |
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().
Definition at line 275 of file adtcp.cxx.
Referenced by arb_look_and_start_server(), AW_select_nameserver(), GBS_ptserver_id_to_choice(), and pd_export_pt_server().
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().
Definition at line 312 of file adtcp.cxx.
References ASSERT_RESULT_PREDICATE, and gb_assert.
Referenced by arb_look_and_start_ptserver(), GBS_ptserver_id_to_choice(), pd_export_pt_server(), pd_kill_pt_server(), pd_query_pt_server(), pd_start_pt_server(), PT_FamilyFinder::searchFamily(), and test_ptserver_activate().
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 arb_look_and_kill_server(), arb_look_and_start_ptserver(), arb_look_and_start_server(), ARB_main(), arb_start_server(), AW_select_nameserver(), NameServerConnection::connect(), gbcm_open_socket(), GBS_ptserver_id_to_choice(), pd_export_pt_server(), pd_query_pt_server(), run_command(), and sina_start().
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 390 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 | ) |
Definition at line 425 of file adtcp.cxx.
References GB_path_in_ARBLIB(), and RETURN_ONETIME_ALLOC.
Referenced by GBS_add_ptserver_logentry(), pd_edit_ptserver_log(), and PT_selection::PT_selection().
void GBS_add_ptserver_logentry | ( | const char * | entry | ) |
Definition at line 429 of file adtcp.cxx.
References GBS_ptserver_logname(), and NULp.
Referenced by enter_stage_1_build_tree(), pd_export_pt_server(), and run_command().
Definition at line 447 of file adtcp.cxx.
References ARB_strdup(), GBS_global_string_copy(), GBS_ptserver_tag(), GBS_read_arb_tcp(), GBS_scan_arb_tcp_param(), NULp, and result.
Referenced by PT_selection::fill(), pd_kill_pt_server(), and readable_pt_servername().
|
static |
Definition at line 271 of file adtcp.cxx.
Referenced by arb_look_and_start_server().