Changeset e6d963c for lib/trace.c


Ignore:
Timestamp:
05/02/06 00:08:58 (16 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
e093e5c
Parents:
ddd01fb
Message:

Style fixes, get rid of unnecessary "struct"'s

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r4927e86 re6d963c  
    258258 */
    259259DLLEXPORT SIMPLE_FUNCTION
    260 char *trace_get_output_format(const struct libtrace_out_t *libtrace) {
     260char *trace_get_output_format(const libtrace_out_t *libtrace) {
    261261        char * format = libtrace->format->name;
    262262
     
    289289 * and an error is output to stdout.
    290290 */
    291 DLLEXPORT struct libtrace_t *trace_create(const char *uri) {
    292         struct libtrace_t *libtrace =
    293                         (struct libtrace_t *)malloc(sizeof(struct libtrace_t));
     291DLLEXPORT libtrace_t *trace_create(const char *uri) {
     292        libtrace_t *libtrace =
     293                        (libtrace_t *)malloc(sizeof(libtrace_t));
    294294        char *scan = 0;
    295295        const char *uridata = 0;                 
     
    370370 * libtrace_packet_t's that are not associated with a libtrace_t structure.
    371371 */
    372 DLLEXPORT struct libtrace_t * trace_create_dead (const char *uri) {
    373         struct libtrace_t *libtrace = (struct libtrace_t *)
    374                                         malloc(sizeof(struct libtrace_t));
     372DLLEXPORT libtrace_t * trace_create_dead (const char *uri) {
     373        libtrace_t *libtrace = (libtrace_t *) malloc(sizeof(libtrace_t));
    375374        char *scan = (char *)calloc(sizeof(char),URI_PROTO_LINE);
    376375        char *uridata;
     
    419418DLLEXPORT libtrace_out_t *trace_create_output(const char *uri) {
    420419        libtrace_out_t *libtrace =
    421                         (libtrace_out_t*)malloc(sizeof(struct libtrace_out_t));
     420                        (libtrace_out_t*)malloc(sizeof(libtrace_out_t));
    422421       
    423422        char *scan = 0;
     
    490489 * the trace.  it may fail.
    491490 */
    492 DLLEXPORT int trace_start(struct libtrace_t *libtrace)
     491DLLEXPORT int trace_start(libtrace_t *libtrace)
    493492{
    494493        assert(libtrace);
     
    543542                        return 0;
    544543                case TRACE_OPTION_FILTER:
    545                         libtrace->filter=(struct libtrace_filter_t *)value;
     544                        libtrace->filter=(libtrace_filter_t *)value;
    546545                        return 0;
    547546                case TRACE_OPTION_PROMISC:
     
    563562 * @author Shane Alcock
    564563 */
    565 DLLEXPORT int trace_config_output(struct libtrace_out_t *libtrace,
     564DLLEXPORT int trace_config_output(libtrace_out_t *libtrace,
    566565                trace_option_output_t option,
    567566                void *value) {
     
    575574 *
    576575 */
    577 DLLEXPORT void trace_destroy(struct libtrace_t *libtrace) {
     576DLLEXPORT void trace_destroy(libtrace_t *libtrace) {
    578577        assert(libtrace);
    579578        if (libtrace->started && libtrace->format->pause_input)
     
    587586
    588587
    589 DLLEXPORT void trace_destroy_dead(struct libtrace_t *libtrace) {
     588DLLEXPORT void trace_destroy_dead(libtrace_t *libtrace) {
    590589        assert(libtrace);
    591590        free(libtrace);
     
    597596 * @author Shane Alcock
    598597 * */
    599 DLLEXPORT void trace_destroy_output(struct libtrace_out_t *libtrace) {
     598DLLEXPORT void trace_destroy_output(libtrace_out_t *libtrace) {
    600599        assert(libtrace);
    601600        libtrace->format->fin_output(libtrace);
     
    634633 * sideeffect: sets packet to NULL
    635634 */
    636 DLLEXPORT void trace_destroy_packet(struct libtrace_packet_t **packet) {
     635DLLEXPORT void trace_destroy_packet(libtrace_packet_t **packet) {
    637636        if ((*packet)->buf_control == TRACE_CTRL_PACKET) {
    638637                free((*packet)->buffer);
     
    696695 * @author Shane Alcock
    697696 * */
    698 DLLEXPORT int trace_write_packet(struct libtrace_out_t *libtrace, const struct libtrace_packet_t *packet) {
     697DLLEXPORT int trace_write_packet(libtrace_out_t *libtrace, const libtrace_packet_t *packet) {
    699698        assert(libtrace);
    700699        assert(packet);
     
    710709}
    711710
    712 DLLEXPORT void *trace_get_link(const struct libtrace_packet_t *packet) {
     711DLLEXPORT void *trace_get_link(const libtrace_packet_t *packet) {
    713712        return (void *)packet->payload;
    714713}
     
    799798 * @author Perry Lorier
    800799 */
    801 DLLEXPORT double trace_get_seconds(const struct libtrace_packet_t *packet) {
     800DLLEXPORT double trace_get_seconds(const libtrace_packet_t *packet) {
    802801        double seconds = 0.0;
    803802        uint64_t ts = 0;
     
    893892 * @author Perry Lorier
    894893 */
    895 DLLEXPORT struct libtrace_eventobj_t trace_event(struct libtrace_t *trace,
    896                 struct libtrace_packet_t *packet) {
    897         struct libtrace_eventobj_t event = {TRACE_EVENT_IOWAIT,0,0.0,0};
     894DLLEXPORT libtrace_eventobj_t trace_event(libtrace_t *trace,
     895                libtrace_packet_t *packet) {
     896        libtrace_eventobj_t event = {TRACE_EVENT_IOWAIT,0,0.0,0};
    898897
    899898        if (!trace) {
     
    920919 * @author Daniel Lawson
    921920 */
    922 DLLEXPORT struct libtrace_filter_t *trace_bpf_setfilter(const char *filterstring) {
     921DLLEXPORT libtrace_filter_t *trace_bpf_setfilter(const char *filterstring) {
    923922#if HAVE_BPF
    924         libtrace_filter_t *filter = (struct libtrace_filter_t*)
    925                                 malloc(sizeof(struct libtrace_filter_t));
     923        libtrace_filter_t *filter = (libtrace_filter_t*)
     924                                malloc(sizeof(libtrace_filter_t));
    926925        filter->filterstring = strdup(filterstring);
    927926        filter->flag = 0;
     
    1000999}
    10011000
    1002 DLLEXPORT int trace_bpf_filter(struct libtrace_filter_t *filter,
    1003                         const struct libtrace_packet_t *packet) {
     1001DLLEXPORT int trace_bpf_filter(libtrace_filter_t *filter,
     1002                        const libtrace_packet_t *packet) {
    10041003#if HAVE_BPF
    10051004        void *linkptr = 0;
     
    10341033 * @author Daniel Lawson
    10351034 */
    1036 DLLEXPORT int8_t trace_set_direction(struct libtrace_packet_t *packet, int8_t direction) {
     1035DLLEXPORT int8_t trace_set_direction(libtrace_packet_t *packet, int8_t direction) {
    10371036        assert(packet);
    10381037        assert(packet->size>0 && packet->size<65536);
     
    10521051 * @author Daniel Lawson
    10531052 */
    1054 DLLEXPORT int8_t trace_get_direction(const struct libtrace_packet_t *packet) {
     1053DLLEXPORT int8_t trace_get_direction(const libtrace_packet_t *packet) {
    10551054        assert(packet);
    10561055        assert(packet->size>0 && packet->size<65536);
     
    11861185 * @author Daniel Lawson
    11871186 */
    1188 DLLEXPORT size_t trace_set_capture_length(struct libtrace_packet_t *packet, size_t size) {
     1187DLLEXPORT size_t trace_set_capture_length(libtrace_packet_t *packet, size_t size) {
    11891188        assert(packet);
    11901189        assert(packet->size>0 && packet->size<65536);
     
    12221221}
    12231222
    1224 enum base_format_t trace_get_format(struct libtrace_packet_t *packet)
     1223enum base_format_t trace_get_format(libtrace_packet_t *packet)
    12251224{
    12261225        assert(packet);
Note: See TracChangeset for help on using the changeset viewer.