Cross reference for modules/ud/ud_process_stream.c of index.

# File modules/ud/ud_process_stream.c

      $Revision: 1.53 $

      Functions to process data stream( file, network socket, etc.)

      Status: NOT REVUED, NOT TESTED

     Author(s):       Chris Ottrey, Andrei Robachevsky

## Included Files

- `#include <sys/types.h>`

- `#include <sys/socket.h>`

- `#include <netdb.h>`

- `#include <arpa/inet.h>`

- `#include <unistd.h>`

- `#include <sys/stat.h>`

- `#include <fcntl.h>`

- `#include <string.h>`

- `#include "include/constants.h"`
  - `#include <glib.h>`

- `#include "include/query_command.h"`
  - `#include <glib.h>`
  - `#include "include/bitmask.h"`
  - `#include "include/sk.h"`
    - `#include "include/stubs.h"`
      - `#include <stdlib.h>`
      - `#include <stdio.h>`
      - `#include <ctype.h>`
    - `#include <sys/types.h>`
    - `#include <sys/socket.h>`
    - `#include <netinet/in.h>`
    - `#include <netdb.h>`
    - `#include <pthread.h>`
    - `#include <stdlib.h>`
    - `#include <errno.h>`
    - `#include <fcntl.h>`
    - `#include <signal.h>`
    - `#include <stdio.h>`
    - `#include "include/iproutines.h"`
      - `#include <sys/types.h>`
      - `#include <glib.h>`
      - `#include <include/inet6def.h>`
      - `#include <include/erroutines.h>`

- `#include "modules/ud/ud.h"`

- `#include "modules/ud/ud_int.h"`
  - `#include <stdio.h>`
  - `#include <strings.h>`
  - `#include <glib.h>`
  - `#include <stdlib.h>`
  - `#include <ctype.h>`
  - `#include <unistd.h>`
  - `#include "include/defs.h"`
    - `#include <glib.h>`
    - `#include "include/bitmask.h"`
    - `#include "include/DF_class_enum.def"`
    - `#include "include/DF_class_mask.def"`
    - `#include "include/DF_attribute_enum.def"`
    - `#include "include/DF_attribute_inv_attr_mask.def"`
    - `#include "include/which_keytypes.h"`
      - `#include "include/bitmask.h"`
    - `#include "include/iproutines.h"`
    - `#include "include/rxroutines.h"`
      - `#include <glib.h>`
      - `#include <pthread.h>`
      - `#include <stubs.h>`
      - `#include <include/memwrap.h>`
      - `#include <stdio.h>`
      - `#include <iproutines.h>`
      - `#include <erroutines.h>`
      - `#include "include/sk.h"`
      - `#include "include/thread.h"`
  - `#include "include/mysql_driver.h"`
    - `#include "/opt/package/mysql/include/mysql/mysql.h"`
      - `#include <sys/types.h>`
      - `#include "/opt/package/mysql/include/mysql/mysql_com.h"`
      - `#include "/opt/package/mysql/include/mysql/mysql_version.h"`
    - `#include "/opt/package/mysql/include/mysql/mysqld_error.h"`
    - `#include "include/erroutines.h"`
  - `#include "include/iproutines.h"`
  - `#include "include/erroutines.h"`
  - `#include "include/rp.h"`
    - `#include <stddef.h>`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <defs.h>`
    - `#include <iproutines.h>`
    - `#include <erroutines.h>`
    - `#include <rxroutines.h>`
    - `#include <mysql_driver.h>`
    - `#include "include/ca_defs.h"`
      - `#include <pthread.h>`
      - `#include <glib.h>`
    - `#include <thread.h>`
  - `#include "include/nh.h"`
    - `#include <mysql_driver.h>`
  - `#include "include/sk.h"`
  - `#include "include/memwrap.h"`
  - `#include "include/ca_configFns.h"`
    - `#include "include/ca_defs.h"`
    - `#include <memwrap.h>`
    - `#include <erroutines.h>`
  - `#include "include/ca_dictionary.h"`
  - `#include "include/ca_macros.h"`
    - `#include "include/ca_adminAttribs.h"`
  - `#include "include/ca_srcAttribs.h"`
  - `#include "include/globaldefs.h"`
  - `#include "include/bitmask.h"`
  - `#include "include/which_keytypes.h"`

- `#include "modules/ud/ud_tr.h"`
  - `#include "include/ud_int.h"`

- `#include "include/timediff.h"`
  - `#include <sys/time.h>`

## Preprocessor definitions

`#define SBUNCH 1000`

`#define ATTR_DELIMITERS " ,\t"`

## Typedef Line_Type_t

`typedef enum _Line_Type_t Line_Type_t`

