Navigation


Changeset 1194:90d1222a65a8 in freeDiameter for libfdcore


Ignore:
Timestamp:
Jun 11, 2013, 3:04:40 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Rename HOOK_PEER_LAST to HOOK_LAST

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/hooks.c

    r1186 r1194  
    5656/* Now a hook registered by an extension */
    5757struct fd_hook_hdl {
    58         struct fd_list chain[HOOK_PEER_LAST+1];
     58        struct fd_list chain[HOOK_LAST+1];
    5959        void (*fd_hook_cb)(enum fd_hook_type type, struct msg * msg, struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata);
    6060        void  *regdata;
     
    6666        struct fd_list sentinel;
    6767        pthread_rwlock_t rwlock;
    68 } HS_array[HOOK_PEER_LAST+1];
     68} HS_array[HOOK_LAST+1];
    6969
    7070/* Initialize the array of sentinels for the hooks */
     
    7272{
    7373        int i;
    74         for (i=0; i <= HOOK_PEER_LAST; i++) {
     74        for (i=0; i <= HOOK_LAST; i++) {
    7575                fd_list_init(&HS_array[i].sentinel, NULL);
    7676                CHECK_POSIX( pthread_rwlock_init(&HS_array[i].rwlock, NULL) );
     
    129129        newhdl->data_hdl = data_hdl;
    130130       
    131         for (i=0; i <= HOOK_PEER_LAST; i++) {
     131        for (i=0; i <= HOOK_LAST; i++) {
    132132                fd_list_init(&newhdl->chain[i], newhdl);
    133133                if (type_mask & (1<<i)) {
     
    149149        CHECK_PARAMS( handler );
    150150       
    151         for (i=0; i <= HOOK_PEER_LAST; i++) {
     151        for (i=0; i <= HOOK_LAST; i++) {
    152152                if ( ! FD_IS_LIST_EMPTY(&handler->chain[i])) {
    153153                        CHECK_POSIX( pthread_rwlock_wrlock(&HS_array[i].rwlock) );
     
    272272        va_start(ap, dummy);
    273273        while ((next = va_arg(ap, int)) >= 0) {
    274                 if (next > HOOK_PEER_LAST)
     274                if (next > HOOK_LAST)
    275275                        break; /* invalid parameter */
    276276                ret |= (1<<next);
     
    285285{
    286286        struct fd_list * li;
    287         ASSERT(type <= HOOK_PEER_LAST);
     287        ASSERT(type <= HOOK_LAST);
    288288        int call_default = 0;
    289289       
Note: See TracChangeset for help on using the changeset viewer.