ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/pystatgrab/_statgrab.pyx
(Generate patch)

Comparing projects/pystatgrab/_statgrab.pyx (file contents):
Revision 1.6 by tdb, Fri Feb 13 12:03:29 2004 UTC vs.
Revision 1.10 by tdb, Sat Mar 20 21:29:59 2004 UTC

# Line 98 | Line 98 | cdef extern from "statgrab.h":
98          char *interface_name
99          long long tx
100          long long rx
101 +        long long ipackets
102 +        long long opackets
103 +        long long ierrors
104 +        long long oerrors
105 +        long long collisions
106          time_t systime
107  
108 <    ctypedef enum duplex:
108 >    ctypedef enum statgrab_duplex:
109          FULL_DUPLEX
110          HALF_DUPLEX
111 <        NO_DUPLEX
111 >        UNKNOWN_DUPLEX
112  
113      ctypedef struct network_iface_stat_t:
114          char *interface_name
115          int speed
116 <        duplex dup
116 >        statgrab_duplex dup
117 >        int up
118  
119      ctypedef struct page_stat_t:
120          long long pages_pagein
# Line 136 | Line 142 | cdef extern from "statgrab.h":
142      cdef extern int statgrab_drop_privileges()
143  
144  
145 + py_FULL_DUPLEX = FULL_DUPLEX
146 + py_HALF_DUPLEX = HALF_DUPLEX
147 + py_UNKNOWN_DUPLEX = UNKNOWN_DUPLEX
148 +
149 +
150   class Result:
151      def __init__(self, attrs):
152          self.attrs = attrs
# Line 351 | Line 362 | def py_get_network_stats():
362              {'interface_name': s.interface_name,
363               'tx': s.tx,
364               'rx': s.rx,
365 +             'ipackets': s.ipackets,
366 +             'opackets': s.opackets,
367 +             'ierrors': s.ierrors,
368 +             'oerrors': s.oerrors,
369 +             'collisions': s.collisions,
370               'systime': s.systime,
371              }
372          ))
# Line 369 | Line 385 | def py_get_network_stats_diff():
385              {'interface_name': s.interface_name,
386               'tx': s.tx,
387               'rx': s.rx,
388 +             'ipackets': s.ipackets,
389 +             'opackets': s.opackets,
390 +             'ierrors': s.ierrors,
391 +             'oerrors': s.oerrors,
392 +             'collisions': s.collisions,
393               'systime': s.systime,
394              }
395          ))
# Line 387 | Line 408 | def py_get_network_iface_stats():
408              {'interface_name': s.interface_name,
409               'speed': s.speed,
410               'dup': s.dup,
411 +             'up' : s.up,
412              }
413          ))
414          s = s + 1
# Line 415 | Line 437 | def py_get_page_stats_diff():
437      )
438  
439   def py_statgrab_init():
440 <    return statgrab_init()
440 >    if statgrab_init() == 0:
441 >        return True
442 >    else:
443 >        return False
444  
445   def py_statgrab_drop_privileges():
446 <    return statgrab_drop_privileges()
446 >    if statgrab_drop_privileges() == 0:
447 >        return True
448 >    else:
449 >        return False

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines