|
int | _xprintf (const char *const xprintf_file, const char *const xprintf_func, const int xprintf_line, MessageType type, const char *const fmt,...) |
| Multi-purpose printing routine: messages, warnings, errors. More...
|
|
void * | xmalloc (size_t size) |
| Memory allocation with checking. More...
|
|
void * | xrealloc (void *ptr, size_t size) |
| Reallocation of memory block with checking. More...
|
|
void * | operator new (std::size_t size) OPERATOR_NEW_THROW_EXCEPTION |
| test & free memory More...
|
|
void * | operator new[] (std::size_t size) OPERATOR_NEW_THROW_EXCEPTION |
|
void * | operator new[] (std::size_t size, const std::nothrow_t &) throw () |
|
void | operator delete (void *p) throw () |
|
void | operator delete[] (void *p) throw () |
|
int | xsystem (const char *cmd) |
| SYSTEM with err handling. More...
|
|
char * | xstrcpy (const char *src) |
| MAKE BRAND NEW COPY OF STRING. More...
|
|
char * | xstrtok (char *s, int position) |
| STRTOK WITH ERROR HANDLING and whitespace delimiters. More...
|
|
char * | xstrtok (char *s1, const char *delim, int position) |
| STRTOK WITH ERROR HANDLING and user specified delimiters. More...
|
|
int | xchomp (char *s) |
| Delete trailing whitespace characters (space,tab,CR,NL). More...
|
|
int | xmkdir (const char *s) |
| MKDIR WITH ERROR HANDLING. More...
|
|
int | xrmdir (const char *s) |
| RMDIR with err handling. More...
|
|
int | xchdir (const char *s) |
| CHDIR WITH ERROR HANDLING. More...
|
|
int | xremove (const char *fname) |
| DELETE a FILE with error handling. More...
|
|
char * | xgetcwd (void) |
| GET CURRENT WORKING DIRECTORY with error handling. More...
|
|
Various system-wide functions.
Copyright (C) 2007 Technical University of Liberec. All rights reserved.
Please make a following refer to Flow123d on your project site if you use the program for any purpose, especially for academic research: Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
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.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
$Id$ $Revision$ $LastChangedBy$ $LastChangedDate$
Definition in file system.cc.
void* xrealloc |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
Reallocation of memory block with checking.
Reallocates memory block with checking of successful reallocation. The size of the memory block pointed to by the ptr parameter is changed to the size bytes, expanding or reducing the amount of memory available in the block.
The function may move the memory block to a new location, in which case the new location is returned. The content of the memory block is preserved up to the lesser of the new and old sizes, even if the block is moved. If the new size is larger, the value of the newly allocated portion is indeterminate.
In case that ptr is NULL, the function behaves exactly as malloc, assigning a new block of size bytes and returning a pointer to the beginning of it.
In case that the size is 0, the memory previously allocated in ptr is deallocated as if a call to free was made, and a NULL pointer is returned.
- Parameters
-
[in] | ptr | Pointer to a memory block previously allocated |
[in] | size | New size for the memory block, in bytes. |
- Returns
- same as ISO C realloc()
Definition at line 243 of file system.cc.