`enum _Line_Type_t` |
`{` |
`LINE_ATTRIBUTE;` |
`LINE_COMMENT;` |
`LINE_EMPTY;` |
`LINE_EOF;` |
`LINE_ADD;` |
`LINE_UPD;` |
`LINE_DEL;` |
`LINE_OVERRIDE_ADD;` |
`LINE_OVERRIDE_UPD;` |
`LINE_OVERRIDE_DEL;` |
`LINE_ACK;` |
`}` |

## Global Variable Lock

`pthread_mutex_t Lock`

Included from | include/ca_defs.h
Visible in: |  | modules/ac/access_control.c
|  | modules/ca/ca_configFns.c
|  | modules/ca/ca_initFn.c
|  | modules/ca/ca_sanityCheck.c
|  | modules/ca/ca_sourceLoader.c
|  | modules/ca/ca_values.c
|  | modules/er/er_macro.c
|  | modules/pc/pc_commands.c
|  | modules/pm/pm_serials.c
|  | modules/pm/protocol_mirror.c
|  | modules/pw/protocol_whois.c
|  | modules/qc/query_command.c
|  | modules/qi/query_instructions.c
|  | modules/rp/rp_convert.c
|  | modules/rp/rp_load.c
|  | modules/rp/rp_search.c
|  | modules/rp/rp_tree.c
|  | modules/rp/rp_update.c
|  | modules/sv/server.c
|  | modules/ud/ud_comrol.c
|  | modules/ud/ud_core.c
|  | modules/ud/ud_main.c
|  | modules/ud/ud_misc.c
|  | modules/ud/ud_process_stream.c
Used in: | ca_get_adminIntElement() | modules/ca/ca_configFns.c
| ca_get_adminStrElement() | modules/ca/ca_configFns.c
| ca_get_boolean() | modules/ca/ca_configFns.c
| ca_get_dirlist() | modules/ca/ca_configFns.c
| ca_get_int() | modules/ca/ca_configFns.c
| ca_get_string() | modules/ca/ca_configFns.c
| ca_set_boolean() | modules/ca/ca_configFns.c
| ca_set_string() | modules/ca/ca_configFns.c
| ca_srchandle2Intelement() | modules/ca/ca_configFns.c
| ca_srchandle2Strelement() | modules/ca/ca_configFns.c

## Global Function UD_process_stream()

`int UD_process_stream ( UD_stream_t* ud_stream )`

Prototyped in: | modules/ud/ud_int.h
Calls: | CO_get_do_update() | modules/co/constants.c
| ER_dbg_va() | modules/er/er.c
| ER_inf_va() | modules/er/er.c
| ER_perror() | modules/er/er.c
| SK_cd_gets() | modules/sk/cd_socket.c
| SQ_error() | modules/sq/mysql_driver.c
| SQ_ping() | modules/sq/mysql_driver.c
| UD_parse_object() | modules/ud/ud_process_stream.c
| line_type() | modules/ud/ud_process_stream.c
| object_free() | modules/ud/ud_misc.c
| object_process() | modules/ud/ud_core.c
| process_transaction() | modules/ud/ud_process_stream.c
| report_transaction() | modules/ud/ud_process_stream.c
| transaction_free() | modules/ud/ud_misc.c
| transaction_new() | modules/ud/ud_misc.c
| ud_normalize() | modules/ud/ud_process_stream.c
| ud_parse_free() | modules/ud/ud_process_stream.c
| ud_parse_init() | modules/ud/ud_process_stream.c
| TR_delete_record(), TR_update_record(), UD_comrol_serial(), UD_create_serial(), UD_lock_serial(), UD_unlock_serial(), UT_timediff(), UT_timeget(), fprintf()
Called by: | UD_do_nrtm() | modules/ud/ud_main.c
| UD_do_updates() | modules/ud/ud_main.c

## Global Function each_attribute_2_pass()

`void each_attribute_2_pass ( void* element_data, void* ptr )`

Calls: | ER_perror() | modules/er/er.c
| NH_check() | modules/nh/nh.c
| NH_convert() | modules/nh/nh.c
| NH_parse() | modules/nh/nh.c
| attribute_upd() | modules/ud/ud_misc.c
| ud_replace_substring() | modules/ud/ud_process_stream.c
| ud_split_attribute() | modules/ud/ud_process_stream.c
| fprintf(), g_slist_append(), g_strchomp(), g_strchug()
Used in: | ud_normalize() | modules/ud/ud_process_stream.c

## Local Function UD_parse_object()

