src/line_proto.h
changeset 17 5001564ac5fc
parent 12 4147fae232d9
child 18 dedf137b504f
equal deleted inserted replaced
16:20ce0029e4a0 17:5001564ac5fc
    13 struct line_proto;
    13 struct line_proto;
    14 
    14 
    15 /*
    15 /*
    16  * The callback for receiving lines
    16  * The callback for receiving lines
    17  */
    17  */
    18 typedef void (*line_proto_read_cb)(const char *line, void *arg);
    18 typedef void (*line_proto_read_cb)(char *line, void *arg);
    19 
    19 
    20 /*
    20 /*
    21  * Create a new line_proto off the the given sock_stream. The newly allocated line_proto will be returned via *lp_ptr.
    21  * Create a new line_proto off the the given sock_stream. The newly allocated line_proto will be returned via *lp_ptr.
    22  *
    22  *
    23  * The incoming lines are buffered in a buffer of \a buf_size bytes. This imposes a maximum limit on the line length.
    23  * The incoming lines are buffered in a buffer of \a buf_size bytes. This imposes a maximum limit on the line length.
    30 /*
    30 /*
    31  * Runs the socket recv() into our internal buffer. If a full line was received, a pointer to our internal bufffer is
    31  * Runs the socket recv() into our internal buffer. If a full line was received, a pointer to our internal bufffer is
    32  * returned via *line_ptr, and we return SUCCESS. If we don't yet have a full line, and receiving more would block,
    32  * returned via *line_ptr, and we return SUCCESS. If we don't yet have a full line, and receiving more would block,
    33  * NULL is returned via *line_ptr instead. Otherwise, nonzero error return code.
    33  * NULL is returned via *line_ptr instead. Otherwise, nonzero error return code.
    34  */
    34  */
    35 err_t line_proto_read (struct line_proto *lp, const char **line_ptr);
    35 err_t line_proto_read (struct line_proto *lp, char **line_ptr);
    36 
    36 
    37 /*
    37 /*
    38  * Signify that the line read with line_proto_read() was handled and can be discarded
    38  * Signify that the line read with line_proto_read() was handled and can be discarded
    39  */
    39  */
    40 void line_proto_discard (struct line_proto *lp);
    40 void line_proto_discard (struct line_proto *lp);