if (U_FAILURE(*status) && *status != U_BUFFER_OVERFLOW_ERROR) { return -1;
}
if (U_SUCCESS(*status) && result == 0) {
currentBufferSize = DEFAULT_BUFFER_SIZE;
}
return result;
}
/* * Extract the setting after the '=' and store it in flag excluding the newline character.
*/ static int32_t extractFlag(char* buffer, int32_t bufferSize, char* flag, int32_t flagSize, constchar **flagNames, int32_t numOfFlags, UErrorCode *status) {
int32_t i, idx = -1; char *pBuffer;
int32_t offset=0;
UBool bufferWritten = false;
if (buffer[0] != 0) { /* Get the offset (i.e. position after the '=') */
offset = getFlagOffset(buffer, bufferSize);
pBuffer = buffer+offset; for(i = 0;;i++) { if (i >= flagSize) {
*status = U_BUFFER_OVERFLOW_ERROR; return -1;
} if (pBuffer[i+1] == 0) { /* Indicates a new line character. End here. */
flag[i] = 0; break;
}
flag[i] = pBuffer[i]; if (i == 0) {
bufferWritten = true;
}
}
}
if (!bufferWritten) {
flag[0] = 0;
}
if (flagNames != nullptr && offset>0) {
offset--; /* Move offset back 1 because of '='*/ for (i = 0; i < numOfFlags; i++) { if (uprv_strncmp(buffer, flagNames[i], offset) == 0) {
idx = i; break;
}
}
}
return idx;
}
/* * Get the position after the '=' character.
*/ static int32_t getFlagOffset(constchar *buffer, int32_t bufferSize) {
int32_t offset = 0;
for (offset = 0; offset < bufferSize;offset++) { if (buffer[offset] == '=') {
offset++; break;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.