| Index: native_client_sdk/src/libraries/nacl_io/fifo_char.h | 
| diff --git a/native_client_sdk/src/libraries/nacl_io/fifo_char.h b/native_client_sdk/src/libraries/nacl_io/fifo_char.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..f6aa182b49f817aee181fcc2f747a856085fe58a | 
| --- /dev/null | 
| +++ b/native_client_sdk/src/libraries/nacl_io/fifo_char.h | 
| @@ -0,0 +1,47 @@ | 
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef LIBRARIES_NACL_IO_FIFO_CHAR_H_ | 
| +#define LIBRARIES_NACL_IO_FIFO_CHAR_H_ | 
| + | 
| +#include <stdint.h> | 
| +#include <stdlib.h> | 
| + | 
| +namespace nacl_io { | 
| + | 
| +class  FIFOChar { | 
| + public: | 
| +  explicit FIFOChar(size_t size); | 
| +  virtual ~FIFOChar(); | 
| + | 
| +  virtual bool IsEmpty(); | 
| +  virtual bool IsFull(); | 
| +  virtual bool Resize(size_t len); | 
| + | 
| +  size_t ReadAvailable(); | 
| +  size_t WriteAvailable(); | 
| + | 
| +  // Reads out no more than the requested len without updating the tail. | 
| +  // Returns actual amount read. | 
| +  size_t Peek(char* buf, size_t len); | 
| + | 
| +  // Reads out the data making room in the FIFO.  Returns actual amount | 
| +  // read. | 
| +  size_t Read(char* buf, size_t len); | 
| + | 
| +  // Writes into the FIFO no more than len bytes, returns actual amount | 
| +  // written. | 
| +  size_t Write(const char* buf, size_t len); | 
| + | 
| + | 
| +private: | 
| +  char* buffer_; | 
| +  size_t size_;   // Size of the FIFO | 
| +  size_t avail_;  // How much data is currently available | 
| +  size_t tail_;   // Next read location | 
| +}; | 
| + | 
| +}  // namespace nacl_io | 
| + | 
| +#endif  // LIBRARIES_NACL_IO_FIFO_CHAR_H_ | 
|  |