<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:10pt">Hi everybody,<br>I have a problem while reading the code. I dont understand much of struct universe which is copied below. I find that there are the functions in this structure, ex:<br> struct option_cache *(*lookup_func) (struct universe *,<br> struct option_state *,<br> unsigned);<br>I dont understand this model much (there are functions in a structure). And i dont understand why dont they put these functions out of the structure instead of in the structure? Besides, i dont understand what this function is used
for?<br><br>Is there someone who can help me?<br>Thanks in advance.<br><br><span style="font-weight: bold; font-style: italic;">This is the structure (in tree.h):</span><br style="font-weight: bold; font-style: italic;"><br>struct universe {<br> const char *name;<br> struct option_cache *(*lookup_func) (struct universe *,<br> struct option_state *,<br> unsigned);<br> void (*save_func) (struct universe *, struct option_state *,<br> struct option_cache *, isc_boolean_t);<br> void (*foreach) (struct packet *,<br> struct
lease *, struct client_state *,<br> struct option_state *, struct option_state *,<br> struct binding_scope **, struct universe *, void *,<br> void (*) (struct option_cache *, struct packet *,<br> struct lease *, struct client_state *,<br> struct option_state *,<br> struct option_state *,<br> struct binding_scope **,<br> struct universe *,
void *));<br> void (*delete_func) (struct universe *universe,<br> struct option_state *, int);<br> int (*option_state_dereference) (struct universe *,<br> struct option_state *,<br> const char *, int);<br> int (*decode) (struct option_state *,<br> const unsigned char *, unsigned, struct universe *);<br> int (*encapsulate) (struct data_string *, struct packet *,<br> struct lease *, struct client_state *,<br>
struct option_state *, struct option_state *,<br> struct binding_scope **,<br> struct universe *);<br> u_int32_t (*get_tag) (const unsigned char *);<br> void (*store_tag) PROTO ((unsigned char *, u_int32_t));<br> u_int32_t (*get_length) (const unsigned char *);<br> void (*store_length) PROTO ((unsigned char *, u_int32_t));<br> int tag_size, length_size;<br> unsigned end;<br> option_name_hash_t *name_hash;<br> option_code_hash_t *code_hash;<br> struct option *enc_opt;<br> int index;<br><br> /* Flags should probably become condensed. */<br> int
concat_duplicates;<br>};<br><div style="font-family: times new roman,new york,times,serif; font-size: 10pt;"><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><br></div></div></div><br>
<hr size=1>
Not happy with your email address?
<br> <a href="http://uk.docs.yahoo.com/ymail/new.html"> Get the one you
really want</a> - millions of new email addresses available now at <a
href="http://uk.docs.yahoo.com/ymail/new.html"> Yahoo!</a></body></html>