//- // ========================================================================== // Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files are provided by Alias // Systems Corp. ("Alias") and/or its licensors for the exclusive use of the // Customer (as defined in the Alias Software License Agreement that // accompanies this Alias software). Such Customer has the right to use, // modify, and incorporate the Data into other products and to distribute such // products for use by end-users. // // THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES // RELATING TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR // IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES // WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY, // ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA. // ========================================================================== //+ #include /* // Function Name: // engineUtilStringsMatch // // Description: // A helper function to compare two strings // // Input Arguments: // EtByte *string1 The first string to compare // EtByte *string2 The second string to compare // // Return Value: // EtBoolean result A handle for the opened file // kEngineTRUE the two strings match // kEngineFALSE the two strings do not match */ EtBoolean engineUtilStringsMatch (EtByte *string1, EtByte *string2) { /* make sure both strings are valid */ if ((string1 == kEngineNULL) || (string2 == kEngineNULL)) { return (kEngineFALSE); } /* just in case both pointers are the same */ if (string1 == string2) { return (kEngineTRUE); } /* compare the two strings */ return (strcmp ((const char *)string1, (const char *)string2) == 0); } /* // Function Name: // engineUtilCopyString // // Description: // A helper function to copy one string to another // // Input Arguments: // EtByte *src The string to copy // EtByte *dest The string destination // // Return Value: // None */ EtVoid engineUtilCopyString (EtByte *src, EtByte *dest) { /* make sure both strings are valid */ if ((src == kEngineNULL) || (dest == kEngineNULL)) { return; } /* copy the string */ strcpy ((char *)dest, (const char *)src); } /* // Function Name: // engineUtilAllocate // // Description: // A helper function to allocate a block of memory // // Input Arguments: // EtInt bytes The number of bytes to allocate // // Return Value: // EtByte *block A pointer to the requested memory block */ EtByte * engineUtilAllocate (EtInt bytes) { return (malloc (bytes)); } /* // Function Name: // engineUtilFree // // Description: // A helper function to free a block of memory allocated using // engineUtilAllocate // // Input Arguments: // EtByte *block A pointer to the memory block to free // // Return Value: // None */ EtVoid engineUtilFree (EtByte *block) { if (block != kEngineNULL) { free (block); } }