/*
********************************************************************************
- * Copyright (C) 2005-2006, International Business Machines
+ * Copyright (C) 2005-2007, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*/
#include "cmemory.h"
+U_NAMESPACE_USE
+
#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
#define NEW_ARRAY(type,count) (type *) uprv_malloc((count) * sizeof(type))
return;
}
- if (ucsd == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return;
- }
-
- CharsetDetector *csd = (CharsetDetector *) ucsd;
-
- csd->setText(textIn, len);
+ ((CharsetDetector *) ucsd)->setText(textIn, len);
}
U_CAPI const char * U_EXPORT2
return NULL;
}
- if (ucsm == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
- }
-
- CharsetMatch *csm = (CharsetMatch *) ucsm;
-
- return csm->getName();
+ return ((CharsetMatch *) ucsm)->getName();
}
U_CAPI int32_t U_EXPORT2
return 0;
}
- if (ucsm == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return 0;
- }
-
- CharsetMatch *csm = (CharsetMatch *) ucsm;
-
- return csm->getConfidence();
+ return ((CharsetMatch *) ucsm)->getConfidence();
}
U_CAPI const char * U_EXPORT2
return NULL;
}
- if (ucsm == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
- }
-
- CharsetMatch *csm = (CharsetMatch *) ucsm;
-
- return csm->getLanguage();
+ return ((CharsetMatch *) ucsm)->getLanguage();
}
U_CAPI const UCharsetMatch * U_EXPORT2
return NULL;
}
- if (ucsd == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
- }
-
- CharsetDetector *csd = (CharsetDetector *) ucsd;
-
- return (const UCharsetMatch *) csd->detect(*status);
+ return (const UCharsetMatch *) ((CharsetDetector *) ucsd)->detect(*status);
}
U_CAPI void U_EXPORT2
return;
}
- if (ucsd == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return;
- }
-
- CharsetDetector *csd = (CharsetDetector *) ucsd;
-
- csd->setDeclaredEncoding(encoding,length);
+ ((CharsetDetector *) ucsd)->setDeclaredEncoding(encoding,length);
}
U_CAPI const UCharsetMatch**
return NULL;
}
- if (ucsd == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
- }
-
CharsetDetector *csd = (CharsetDetector *) ucsd;
return (const UCharsetMatch**)csd->detectAll(*maxMatchesFound,*status);
return FALSE;
}
- CharsetDetector *csd = (CharsetDetector *) ucsd;
-
- return csd->getStripTagsFlag();
+ return ((CharsetDetector *) ucsd)->getStripTagsFlag();
}
U_CAPI UBool U_EXPORT2
return 0;
}
- if (ucsm == NULL) {
- *status = U_ILLEGAL_ARGUMENT_ERROR;
- return 0;
- }
-
- CharsetMatch *csm = (CharsetMatch *) ucsm;
-
- return csm->getUChars(buf, cap, status);
+ return ((CharsetMatch *) ucsm)->getUChars(buf, cap, status);
}
U_CDECL_END