PageRenderTime 98ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/stream.h

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
C++ Header | 57 lines | 25 code | 14 blank | 18 comment | 0 complexity | 6bcffb2306c5505cce174f8fbc389052 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. /*
  2. stream.h - `Stream' object
  3. Copyright (C) 2008 siliconforks.com
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #ifndef STREAM_H_
  17. #define STREAM_H_
  18. #include <stdio.h>
  19. #include <stdint.h>
  20. #include <stdlib.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. typedef struct Stream {
  25. uint8_t * data;
  26. size_t length;
  27. size_t capacity;
  28. } Stream;
  29. Stream * Stream_new(size_t capacity);
  30. void Stream_write(Stream * stream, const void * p, size_t size);
  31. void Stream_write_string(Stream * stream, const char * s);
  32. void Stream_write_char(Stream * stream, char c);
  33. void Stream_printf(Stream * stream, const char * format, ...) __attribute__((format(printf, 2, 3)));
  34. void Stream_write_file_contents(Stream * stream, FILE * f);
  35. void Stream_reset(Stream * stream);
  36. void Stream_delete(Stream * stream);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif /* STREAM_H_ */