#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sched.h>
#include "tuple.h"
Go to the source code of this file.
Defines | |
#define | PERROR(x) fprintf(stderr, __FILE__":%d ", __LINE__); perror(x) |
Functions | |
int | get_server_portnumber (struct context *ctx) |
void | print_element (struct element *e) |
void | print_tuple (struct tuple *s) |
tuple * | make_tuple_internal (char *fmt, va_list ap) |
tuple * | make_tuple (char *fmt,...) |
void | destroy_tuple (struct tuple *t) |
int | tuples_match (struct tuple *s, struct tuple *t) |
unsigned int | random_int (void) |
int | send_chunk (struct context *ctx, char *buf, int bytes_to_send) |
int | send_tuple (struct context *ctx, struct tuple *t) |
int | recv_chunk (struct context *ctx, char *buf, int size) |
tuple * | recv_tuple (struct context *ctx) |
int | open_client_socket (struct context *ctx) |
int | put_tuple (struct tuple *s, struct context *ctx) |
tuple * | get_tuple (struct tuple *s, struct context *ctx) |
tuple * | read_tuple (struct tuple *s, struct context *ctx) |
tuple * | get_nb_tuple (struct tuple *s, struct context *ctx) |
tuple * | read_nb_tuple (struct tuple *s, struct context *ctx) |
tuple_list * | dump_tuple_space (struct tuple_list *templates, struct context *ctx) |
int | tuple_server_log (FILE *stream, struct context *ctx) |
element * | tuple_field (struct tuple *s, int n) |
int | tuple_int_field (struct tuple *s, int n) |
double | tuple_double_field (struct tuple *s, int n) |
char * | tuple_string_field (struct tuple *s, int *len, int n) |
Variables | |
int | i_am_server = 0 |
char | logbuf [8192] |
int | logptr = 0 |
|
Definition at line 71 of file tuple.c. Referenced by dump_tuple_space, get_nb_tuple, get_tuple, make_tuple_internal, open_client_socket, put_tuple, read_nb_tuple, read_tuple, recv_chunk, recv_tuple, send_chunk, send_tuple, and tuple_server_log. |
|
Deallocate all the storage for a tuple. Definition at line 261 of file tuple.c. References tuple::elements, and tuple::string_space. |
|
Definition at line 753 of file tuple.c. References DBGPRINTF, DUMP, tuple_list::next, open_client_socket, PERROR, recv_chunk, recv_tuple, send_chunk, send_tuple, and tuple_list::tup. |
|
Definition at line 681 of file tuple.c. References GET_NB, open_client_socket, PERROR, recv_tuple, send_chunk, and send_tuple. |
|
Attempt to get the server name and port number from environment variables.
Definition at line 81 of file tuple.c. References context::portnumber, PORTNUMBER_ENVVAR, context::servername, and SERVERNAME_ENVVAR. |
|
Definition at line 611 of file tuple.c. References DBGPRINTF, GET, open_client_socket, PERROR, recv_tuple, send_chunk, and send_tuple. |
|
Create a tuple or template, starting from a printf-style variable argument list. Definition at line 246 of file tuple.c. References make_tuple_internal. |
|
Definition at line 182 of file tuple.c. References element::data, tuple::elements, EXIT, I_AM_A_TUPLE, tuple::num_elts, PERROR, tuple::string_space, element::tag, and tuple::tag. Referenced by make_tuple. |
|
Definition at line 545 of file tuple.c. References PERROR, context::portnumber, context::servername, and context::sock. Referenced by dump_tuple_space, get_nb_tuple, get_tuple, put_tuple, read_nb_tuple, read_tuple, and tuple_server_log. |
|
Definition at line 101 of file tuple.c. References element::data, logbuf, logptr, and element::tag. |
|
Definition at line 151 of file tuple.c. References tuple::elements, logbuf, logptr, tuple::num_elts, and print_element. |
|
Definition at line 583 of file tuple.c. References open_client_socket, PERROR, PUT, recv_chunk, send_chunk, send_tuple, and context::sock. |
|
Return a 32-bit random unsigned integer, gotten from /dev/urandom. Definition at line 326 of file tuple.c. Referenced by main, and py_random_int. |
|
Definition at line 714 of file tuple.c. References DBGPRINTF, open_client_socket, PERROR, READ_NB, recv_tuple, send_chunk, and send_tuple. |
|
Definition at line 646 of file tuple.c. References DBGPRINTF, open_client_socket, PERROR, READ, recv_tuple, send_chunk, and send_tuple. |
|
Definition at line 437 of file tuple.c. References i_am_server, PERROR, and context::sock. |
|
Definition at line 471 of file tuple.c. References element::data, tuple::elements, EXIT, I_AM_A_TUPLE, tuple::num_elts, PERROR, recv_chunk, tuple::string_length, tuple::string_space, element::tag, and tuple::tag. |
|
Definition at line 342 of file tuple.c. References PERROR, and context::sock. |
|
Definition at line 371 of file tuple.c. References element::data, tuple::elements, tuple::num_elts, PERROR, send_chunk, and element::tag. |
|
Definition at line 899 of file tuple.c. References element::data, EXIT, logbuf, logptr, print_tuple, element::tag, and tuple_field. |
|
Definition at line 864 of file tuple.c. References EXIT. Referenced by tuple_double_field, tuple_int_field, and tuple_string_field. |
|
Definition at line 879 of file tuple.c. References element::data, EXIT, logbuf, logptr, print_tuple, element::tag, and tuple_field. |
|
Definition at line 829 of file tuple.c. References LOG, open_client_socket, PERROR, send_chunk, and context::sock. |
|
Definition at line 919 of file tuple.c. References element::data, EXIT, logbuf, logptr, print_tuple, element::tag, and tuple_field. |
|
Definition at line 276 of file tuple.c. References element::data, tuple::elements, tuple::num_elts, and element::tag. |
|
This flag tells whether or not the current executable is the tuple server. If it is, then broken pipes on sockets should not crash the executable. Definition at line 55 of file tuple.c. Referenced by recv_chunk. |
|
Buffer for logging tuple activity.
Definition at line 65 of file tuple.c. Referenced by print_element, print_tuple, tuple_double_field, tuple_int_field, and tuple_string_field. |
|
Pointer into logbuf. Definition at line 69 of file tuple.c. Referenced by print_element, print_tuple, tuple_double_field, tuple_int_field, and tuple_string_field. |