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

# File modules/ud/ud_process_stream.c

      $Revision: 1.24 $

      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/socket.h"`
    - `#include <sys/types.h>`
    - `#include <sys/socket.h>`
    - `#include <netinet/in.h>`
    - `#include <stdlib.h>`
    - `#include <errno.h>`
    - `#include <netdb.h>`
    - `#include <signal.h>`
    - `#include <stdio.h>`
    - `#include <include/iproutines.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/socket.h"`
      - `#include "include/thread.h"`
        - `#include <pthread.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/iproutines.h"`
  - `#include "include/rp.h"`
    - `#include <stddef.h>`
    - `#include <glib.h>`
    - `#include <defs.h>`
    - `#include <iproutines.h>`
    - `#include <erroutines.h>`
    - `#include <rxroutines.h>`
    - `#include <mysql_driver.h>`
  - `#include "include/nh.h"`
    - `#include <mysql_driver.h>`
  - `#include "include/globaldefs.h"`
  - `#include "include/bitmask.h"`
  - `#include "include/which_keytypes.h"`

## Preprocessor definitions

`#define SBUNCH 1000`

`#define ATTR_DELIMITERS " ,"`

## 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_PLUS;` |
`}` |

## Global Variable tmpfile1

`char tmpfile1[63]`

Visible in: |  | modules/ud/ud_process_stream.c
Used in: | get_NRTM_stream() | modules/ud/ud_process_stream.c

## Global Variable tmpfile2

`char tmpfile2[63]`

Visible in: |  | modules/ud/ud_process_stream.c
Used in: | UD_process_stream() | modules/ud/ud_process_stream.c
| get_NRTM_stream() | modules/ud/ud_process_stream.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
| NH_check() | modules/nh/nh.c
| NH_convert() | modules/nh/nh.c
| NH_parse() | modules/nh/nh.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_type() | modules/ud/ud_process_stream.c
| object_free() | modules/ud/ud_misc.c
| object_new() | 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
| split_attribute() | modules/ud/ud_process_stream.c
| transaction_free() | modules/ud/ud_misc.c
| create_serial(), fclose(), fgets(), fprintf(), g_slist_append(), g_slist_concat(), g_slist_sort(), g_string_free(), g_string_sized_new(), g_string_sprintf(), g_string_sprintfa(), mysql_ping(), sprintf(), strcpy(), strncpy(), strstr(), time(), unlink()
Called by: | UD_do_nrtm() | modules/ud/ud_main.c
| UD_do_updates() | modules/ud/ud_main.c
References Functions: | reorder_attributes() | modules/ud/ud_process_stream.c
References Variables: | tmpfile2 | modules/ud/ud_process_stream.c

## Global Function escape_apostrophes()

`GString* escape_apostrophes ( GString* text )`

Calls: | g_string_insert_c()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c

## Global Function get_NRTM_stream()

`FILE* get_NRTM_stream ( struct _nrtm* nrtm, int upto_last )`

Prototyped in: | modules/ud/ud_int.h
Calls: | SK_read() | modules/sk/socket.c
| SK_write() | modules/sk/socket.c
| bzero(), close(), connect(), fopen(), fprintf(), gethostbyname_r(), inet_ntoa(), memcpy(), mkstemp(), open(), perror(), read(), socket(), sprintf(), strlen(), system(), unlink(), write()
Called by: | UD_do_nrtm() | modules/ud/ud_main.c
References Variables: | tmpfile1 | modules/ud/ud_process_stream.c
| tmpfile2 | 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 line_type()

`static Line_Type_t line_type ( const char* line )`

Calls: | 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, char* object_name, 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
| create_serial(), fprintf(), strcpy()
Called by: | process_transaction() | modules/ud/ud_process_stream.c

## Local Function process_transaction()

`static int process_transaction ( UD_stream_t* ud_stream, Object_t* obj, char* object_name, nic_handle_t* nh, int operation )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | attribute_free() | modules/ud/ud_misc.c
| attribute_new() | modules/ud/ud_misc.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
| report_transaction() | modules/ud/ud_process_stream.c
| transaction_free() | modules/ud/ud_misc.c
| transaction_new() | modules/ud/ud_misc.c
| g_strdup()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c

## Local Function process_updates()

`static int process_updates ( UD_stream_t* ud_stream, Transaction_t* tr, char* object_name, 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
| create_serial(), g_strdup()
Called by: | process_transaction() | modules/ud/ud_process_stream.c

## Local Function reorder_attributes()

`static gint reorder_attributes ( const void* element1, const void* element2 )`

Used in: | UD_process_stream() | modules/ud/ud_process_stream.c

## Local Function report_transaction()

`static int report_transaction ( Transaction_t* tr, Log_t* log, char* obj_name, char* reason )`

Prototyped in: | modules/ud/ud_process_stream.c
Calls: | fflush(), fprintf()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c
| process_nrtm() | modules/ud/ud_process_stream.c
| process_transaction() | modules/ud/ud_process_stream.c
| process_updates() | modules/ud/ud_process_stream.c

## Local Function split_attribute()

`static GSList* split_attribute ( GSList* attr_list, A_Type_t attr_type, char* attr_value )`

Calls: | attribute_new1() | modules/ud/ud_misc.c
| strsep() | modules/qc/query_command.c
| free(), g_slist_append(), g_strdup(), g_strndup(), index()
Called by: | UD_process_stream() | modules/ud/ud_process_stream.c