1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 09:50:29 +00:00

Reformatted some comments.

This commit is contained in:
Alexander Barton 2005-07-14 09:11:38 +00:00
parent efbfe4ae83
commit b682a5e485
2 changed files with 13 additions and 12 deletions

View File

@ -8,7 +8,7 @@
* libarray - dynamically allocate arrays. * libarray - dynamically allocate arrays.
* Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de) * Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de)
* *
* $Id: array.h,v 1.1 2005/07/07 18:38:14 fw Exp $ * $Id: array.h,v 1.2 2005/07/14 09:11:38 alex Exp $
*/ */
#ifndef array_h_included #ifndef array_h_included
@ -25,12 +25,11 @@ typedef struct {
/* allocated: mem != NULL, used >= 0 && used <= allocated, allocated > 0 /* allocated: mem != NULL, used >= 0 && used <= allocated, allocated > 0
unallocated: mem == NULL, allocated == 0, used == 0 */ unallocated: mem == NULL, allocated == 0, used == 0 */
#define array_unallocated(x) (array_bytes(x)==0) #define array_unallocated(x) (array_bytes(x)==0)
#define INIT_ARRAY { NULL, 0, 0 } #define INIT_ARRAY { NULL, 0, 0 }
/* allocates space for at least nmemb+1 elements of size bytes each. /* allocates space for at least nmemb+1 elements of size bytes each.
return pointer to elem at pos, or NULL if realloc() fails */ return pointer to elem at pos, or NULL if realloc() fails */
extern void * array_alloc PARAMS((array *a, unsigned int size, unsigned int pos)); extern void * array_alloc PARAMS((array *a, unsigned int size, unsigned int pos));
/* returns the number of initialized BYTES in a. */ /* returns the number of initialized BYTES in a. */
@ -40,8 +39,8 @@ extern void * array_alloc PARAMS((array *a, unsigned int size, unsigned int pos)
extern unsigned int array_length PARAMS((const array* const a, unsigned int elemsize)); extern unsigned int array_length PARAMS((const array* const a, unsigned int elemsize));
/* _copy functions: copy src to dest. /* _copy functions: copy src to dest.
return true if OK, else false. (e.g. realloc failure, invalid src/dest array, ..) return true if OK, else false (e. g. realloc failure, invalid src/dest
In that case dest is left unchanged. */ array, ...). In that case dest is left unchanged. */
/* copy array src to dest */ /* copy array src to dest */
extern bool array_copy PARAMS((array* dest, const array* const src)); extern bool array_copy PARAMS((array* dest, const array* const src));
@ -53,8 +52,8 @@ extern bool array_copyb PARAMS((array* dest, const char* src, unsigned int len))
extern bool array_copys PARAMS((array* dest, const char* src)); extern bool array_copys PARAMS((array* dest, const char* src));
/* _cat functions: append src to dest. /* _cat functions: append src to dest.
return true if OK, else false. (e.g. realloc failure, invalid src/dest array, ..) return true if OK, else false (e. g. realloc failure, invalid src/dest
In that case dest is left unchanged. */ array, ...). In that case dest is left unchanged. */
/* append len bytes from src to array dest. */ /* append len bytes from src to array dest. */
extern bool array_catb PARAMS((array* dest, const char* src, unsigned int len)); extern bool array_catb PARAMS((array* dest, const char* src, unsigned int len));
@ -69,8 +68,8 @@ extern bool array_cat0 PARAMS((array* dest));
extern bool array_cat PARAMS((array* dest, const array* const src)); extern bool array_cat PARAMS((array* dest, const array* const src));
/* return pointer to element at pos. /* return pointer to element at pos.
return NULL if the array is unallocated or if pos is larger than the number return NULL if the array is unallocated or if pos is larger than the number
of elements stored int the array. */ of elements stored int the array. */
extern void* array_get PARAMS((array* a, unsigned int membersize, unsigned int pos)); extern void* array_get PARAMS((array* a, unsigned int membersize, unsigned int pos));
/* free the contents of this array. */ /* free the contents of this array. */
@ -92,4 +91,5 @@ extern void array_truncate PARAMS((array* a, unsigned int membersize, unsigned i
extern void array_moveleft PARAMS((array* a, unsigned int membersize, unsigned int pos)); extern void array_moveleft PARAMS((array* a, unsigned int membersize, unsigned int pos));
#endif #endif
/* -eof- */ /* -eof- */

View File

@ -7,7 +7,7 @@
* *
* I/O abstraction interface header * I/O abstraction interface header
* *
* $Id: io.h,v 1.2 2005/07/09 20:22:29 fw Exp $ * $Id: io.h,v 1.3 2005/07/14 09:15:58 alex Exp $
*/ */
#ifndef io_H_inclucded #ifndef io_H_inclucded
@ -19,8 +19,9 @@
#define IO_WANTREAD 1 #define IO_WANTREAD 1
#define IO_WANTWRITE 2 #define IO_WANTWRITE 2
/* init library. sets up epoll/kqueue descriptors and tries to allocate space for ioevlen file descriptors. /* init library.
ioevlen is just the _initial_ size, not a limit. */ sets up epoll/kqueue descriptors and tries to allocate space for ioevlen
file descriptors. ioevlen is just the _initial_ size, not a limit. */
bool io_library_init PARAMS((unsigned int ioevlen)); bool io_library_init PARAMS((unsigned int ioevlen));
/* shutdown and free all internal data structures */ /* shutdown and free all internal data structures */