|
Packit Service |
646995 |
/*
|
|
Packit Service |
646995 |
* iSCSI variable-sized string buffers
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Copyright (C) 2002 Cisco Systems, Inc.
|
|
Packit Service |
646995 |
* maintained by linux-iscsi-devel@lists.sourceforge.net
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* This program is free software; you can redistribute it and/or modify
|
|
Packit Service |
646995 |
* it under the terms of the GNU General Public License as published
|
|
Packit Service |
646995 |
* by the Free Software Foundation; either version 2 of the License, or
|
|
Packit Service |
646995 |
* (at your option) any later version.
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* This program is distributed in the hope that it will be useful, but
|
|
Packit Service |
646995 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
646995 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
646995 |
* General Public License for more details.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* See the file COPYING included with this distribution for more details.
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#ifndef STRINGS_H
|
|
Packit Service |
646995 |
#define STRINGS_H
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
struct str_buffer {
|
|
Packit Service |
646995 |
size_t allocated_length;
|
|
Packit Service |
646995 |
size_t data_length; /* not including the trailing NUL */
|
|
Packit Service |
646995 |
char *buffer;
|
|
Packit Service |
646995 |
};
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
extern int str_init_buffer(struct str_buffer *s, size_t initial_allocation);
|
|
Packit Service |
646995 |
extern struct str_buffer *str_alloc_buffer(size_t initial_allocation);
|
|
Packit Service |
646995 |
extern void str_free_buffer(struct str_buffer *s);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
extern int str_enlarge_data(struct str_buffer *s, int length);
|
|
Packit Service |
646995 |
extern void str_remove_initial(struct str_buffer *s, int length);
|
|
Packit Service |
646995 |
extern void str_truncate_buffer(struct str_buffer *s, size_t length);
|
|
Packit Service |
646995 |
extern char *str_buffer_data(struct str_buffer *s);
|
|
Packit Service |
646995 |
extern size_t str_data_length(struct str_buffer *s);
|
|
Packit Service |
646995 |
extern size_t str_unused_length(struct str_buffer *s);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#endif /* STRINGS_H */
|