📄 string-buffer.h
字号:
/* * iSCSI driver for Linux * Copyright (C) 2002 Cisco Systems, Inc. * maintained by linux-iscsi-devel@lists.sourceforge.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * See the file COPYING included with this distribution for more details. * * $Id: string-buffer.h,v 1.3 2004/06/11 12:07:53 bhojas Exp $ * * string-buffer.h * * variable-sized string buffers * */#ifndef STRING_BUFFER_H_#define STRING_BUFFER_H_struct string_buffer { size_t allocated_length; size_t data_length; /* not including the trailing NUL */ char *buffer;};extern int init_string_buffer(struct string_buffer *s, size_t initial_allocation);extern struct string_buffer *alloc_string_buffer(size_t initial_allocation);extern void free_string_buffer(struct string_buffer *s);extern void enlarge_data(struct string_buffer *s, int length);extern void remove_initial(struct string_buffer *s, int length);extern void truncate_buffer(struct string_buffer *s, size_t length);extern int append_string(struct string_buffer *s, const char *str);extern int append_sprintf(struct string_buffer *s, const char *format, ...);extern int adjoin_string(struct string_buffer *s, const char *str);extern char *buffer_data(struct string_buffer *s);extern size_t data_length(struct string_buffer *s);extern size_t unused_length(struct string_buffer *s);extern void write_buffer(struct string_buffer *s, int fd);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -