Differences From Artifact [1f3d504a05]:
- File
src/stream.c
— part of check-in
[17c1d8f6b0]
at
2012-09-29 22:34:49
on branch trunk
— Add tcpsocket.
TODO:
* check for getaddrinfo() in configure
* fallback if getaddrinfo() is unavailable (user: js, size: 2472) [annotate] [blame] [check-ins using]
To Artifact [5dca9bcc2f]:
- File src/stream.c — part of check-in [2121a00059] at 2012-09-29 22:41:59 on branch trunk — Add cfw_stream_write_string(). (user: js, size: 2604) [annotate] [blame] [check-ins using]
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | + + | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <string.h> #include "stream.h" static bool ctor(void *ptr, va_list args) { CFWStream *stream = ptr; |
︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + + + + + + | CFWStream *stream = ptr; if (stream == NULL || stream->ops == NULL) return false; return stream->ops->write(stream, buf, len); } bool cfw_stream_write_string(void *ptr, const char *str) { return cfw_stream_write(ptr, str, strlen(str)); } bool cfw_stream_eof(void *ptr) { CFWStream *stream = ptr; if (stream == NULL || stream->ops == NULL) |
︙ |