> netsnmp_variable_list *
> exampleTable_get_first_data_point(...)
> {
> *my_loop_context = 0;
> return exampleTable_get_next_data_point(...);
> }

> netsnmp_variable_list *
> exampleTable_get_next_data_point(...)
> {
> int i = (int) *my_loop_context; // i.e. 0
> snmp_set_var_value(put_index_data, exampleTable_head[i].userIndex,...);
> *my_data_context = (void *) &exampleTable_head[i];
// i is still 0
> *my_loop_context = (void *) ++i; // i becomes 1
> return put_index_data;
> }

So the first row to be returned should be exampleTable_head[0]

Is that what you are seeing, or not?
It's not totally clear what you mean by an "empty row".

What is the exact data you are working with?
(i.e. the contents of the exampleTable_head array)
What results do you actually see?
(exact output please)

Dave
  The exact data I am working with:
   
  #define TABLESIZE 3
  struct exampleTable_entry exampleTable_head[TABLESIZE] = 
{/*int,char,int,int*/
 {6, 'A', 100, 100},
 {10, 'A', 100, 100},
   {11, 'A', 100, 100}
};

  Results I actually see when snmptable:
   
  userIndex userStatus  check  monSet
             0                           0            0
             6                A      100        100
           10                A      100        100
           11                A      100        100
   
  The empty row i means is just as above:it is a additional row with 
system-initial datas.
  Thank you very much for your help!
   
  Best regards,
  zhou

                
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件! 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to