Navigation


Changeset 623:fc4f5815f0aa in freeDiameter for doc


Ignore:
Timestamp:
Dec 7, 2010, 5:24:53 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Continued work on dbg_interactive.fdx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/dbg_interactive.py.sample

    r622 r623  
    2121
    2222
     23# Change the global debug level of the framework (cvar contains all global variables)
     24cvar.fd_g_debug_lvl = FULL
     25
     26
    2327# Turn on debug for a specific function
    2428cvar.fd_debug_one_function = "gc_th_fct"
    2529
    2630
    27 # Use freeDiameter's debug facility
     31# Print messages to freeDiameter's debug facility
    2832fd_log_debug("3 + 4 = %d\n", 7)
    2933# Hum... Currently I get "3 + 4 = 0" output... need some fix...
    3034
    3135
    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)
    3444
    3545
     
    5666
    5767# Lists
    58 mylist = new_fd_list()
    59 fd_list_init(mylist, None)
     68l1 = new_fd_list()
    6069l2 = new_fd_list()
    61 fd_list_init(l2, None)
    62 fd_list_insert_after(mylist, l2)
    63 fd_list_unlink(l2)
     70fd_list_insert_after(l1, l2)
     71fd_list_dump(l1)
     72fd_list_dump(l2)
    6473delete_fd_list(l2)
    65 delete_fd_list(mylist)
     74fd_list_dump(l1)
     75delete_fd_list(l1)
     76
    6677
    6778# Dictionary
    6879gdict = fd_config_cnf_dict_get(cvar.fd_g_config)
    69 @@@ fd_dict_search ( gdict, DICT_APPLICATION, APPLICATION_BY_ID, id, res, -1 )
     80id = new_int_ptr()
     81int_ptr_assign(id, 3)
     82res = new_dict_object_ptr()
     83err = fd_dict_search ( gdict, DICT_APPLICATION, APPLICATION_BY_ID, id, res, -1 )
     84obj = dict_object_ptr_value(res)
     85t = new_dict_object_type_ptr()
     86err = fd_dict_gettype(obj, t)
     87dict_object_type_ptr_dump(t)
     88v = new_dict_application_data()
     89err = fd_dict_getval(obj, v)
     90dict_application_data_application_name_get(v)
    7091
    7192
    7293
    73 
Note: See TracChangeset for help on using the changeset viewer.