[Refdb-cvs] CVS: refdb/src refdb-client.c,1.29,1.30 refdb-client.h,1.14,1.15
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2004-02-11 23:46:33
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32265 Modified Files: refdb-client.c refdb-client.h Log Message: added variable to the argument list to pass the number of bytes written to pagerfp Index: refdb-client.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -U2 -r1.29 -r1.30 --- refdb-client.c 11 Feb 2004 22:21:14 -0000 1.29 +++ refdb-client.c 11 Feb 2004 23:42:05 -0000 1.30 @@ -535,6 +535,9 @@ int n_sockfd file descriptor of client/server socket connection + size_t* ptr_byte_written ptr to var that will be incremented by the number + of bytes written to a stream + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int send_xml_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd) { +int send_xml_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd, size_t* ptr_byte_written) { int n_style_file_done = 0; int numbyte; @@ -544,9 +547,9 @@ size_t n_result; size_t n_chunksize; - size_t byte_written = 0; char* buffer; char thebytes[11]; char inbuffer[COMMAND_INBUF_LEN]; + n_chunksize = XMLPARSE_CHUNKSIZE; buffer = (char*)malloc(n_chunksize); @@ -662,5 +665,5 @@ we do not want to write the terminating \0 */ if (!n_broken_pipe && strcmp(inbuffer, "POS")) { - byte_written += fwrite(inbuffer, sizeof(char), numbyte-num_trailz, pagerfp); + *ptr_byte_written += fwrite(inbuffer, sizeof(char), numbyte-num_trailz, pagerfp); } /* printf("%s", inbuffer); */ @@ -707,6 +710,9 @@ int n_cgi if 1, assume CGI data + size_t* ptr_byte_written ptr to var that will be incremented by the number + of bytes written to a stream + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int send_ris_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd, char** ptr_ris_set_buffer, size_t* ptr_n_setlength, int* ptr_n_setcount, char* default_ris, int n_cgi) { +int send_ris_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd, char** ptr_ris_set_buffer, size_t* ptr_n_setlength, int* ptr_n_setcount, char* default_ris, int n_cgi, size_t* ptr_byte_written) { int n_result; int n_read_done = 0; @@ -714,8 +720,8 @@ int numbyte; int num_trailz; - size_t byte_written = 0; char thebytes[11] = ""; char inbuffer[COMMAND_INBUF_LEN]; + do { /* ------------------------------------------------------------ */ @@ -805,5 +811,5 @@ if (!n_broken_pipe) { if (!n_cgi) { - byte_written += fwrite(inbuffer, sizeof(char), numbyte-num_trailz, pagerfp); + *ptr_byte_written += fwrite(inbuffer, sizeof(char), numbyte-num_trailz, pagerfp); } } Index: refdb-client.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -U2 -r1.14 -r1.15 --- refdb-client.h 31 Jan 2004 14:56:53 -0000 1.14 +++ refdb-client.h 11 Feb 2004 23:42:05 -0000 1.15 @@ -37,6 +37,6 @@ int listvalue (char* arg, char* command, char* help_string, char* err_string); int getsimplelist(struct simplelistvals* slvals, int n_with_summary); -int send_xml_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd); -int send_ris_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd, char** ptr_ris_set_buffer, size_t* ptr_n_setlength, int* ptr_n_setcount, char* default_ris, int n_cgi); +int send_xml_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd, size_t* ptr_byte_written); +int send_ris_data(FILE *infp, FILE *pagerfp, FILE *errstream, int n_sockfd, char** ptr_ris_set_buffer, size_t* ptr_n_setlength, int* ptr_n_setcount, char* default_ris, int n_cgi, size_t* ptr_byte_written); void pipehandler(int sig); void inthandler(int sig); |