ARB
|
#include <names_server.h>
#include <names_client.h>
#include "names.h"
#include <arbdb.h>
#include <arb_file.h>
#include <arb_sleep.h>
#include <names_prototypes.h>
#include <server.h>
#include <client.h>
#include <servercntrl.h>
#include <struct_man.h>
#include <unistd.h>
#include <cctype>
#include <list>
#include <string>
Go to the source code of this file.
Classes | |
struct | AN_gl_struct |
class | NameInformation |
Macros | |
#define | na_assert(cond) arb_assert(cond) |
#define | FULLNAME_LEN_MAX 64 |
#define | NAME_LEN_MIN 2 |
#define | UPPERCASE(c) do { (c) = toupper(c); } while (0) |
#define | PREFIXLEN 3 |
#define | assert_alphanumeric(s) |
Functions | |
long | aisc_find_lib (dll_public *dll, char *key) |
void | aisc_link (dll_public *dll, AN_shorts *shorts) |
void | aisc_link (dll_public *dll, AN_revers *revers) |
char * | an_strlwr (char *str) |
int | an_strnicmp (const char *s1, const char *s2, int len) |
int | an_stricmp (const char *s1, const char *s2) |
static AN_revers * | lookup_an_revers (AN_main *main, const char *shortname) |
static AN_shorts * | lookup_an_shorts (AN_main *main, const char *identifier) |
static size_t | an_shorts_elems (AN_shorts *sin) |
static GB_HASH * | an_get_prefix_hash () |
static const char * | an_make_prefix (const char *str) |
static AN_shorts * | an_find_shrt_prefix (const char *search) |
static void | an_add_short (const AN_local *, const char *new_name, const char *parsed_name, const char *parsed_sym, const char *shrt, const char *acc, const char *add_id) |
static void | an_remove_short (AN_shorts *an_shorts) |
static char * | nas_string_2_name (const char *str) |
static char * | nas_remove_small_vocals (const char *str) |
static void | an_complete_shrt (char *shrt, const char *rest_of_full) |
static void | an_autocaps (char *str) |
static char * | an_get_short (AN_shorts *shorts, dll_public *parent, const char *full) |
static bool | contains_non_alphanumeric (const char *str) |
static char * | make_alnum (const char *str) |
static char * | make_alpha (const char *str) |
int | del_short (const AN_local *locs) |
aisc_string | get_short (const AN_local *locs) |
int | server_save (AN_main *main, int) |
static void | check_for_case_error (AN_main *main) |
static void | check_for_illegal_chars (AN_main *main) |
static void | set_empty_addids (AN_main *main) |
static GB_ERROR | server_load (AN_main *main) |
int | names_server_save () |
int | server_shutdown (AN_main *, aisc_string passwd) |
static int | usage (const char *exeName, const char *err) |
int | ARB_main (int argc, char *argv[]) |
Variables | |
static struct AN_gl_struct | AN_global |
AN_main * | aisc_main |
const int | SERVER_VERSION = 5 |
static const char * | default_full_name = "No name" |
static GB_HASH * | nameModHash = NULp |
#define na_assert | ( | cond | ) | arb_assert(cond) |
Definition at line 30 of file names.cxx.
Referenced by an_get_short(), get_short(), and set_empty_addids().
#define FULLNAME_LEN_MAX 64 |
Definition at line 32 of file names.cxx.
Referenced by nas_remove_small_vocals(), and nas_string_2_name().
#define NAME_LEN_MIN 2 |
Definition at line 33 of file names.cxx.
Referenced by an_complete_shrt(), nas_remove_small_vocals(), and nas_string_2_name().
#define UPPERCASE | ( | c | ) | do { (c) = toupper(c); } while (0) |
Definition at line 51 of file names.cxx.
Referenced by an_get_short(), and NameInformation::NameInformation().
#define PREFIXLEN 3 |
Definition at line 133 of file names.cxx.
Referenced by an_get_prefix_hash().
#define assert_alphanumeric | ( | s | ) |
Definition at line 562 of file names.cxx.
Referenced by get_short(), and NameInformation::NameInformation().
Definition at line 40 of file names.cxx.
Referenced by an_get_short(), lookup_an_revers(), and lookup_an_shorts().
|
inline |
Definition at line 42 of file names.cxx.
Referenced by aisc_link(), an_add_short(), an_get_short(), check_for_case_error(), server_load(), and set_empty_addids().
|
inline |
Definition at line 43 of file names.cxx.
References aisc_link().
Definition at line 70 of file names.cxx.
Referenced by an_add_short(), check_for_case_error(), lookup_an_revers(), lookup_an_shorts(), and server_load().
|
static |
Definition at line 100 of file names.cxx.
References aisc_find_lib(), an_strlwr(), and ARB_strdup().
Referenced by an_remove_short(), check_for_case_error(), and get_short().
|
static |
Definition at line 109 of file names.cxx.
References aisc_find_lib(), an_strlwr(), and ARB_strdup().
Referenced by check_for_case_error(), del_short(), and get_short().
|
static |
Definition at line 124 of file names.cxx.
Referenced by an_get_prefix_hash().
|
static |
Definition at line 135 of file names.cxx.
References aisc_main, an_shorts_elems(), ARB_strndup(), GB_IGNORE_CASE, GBS_create_hash(), GBS_write_hash_no_strdup(), long, and PREFIXLEN.
Referenced by an_add_short(), an_find_shrt_prefix(), and an_remove_short().
Definition at line 153 of file names.cxx.
Referenced by an_add_short(), an_find_shrt_prefix(), and an_remove_short().
|
static |
Definition at line 163 of file names.cxx.
References an_get_prefix_hash(), an_make_prefix(), and GBS_read_hash().
Referenced by an_get_short(), and check_for_case_error().
|
static |
Definition at line 169 of file names.cxx.
References aisc_link(), aisc_main, an_get_prefix_hash(), an_make_prefix(), an_strlwr(), ARB_calloc(), ARB_strdup(), GBS_optimize_hash(), and GBS_write_hash().
Referenced by NameInformation::add_short().
|
static |
Definition at line 210 of file names.cxx.
References aisc_main, aisc_unlink(), an_get_prefix_hash(), an_make_prefix(), GBS_write_hash(), and lookup_an_revers().
Referenced by check_for_case_error(), check_for_illegal_chars(), del_short(), and get_short().
Definition at line 236 of file names.cxx.
References ARB_strdup(), FULLNAME_LEN_MAX, and NAME_LEN_MIN.
Referenced by an_get_short().
Definition at line 258 of file names.cxx.
References ARB_strdup(), FULLNAME_LEN_MAX, and NAME_LEN_MIN.
Referenced by an_get_short().
|
static |
Definition at line 298 of file names.cxx.
Referenced by an_get_short(), check_for_case_error(), and NameInformation::NameInformation().
Definition at line 339 of file names.cxx.
References aisc_find_lib(), aisc_link(), aisc_main, an_autocaps(), an_complete_shrt(), an_find_shrt_prefix(), ARB_strdup(), na_assert, nas_remove_small_vocals(), nas_string_2_name(), NULp, result, and UPPERCASE.
Referenced by check_for_case_error(), and get_short().
|
static |
Definition at line 523 of file names.cxx.
Referenced by check_for_illegal_chars(), and get_short().
Definition at line 534 of file names.cxx.
Referenced by ARB_main(), and NameInformation::NameInformation().
Definition at line 546 of file names.cxx.
Referenced by get_short().
int del_short | ( | const AN_local * | locs | ) |
Definition at line 631 of file names.cxx.
References aisc_main, an_remove_short(), NameInformation::get_id(), info, and lookup_an_shorts().
aisc_string get_short | ( | const AN_local * | locs | ) |
Definition at line 647 of file names.cxx.
References NameInformation::add_short(), aisc_main, an_get_short(), an_remove_short(), ARB_strdup(), assert_alphanumeric, base36(), contains_non_alphanumeric(), digits(), GB_IGNORE_CASE, GBK_terminatef(), GBS_create_hash(), GBS_global_string_copy(), GBS_optimize_hash(), GBS_read_hash(), GBS_write_hash(), NameInformation::get_first_name(), NameInformation::get_full_name(), NameInformation::get_id(), NameInformation::get_rest_of_name(), IF_ASSERTION_USED, info, lookup_an_revers(), lookup_an_shorts(), make_alpha(), max, na_assert, and NULp.
Definition at line 927 of file names.cxx.
References GB_IO_error(), GB_move_file(), GB_time_of_file(), and GB_warning().
Referenced by ARB_main(), and names_server_save().
|
static |
Definition at line 982 of file names.cxx.
References aisc_link(), aisc_unlink(), an_autocaps(), an_find_shrt_prefix(), an_get_short(), an_remove_short(), an_stricmp(), an_strlwr(), ARB_strdup(), lookup_an_revers(), and lookup_an_shorts().
Referenced by server_load().
|
static |
Definition at line 1093 of file names.cxx.
References an_remove_short(), and contains_non_alphanumeric().
Referenced by server_load().
|
static |
Definition at line 1124 of file names.cxx.
References aisc_link(), aisc_unlink(), GBS_global_string_copy(), and na_assert.
Referenced by ARB_main().
|
static |
Definition at line 1154 of file names.cxx.
References aisc_link(), an_strlwr(), ARB_strdup(), check_for_case_error(), check_for_illegal_chars(), error(), GB_time_of_file(), GBS_global_string(), NULp, and SERVER_VERSION.
Referenced by ARB_main().
int names_server_save | ( | ) |
Definition at line 1218 of file names.cxx.
References aisc_main, and server_save().
Referenced by names_destroy_locs().
int server_shutdown | ( | AN_main * | , |
aisc_string | passwd | ||
) |
Definition at line 1223 of file names.cxx.
References aisc_broadcast(), aisc_server_shutdown(), AN_global, EXIT_SUCCESS, fflush(), and AN_gl_struct::server_communication.
Definition at line 1243 of file names.cxx.
References arb_print_server_params(), and EXIT_FAILURE.
Referenced by ARB_main().
Definition at line 1255 of file names.cxx.
References aisc_accept_calls(), aisc_close(), AISC_MAGIC_NUMBER, aisc_main, aisc_nput(), aisc_open(), aisc_server_shutdown(), AN_global, ARB_sleep(), ARB_strdup(), arb_trace_argv(), AN_gl_struct::cl_link, AN_gl_struct::cl_main, arb_params::default_file, error(), EXIT_FAILURE, EXIT_SUCCESS, arb_params::field, arb_params::field_default, fputs(), GB_print_error(), GB_time_of_file(), GBK_singlequote(), GBK_system(), GBS_free_hash(), GBS_global_string(), GBS_global_string_copy(), GBS_nameserver_tag(), GBS_read_arb_tcp(), long, make_alnum(), MAX_TRY, NAME_SERVER_SLEEP, NAME_SERVER_TIMEOUT, NULp, open_aisc_server(), RETRY_SLEEP, SEC, AN_gl_struct::server_communication, server_load(), server_save(), set_empty_addids(), arb_params::tcp, and usage().
|
static |
Definition at line 63 of file names.cxx.
Referenced by ARB_main(), and server_shutdown().
AN_main* aisc_main |
Definition at line 64 of file names.cxx.
Referenced by an_add_short(), an_get_prefix_hash(), an_get_short(), an_remove_short(), ARB_main(), del_short(), get_short(), NameInformation::NameInformation(), and names_server_save().
const int SERVER_VERSION = 5 |
Definition at line 66 of file names.cxx.
Referenced by server_load().
|
static |
Definition at line 494 of file names.cxx.
Referenced by NameInformation::NameInformation().