Changeset 623:fc4f5815f0aa in freeDiameter for doc
- Timestamp:
- Dec 7, 2010, 5:24:53 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/dbg_interactive.py.sample
r622 r623 21 21 22 22 23 # Change the global debug level of the framework (cvar contains all global variables) 24 cvar.fd_g_debug_lvl = FULL 25 26 23 27 # Turn on debug for a specific function 24 28 cvar.fd_debug_one_function = "gc_th_fct" 25 29 26 30 27 # UsefreeDiameter's debug facility31 # Print messages to freeDiameter's debug facility 28 32 fd_log_debug("3 + 4 = %d\n", 7) 29 33 # Hum... Currently I get "3 + 4 = 0" output... need some fix... 30 34 31 35 32 # Change the global debug level of the framework 33 cvar.fd_g_debug_lvl = FULL 36 # SWIG deals with structures as follow: 37 # Take the structure: 38 # struct foo { int a; } 39 # The following functions are available to python: 40 # s = new_foo() --> s = calloc(1, sizeof(struct foo)) 41 # foo_a_set(s, 2) --> s->a = 2 42 # foo_a_get(s) --> returns s->a value 43 # delete_foo(s) --> free(s) 34 44 35 45 … … 56 66 57 67 # Lists 58 mylist = new_fd_list() 59 fd_list_init(mylist, None) 68 l1 = new_fd_list() 60 69 l2 = new_fd_list() 61 fd_list_in it(l2, None)62 fd_list_ insert_after(mylist, l2)63 fd_list_ unlink(l2)70 fd_list_insert_after(l1, l2) 71 fd_list_dump(l1) 72 fd_list_dump(l2) 64 73 delete_fd_list(l2) 65 delete_fd_list(mylist) 74 fd_list_dump(l1) 75 delete_fd_list(l1) 76 66 77 67 78 # Dictionary 68 79 gdict = fd_config_cnf_dict_get(cvar.fd_g_config) 69 @@@ fd_dict_search ( gdict, DICT_APPLICATION, APPLICATION_BY_ID, id, res, -1 ) 80 id = new_int_ptr() 81 int_ptr_assign(id, 3) 82 res = new_dict_object_ptr() 83 err = fd_dict_search ( gdict, DICT_APPLICATION, APPLICATION_BY_ID, id, res, -1 ) 84 obj = dict_object_ptr_value(res) 85 t = new_dict_object_type_ptr() 86 err = fd_dict_gettype(obj, t) 87 dict_object_type_ptr_dump(t) 88 v = new_dict_application_data() 89 err = fd_dict_getval(obj, v) 90 dict_application_data_application_name_get(v) 70 91 71 92 72 93 73
Note: See TracChangeset
for help on using the changeset viewer.