Changeset 5ba34eb for lib/data-struct


Ignore:
Timestamp:
06/23/14 23:35:44 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
5876154
Parents:
ed81f74
Message:

Remove inlines for BSD support

Location:
lib/data-struct
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/message_queue.c

    rfac8c46 r5ba34eb  
    1616 *                see: man 7 pipe notes on atomic operations
    1717 */
    18 inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
     18void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
    1919{
    2020        assert(message_len);
     
    4141 *         of messages.
    4242 */
    43 inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message)
     43int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message)
    4444{
    4545        int ret;
     
    6666 *         of messages.
    6767 */
    68 inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message)
     68int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message)
    6969{
    7070        int ret;
     
    9090 *         of messages.
    9191 */
    92 inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message)
     92int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message)
    9393{
    9494        int ret;
     
    113113 * May be negative if threads blocking and waiting for a message.
    114114 */
    115 inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq)
     115int libtrace_message_queue_count(const libtrace_message_queue_t *mq)
    116116{
    117117        // This is only ok because we know int is atomic
     
    119119}
    120120
    121 inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq)
     121void libtrace_message_queue_destroy(libtrace_message_queue_t *mq)
    122122{
    123123        mq->message_count = 0;
     
    131131 * @return a file descriptor for the queue, can be used with select() poll() etc.
    132132 */
    133 inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq)
     133int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq)
    134134{
    135135        return mq->pipefd[0];
  • lib/data-struct/message_queue.h

    r8c42377 r5ba34eb  
    1313} libtrace_message_queue_t;
    1414
    15 inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
    16 inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
    17 inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
    18 inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
    19 inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
    20 inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
    21 inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
     15void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
     16int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
     17int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
     18int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
     19int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
     20void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
     21int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
    2222
    2323#endif
  • lib/data-struct/sliding_window.c

    read9478 r5ba34eb  
    1414 *                              NOTE: this mainly applies to the blocking functions
    1515 */
    16 inline void libtrace_slidingwindow_init(libtrace_slidingwindow_t *sw, size_t size, uint64_t start_number) {
     16void libtrace_slidingwindow_init(libtrace_slidingwindow_t *sw, size_t size, uint64_t start_number) {
    1717        sw->size = size; // All of this size can be used
    1818        sw->start = 0;
     
    2727 * @param rb The ringbuffer to destroy
    2828 */
    29 inline void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t *sw) {
     29void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t *sw) {
    3030        sw->size = 0;
    3131        sw->start = 0;
     
    4646 * @return 1 if a object was written otherwise 0.
    4747 */
    48 inline int libtrace_slidingwindow_try_write(libtrace_slidingwindow_t *sw, uint64_t number, void* value) {
     48int libtrace_slidingwindow_try_write(libtrace_slidingwindow_t *sw, uint64_t number, void* value) {
    4949        uint64_t adjusted_number = number - sw->start_number;
    5050        if (adjusted_number < sw->size) {
     
    6262}
    6363
    64 inline uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw) {
     64uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw) {
    6565        return sw->elements[sw->start] != NULL;
    6666}
     
    7474 * @return 1 if a object was received otherwise 0, in this case out remains unchanged
    7575 */
    76 inline int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number) {
     76int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number) {
    7777        if (sw->elements[sw->start]) {
    7878                *value = sw->elements[sw->start];
     
    8888}
    8989
    90 inline void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw)
     90void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw)
    9191{
    9292        sw->start = 0;
  • lib/data-struct/sliding_window.h

    read9478 r5ba34eb  
    1818
    1919void libtrace_slidingwindow_init(libtrace_slidingwindow_t * sw, size_t size, uint64_t start_number);
    20 inline void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw);
     20void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw);
    2121void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t * sw);
    2222
     
    3232int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number);
    3333
    34 inline uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw);
     34uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw);
    3535/*
    3636void libtrace_slidingwindow_swrite(libtrace_slidingwindow_t * sw, void* value);
Note: See TracChangeset for help on using the changeset viewer.