* @brief Write arbitrary binary data to sequence file buffer * * @param[in,out] seq Pointer to sequence file structure * @param[in] data Pointer to data to be written * @param[in] len Length of data in bytes * * @return int 0 on success, -1 if buffer overflow occurs */
| 477 | * @return int 0 on success, -1 if buffer overflow occurs |
| 478 | */ |
| 479 | int dfs_seq_write(struct dfs_seq_file *seq, const void *data, size_t len) |
| 480 | { |
| 481 | if (seq->count + len < seq->size) |
| 482 | { |
| 483 | rt_memcpy(seq->buf + seq->count, data, len); |
| 484 | seq->count += len; |
| 485 | return 0; |
| 486 | } |
| 487 | dfs_seq_overflow(seq); |
| 488 | return -1; |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * @brief Pad the sequence file buffer with spaces and optionally append a character |
no test coverage detected