| OLD | NEW |
| 1 /* crypto/pqueue/pqueue.h */ | 1 /* crypto/pqueue/pqueue.h */ |
| 2 /* | 2 /* |
| 3 * DTLS implementation written by Nagendra Modadugu | 3 * DTLS implementation written by Nagendra Modadugu |
| 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
| 5 */ | 5 */ |
| 6 /* ==================================================================== | 6 /* ==================================================================== |
| 7 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. | 7 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. |
| 8 * | 8 * |
| 9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
| 10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 * | 57 * |
| 58 */ | 58 */ |
| 59 | 59 |
| 60 #ifndef HEADER_PQUEUE_H | 60 #ifndef HEADER_PQUEUE_H |
| 61 #define HEADER_PQUEUE_H | 61 #define HEADER_PQUEUE_H |
| 62 | 62 |
| 63 #include <stdio.h> | 63 #include <stdio.h> |
| 64 #include <stdlib.h> | 64 #include <stdlib.h> |
| 65 #include <string.h> | 65 #include <string.h> |
| 66 | 66 |
| 67 #include <openssl/pq_compat.h> | |
| 68 | |
| 69 typedef struct _pqueue *pqueue; | 67 typedef struct _pqueue *pqueue; |
| 70 | 68 |
| 71 typedef struct _pitem | 69 typedef struct _pitem |
| 72 { | 70 { |
| 73 » PQ_64BIT priority; | 71 » unsigned char priority[8]; /* 64-bit value in big-endian encoding */ |
| 74 void *data; | 72 void *data; |
| 75 struct _pitem *next; | 73 struct _pitem *next; |
| 76 } pitem; | 74 } pitem; |
| 77 | 75 |
| 78 typedef struct _pitem *piterator; | 76 typedef struct _pitem *piterator; |
| 79 | 77 |
| 80 pitem *pitem_new(PQ_64BIT priority, void *data); | 78 pitem *pitem_new(unsigned char *prio64be, void *data); |
| 81 void pitem_free(pitem *item); | 79 void pitem_free(pitem *item); |
| 82 | 80 |
| 83 pqueue pqueue_new(void); | 81 pqueue pqueue_new(void); |
| 84 void pqueue_free(pqueue pq); | 82 void pqueue_free(pqueue pq); |
| 85 | 83 |
| 86 pitem *pqueue_insert(pqueue pq, pitem *item); | 84 pitem *pqueue_insert(pqueue pq, pitem *item); |
| 87 pitem *pqueue_peek(pqueue pq); | 85 pitem *pqueue_peek(pqueue pq); |
| 88 pitem *pqueue_pop(pqueue pq); | 86 pitem *pqueue_pop(pqueue pq); |
| 89 pitem *pqueue_find(pqueue pq, PQ_64BIT priority); | 87 pitem *pqueue_find(pqueue pq, unsigned char *prio64be); |
| 90 pitem *pqueue_iterator(pqueue pq); | 88 pitem *pqueue_iterator(pqueue pq); |
| 91 pitem *pqueue_next(piterator *iter); | 89 pitem *pqueue_next(piterator *iter); |
| 92 | 90 |
| 93 void pqueue_print(pqueue pq); | 91 void pqueue_print(pqueue pq); |
| 94 int pqueue_size(pqueue pq); | 92 int pqueue_size(pqueue pq); |
| 95 | 93 |
| 96 #endif /* ! HEADER_PQUEUE_H */ | 94 #endif /* ! HEADER_PQUEUE_H */ |
| OLD | NEW |