src/SDL_dataqueue.h
changeset 10743 8ccdeceaae6d
parent 10737 3406a0f8b041
child 11582 cc0b1273a381
equal deleted inserted replaced
10742:3034ea08d805 10743:8ccdeceaae6d
    31 void SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack);
    31 void SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack);
    32 int SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *data, const size_t len);
    32 int SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *data, const size_t len);
    33 size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *buf, const size_t len);
    33 size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *buf, const size_t len);
    34 size_t SDL_CountDataQueue(SDL_DataQueue *queue);
    34 size_t SDL_CountDataQueue(SDL_DataQueue *queue);
    35 
    35 
       
    36 /* this sets a section of the data queue aside (possibly allocating memory for it)
       
    37    as if it's been written to, but returns a pointer to that space. You may write
       
    38    to this space until a read would consume it. Writes (and other calls to this
       
    39    function) will safely append their data after this reserved space and can
       
    40    be in flight at the same time. There is no thread safety.
       
    41    If there isn't an existing block of memory that can contain the reserved
       
    42    space, one will be allocated for it. You can not (currently) allocate
       
    43    a space larger than the packetlen requested in SDL_NewDataQueue.
       
    44    Returned buffer is uninitialized.
       
    45    This lets you avoid an extra copy in some cases, but it's safer to use
       
    46    SDL_WriteToDataQueue() unless you know what you're doing.
       
    47    Returns pointer to buffer of at least (len) bytes, NULL on error.
       
    48 */
       
    49 void *SDL_ReserveSpaceInDataQueue(SDL_DataQueue *queue, const size_t len);
       
    50 
    36 #endif /* SDL_dataqueue_h_ */
    51 #endif /* SDL_dataqueue_h_ */
    37 
    52 
    38 /* vi: set ts=4 sw=4 expandtab: */
    53 /* vi: set ts=4 sw=4 expandtab: */
    39 
    54