`static Object_t* UD_parse_object ( Obj_parse_t* parse, char* line_buff )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | DF_get_update_query_type() | modules/df/defs.c
| ER_perror() | modules/er/er.c
| attribute_free() | modules/ud/ud_misc.c
| attribute_new() | modules/ud/ud_misc.c
| attribute_upd() | modules/ud/ud_misc.c
| escape_apostrophes() | modules/ud/ud_process_stream.c
| line_continuation() | modules/ud/ud_process_stream.c
| object_new() | modules/ud/ud_misc.c
| UT_free_real(), fprintf(), g_slist_append(), g_slist_insert(), g_strconcat(), g_strdup(), g_string_free(), g_string_sized_new(), g_string_sprintf(), g_string_sprintfa(), g_strndup(), index()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c

## Local Function each_attribute_print()

`static void each_attribute_print ( void* element_data, void* tr_ptr )`

Calls: | fprintf()
Used in: | print_object() | modules/ud/ud_process_stream.c

## Local Function escape_apostrophes()

`static GString* escape_apostrophes ( GString* text )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | g_string_insert_c()
Called by: | UD_parse_object() | modules/ud/ud_process_stream.c

## Local Function line_continuation()

`static int line_continuation ( char* line )`

Prototyped in: | modules/ud/ud_process_stream.c
Called by: | UD_parse_object() | modules/ud/ud_process_stream.c

## Local Function line_type()

`static Line_Type_t line_type ( const char* line, long* transaction_id )`

Calls: | atol(), strcmp(), strncmp()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c

## Local Function print_object()

`static void print_object ( Object_t* obj )`

Calls: | fprintf(), g_slist_foreach()
References Functions: | each_attribute_print() | modules/ud/ud_process_stream.c

## Local Function process_nrtm()

`static int process_nrtm ( UD_stream_t* ud_stream, Transaction_t* tr, int operation )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | isdummy() | modules/ud/ud_core.c
| object_free() | modules/ud/ud_misc.c
| object_process() | modules/ud/ud_core.c
| report_transaction() | modules/ud/ud_process_stream.c
| transaction_free() | modules/ud/ud_misc.c
| TR_create_record(), TR_update_record(), UD_comrol_serial(), UD_create_serial(), UD_lock_serial(), UD_unlock_serial(), UT_timeget()
Called by: | process_transaction() | modules/ud/ud_process_stream.c

## Local Function process_transaction()

`static int process_transaction ( UD_stream_t* ud_stream, Obj_parse_t* parse, int operation, long transaction_id )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | ER_perror() | modules/er/er.c
| get_object_id() | modules/ud/ud_core.c
| object_free() | modules/ud/ud_misc.c
| process_nrtm() | modules/ud/ud_process_stream.c
| process_updates() | modules/ud/ud_process_stream.c
| transaction_free() | modules/ud/ud_misc.c
| transaction_new() | modules/ud/ud_misc.c
| TR_check(), fprintf(), g_slist_foreach(), g_strdup()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c
References Functions: | ud_each_primary_key_select() | modules/ud/ud_core.c

## Local Function process_updates()

`static int process_updates ( UD_stream_t* ud_stream, Transaction_t* tr, int operation )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | UD_ack() | modules/ud/ud_misc.c
| isdummy() | modules/ud/ud_core.c
| object_free() | modules/ud/ud_misc.c
| object_process() | modules/ud/ud_core.c
| report_transaction() | modules/ud/ud_process_stream.c
| transaction_free() | modules/ud/ud_misc.c
| TR_update_record(), UD_comrol_serial(), UD_create_serial(), UD_lock_serial(), UD_unlock_serial(), UT_timeget()
Called by: | process_transaction() | modules/ud/ud_process_stream.c

## Local Function report_transaction()

`static int report_transaction ( Transaction_t* tr, long transaction_id, Log_t* log, ut_timer_t* psotime, char* reason )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | DF_class_type2name() | modules/df/defs.c
| ER_dbg_va() | modules/er/er.c
| ER_inf_va() | modules/er/er.c
| UT_timediff(), UT_timeget()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c
| process_nrtm() | modules/ud/ud_process_stream.c
| process_updates() | modules/ud/ud_process_stream.c

## Local Function ud_normalize()

`static int ud_normalize ( Obj_parse_t* parse )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | g_slist_foreach(), g_slist_free(), g_slist_nth(), g_strdup()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c
References Functions: | each_attribute_2_pass() | modules/ud/ud_process_stream.c

## Local Function ud_parse_free()

`static void ud_parse_free ( Obj_parse_t* parse )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | UT_free_real()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c

## Local Function ud_parse_init()

`static void ud_parse_init ( MYSQL* sql_connection, Obj_parse_t* parse )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | bzero()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c

## Local Function ud_replace_substring()

`static int ud_replace_substring ( GString* gstring, char* old, char* new )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | g_string_erase(), g_string_insert()
Called by: | each_attribute_2_pass() | modules/ud/ud_process_stream.c

## Local Function ud_split_attribute()

`static GSList* ud_split_attribute ( GSList* attr_list, Attribute_t* attr )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | attribute_free() | modules/ud/ud_misc.c
| attribute_new1() | modules/ud/ud_misc.c
| free(), g_slist_append(), g_strdup(), g_strndup(), index(), strncmp(), strtok_r()
Called by: | each_attribute_2_pass() | modules/ud/ud_process_stream.c