GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

GATUtil.c File Reference

Source file for the different utility functions used throughout the GAT engine. More...

#include <stdlib.h>
#include <string.h>
#include "GATUtil.h"
#include "GATErrors.h"

Include dependency graph for GATUtil.c:

Include dependency graph

Go to the source code of this file.

Functions

char * GATUtil_strdup (char const *str)
 char *GATUtil_strdup(char const *str) Make a copy of a given string

void * GATUtil_memdup (void const *buffer, GATuint32 size)
 void *GATUtil_memdup(void const *str, GATuint32 size) Make a copy of a given memory buffer

GATResult GATUtil_appendstring (char **str, char const *to_append)
 GATUtil_appendstring Append a string to a given string.


Variables

const char * rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATUtil.c,v 1.6 2004/04/05 11:49:44 hartmutkaiser Exp $"


Detailed Description

Source file for the different utility functions used throughout the GAT engine.

Date:
Mon Oct 20 2003
Version:
Header:
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATUtil.c,v 1.6 2004/04/05 11:49:44 hartmutkaiser Exp

Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.

Use, modification and distribution is subject to the Gridlab Software License. (See accompanying file GLlicense.txt or copy at http://www.gridlab.org/GLlicense.txt)

Definition in file GATUtil.c.


Function Documentation

char* GATUtil_strdup char const *    str
 

char *GATUtil_strdup(char const *str) Make a copy of a given string

The function GATUtil_strdup allocates a new copy of the given string. The return value should be free'd by the caller by means of the function free(). Since strdup isn't POSIX, we need to provide our own.

Parameters:
str  The string to be copied.
Returns:
Returns the allocated string copy.

Definition at line 39 of file GATUtil.c.

References str.

Referenced by AdaptorInstance_Create(), add_field(), AddToAdaptorConfig(), advertservice_adapter_resolve_path(), advertservice_db_find_node(), advertservice_db_get_node_data(), GATAdvertService_ExtractName(), GATAdvertService_ResolvePath(), GATConfig_AddAdaptorConfig(), GATConfig_Create(), GATLocation_DeSerialise_Create(), GATMetric_Clone(), GATMetric_Create(), GATRequest_Clone(), GATRequest_Create(), GATReservation_Create(), GATTable_Internal_CloneKey_String(), and logical_filestore_create().

void* GATUtil_memdup void const *    buffer,
GATuint32    size
 

void *GATUtil_memdup(void const *str, GATuint32 size) Make a copy of a given memory buffer

The function GATUtil_memdup allocates a new copy of the given memory buffer. The return value should be free'd by the caller by means of the function free().

Parameters:
buffer  The memory buffer to be copied.
Returns:
Returns the allocated memory buffer copy.

Definition at line 62 of file GATUtil.c.

References GATuint32, and size.

Referenced by GATMetricEvent_Clone(), GATMetricEvent_Create_EventLike(), and GATTable_Default_Clone_Key().

GATResult GATUtil_appendstring char **    str,
char const *    to_append
 

GATUtil_appendstring Append a string to a given string.

The function GATUtil_appendstring appends a string to a given string assuming, that the given string was allocated by malloc.

Parameters:
str  The pointer to the string pointer, which contains the string to which the to_append string should be appended. May be zero, in wich case a new buffer is allocated and returned.
to_append  The string to append
Returns:
An error code.

Definition at line 86 of file GATUtil.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GATBool, GATFalse, GATTrue, and str.

Referenced by advertservice_adapter_resolve_path(), and GATAdvertService_ResolvePath().


Variable Documentation

const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATUtil.c,v 1.6 2004/04/05 11:49:44 hartmutkaiser Exp $" [static]
 

Definition at line 18 of file GATUtil.c.