ARB
Classes | Macros | Functions | Variables
names.cxx File Reference
#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>
Include dependency graph for names.cxx:

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)
 
charan_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_HASHan_get_prefix_hash ()
 
static const charan_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 charnas_string_2_name (const char *str)
 
static charnas_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 charan_get_short (AN_shorts *shorts, dll_public *parent, const char *full)
 
static bool contains_non_alphanumeric (const char *str)
 
static charmake_alnum (const char *str)
 
static charmake_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 chardefault_full_name = "No name"
 
static GB_HASHnameModHash = NULp
 

Macro Definition Documentation

#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().

Function Documentation

long aisc_find_lib ( dll_public *  dll,
char key 
)
inline

Definition at line 40 of file names.cxx.

Referenced by an_get_short(), lookup_an_revers(), and lookup_an_shorts().

void aisc_link ( dll_public *  dll,
AN_shorts *  shorts 
)
inline
void aisc_link ( dll_public *  dll,
AN_revers *  revers 
)
inline

Definition at line 43 of file names.cxx.

References aisc_link().

char* an_strlwr ( char str)
inline
int an_strnicmp ( const char s1,
const char s2,
int  len 
)
inline

Definition at line 77 of file names.cxx.

References cmp.

int an_stricmp ( const char s1,
const char s2 
)
inline

Definition at line 88 of file names.cxx.

References cmp.

Referenced by check_for_case_error().

static AN_revers* lookup_an_revers ( AN_main *  main,
const char shortname 
)
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 AN_shorts* lookup_an_shorts ( AN_main *  main,
const char identifier 
)
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 size_t an_shorts_elems ( AN_shorts *  sin)
static

Definition at line 124 of file names.cxx.

Referenced by an_get_prefix_hash().

static GB_HASH* an_get_prefix_hash ( )
static
static const char* an_make_prefix ( const char str)
static

Definition at line 153 of file names.cxx.

Referenced by an_add_short(), an_find_shrt_prefix(), and an_remove_short().

static AN_shorts* an_find_shrt_prefix ( const char search)
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 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
static void an_remove_short ( AN_shorts *  an_shorts)
static
static char* nas_string_2_name ( const char str)
static

Definition at line 236 of file names.cxx.

References ARB_strdup(), FULLNAME_LEN_MAX, and NAME_LEN_MIN.

Referenced by an_get_short().

static char* nas_remove_small_vocals ( const char str)
static

Definition at line 258 of file names.cxx.

References ARB_strdup(), FULLNAME_LEN_MAX, and NAME_LEN_MIN.

Referenced by an_get_short().

static void an_complete_shrt ( char shrt,
const char rest_of_full 
)
static

Definition at line 281 of file names.cxx.

References NAME_LEN_MIN.

Referenced by an_get_short().

static void an_autocaps ( char str)
static

Definition at line 298 of file names.cxx.

Referenced by an_get_short(), check_for_case_error(), and NameInformation::NameInformation().

static char* an_get_short ( AN_shorts *  shorts,
dll_public *  parent,
const char full 
)
static
static bool contains_non_alphanumeric ( const char str)
static

Definition at line 523 of file names.cxx.

Referenced by check_for_illegal_chars(), and get_short().

static char* make_alnum ( const char str)
static

Definition at line 534 of file names.cxx.

Referenced by ARB_main(), and NameInformation::NameInformation().

static char* make_alpha ( const char str)
static

Definition at line 546 of file names.cxx.

Referenced by get_short().

int del_short ( const AN_local *  locs)
aisc_string get_short ( const AN_local *  locs)
int server_save ( AN_main *  main,
int   
)

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 void check_for_case_error ( AN_main *  main)
static
static void check_for_illegal_chars ( AN_main *  main)
static

Definition at line 1093 of file names.cxx.

References an_remove_short(), and contains_non_alphanumeric().

Referenced by server_load().

static void set_empty_addids ( AN_main *  main)
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 GB_ERROR server_load ( AN_main *  main)
static
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 
)
static int usage ( const char exeName,
const char err 
)
static

Definition at line 1243 of file names.cxx.

References arb_print_server_params(), and EXIT_FAILURE.

Referenced by ARB_main().

int ARB_main ( int  argc,
char argv[] 
)

Variable Documentation

struct AN_gl_struct AN_global
static

Definition at line 63 of file names.cxx.

Referenced by ARB_main(), and server_shutdown().

AN_main* aisc_main
const int SERVER_VERSION = 5

Definition at line 66 of file names.cxx.

Referenced by server_load().

const char* default_full_name = "No name"
static

Definition at line 494 of file names.cxx.

Referenced by NameInformation::NameInformation().

GB_HASH* nameModHash = NULp
static

Definition at line 645 of file names.cxx.