Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

test_store_dump.c File Reference

#include "gwlib/gwlib.h"
#include "shared.h"
#include "bearerbox.h"

Include dependency graph for test_store_dump.c:

Include dependency graph

Go to the source code of this file.

Functions

void print_msg (Msg *msg)
int check_args (int i, int argc, char **argv)
int main (int argc, char **argv)

Variables

int counter = 0


Function Documentation

int check_args int  i,
int  argc,
char **  argv
[static]
 

Definition at line 77 of file test_store_dump.c.

Referenced by main().

00077                                                     {
00078     return -1;
00079 }

int main int  argc,
char **  argv
 

Definition at line 81 of file test_store_dump.c.

References check_args(), counter, debug(), error(), get_and_set_debugs(), gwlib_init(), gwlib_shutdown(), info(), msg_pack(), msg_unpack_wrapper(), octstr_create, octstr_imm(), print_msg(), store_init(), store_load, and type.

00082 {
00083     int cf_index;
00084     Octstr *type;
00085     
00086     gwlib_init();
00087     
00088     cf_index = get_and_set_debugs(argc, argv, check_args);
00089     
00090     if (argv[cf_index] == NULL) {
00091         debug("",0,"Usage: %s <store-file>", argv[0]);
00092         goto error;
00093     }
00094 
00095     type = octstr_create("file");
00096     
00097     /* init store subsystem */
00098     store_init(type, octstr_imm(argv[cf_index]), -1, msg_pack, msg_unpack_wrapper);
00099 
00100     /* pass every entry in the store to callback print_msg() */
00101     store_load(print_msg);
00102 
00103     info(0, "Store file contains %d msg entries", counter);
00104     info(0, "Shutting down.");
00105     
00106 error:
00107     gwlib_shutdown();
00108 
00109     return 1;
00110 }

Here is the call graph for this function:

void print_msg Msg msg  )  [static]
 

Definition at line 70 of file test_store_dump.c.

References counter, and msg_dump().

Referenced by main(), and wap_msg_recv().

00071 {   
00072     counter++;
00073     msg_dump(msg, 0);
00074 }

Here is the call graph for this function:


Variable Documentation

int counter = 0 [static]
 

Definition at line 68 of file test_store_dump.c.

Referenced by main(), and print_msg().

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.