Changeset 31709e8d for lib/trace.c


Ignore:
Timestamp:
10/14/05 15:25:46 (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:
06a68c5
Parents:
5395ce6
Message:

Added SIMPLE_FUNCTION tag to hint to the compiler that if the function
is called twice, the result may be cached.

Fixed several documentation warnings

Fixed several "const" issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r5395ce6 r31709e8d  
    170170 * Prints out a descriptive error message for the currently set trace_err value
    171171 */
    172 void trace_perror(char *caller) {
     172void trace_perror(const char *caller) {
    173173        switch (trace_err.err_num) {
    174174                case E_BAD_FORMAT:
     
    206206 *
    207207 */
    208 char *trace_get_output_format(struct libtrace_out_t *libtrace) {
     208SIMPLE_FUNCTION
     209char *trace_get_output_format(const struct libtrace_out_t *libtrace) {
    209210        char * format = libtrace->format->name;
    210211
     
    236237 * and an error is output to stdout.
    237238 */
    238 struct libtrace_t *trace_create(char *uri) {
     239struct libtrace_t *trace_create(const char *uri) {
    239240        struct libtrace_t *libtrace = malloc(sizeof(struct libtrace_t));
    240241        char *scan = 0;
     
    304305 * that are not associated with a libtrace_t structure.
    305306 */
    306 struct libtrace_t * trace_create_dead (char *uri) {
     307struct libtrace_t * trace_create_dead (const char *uri) {
    307308        struct libtrace_t *libtrace = malloc(sizeof(struct libtrace_t));
    308309        char *scan = calloc(sizeof(char),URI_PROTO_LINE);
     
    357358 */
    358359       
    359 struct libtrace_out_t *trace_output_create(char *uri) {
     360struct libtrace_out_t *trace_output_create(const char *uri) {
    360361        struct libtrace_out_t *libtrace = malloc(sizeof(struct libtrace_out_t));
    361362       
     
    503504 * @author Shane Alcock
    504505 * */
    505 int trace_write_packet(struct libtrace_out_t *libtrace, struct libtrace_packet_t *packet) {
     506int trace_write_packet(struct libtrace_out_t *libtrace, const struct libtrace_packet_t *packet) {
    506507        assert(libtrace);
    507508        assert(packet);
     
    13651366}
    13661367
    1367 char * trace_parse_uri(char *uri, char **format) {
     1368char * trace_parse_uri(const char *uri, char **format) {
    13681369        char *uridata = 0;
    13691370       
Note: See TracChangeset for help on using the changeset viewer.