Exemple #1
0
int le_write(le_TcpConnection* connection, le_WriteReq* req, le_Buffer bufs[], int bufCount, le_writeCB cb) {
	int bufRemainSize;

	if( !(connection->masks & LE_CONNECTION) ) {
		le_setErrorCode(connection->loop, EINVAL);
		return LE_ERROR;
	}

	if( connection->masks & LE_SHUTDOWN_WRITE ) {
		le_setErrorCode(connection->loop, ESHUTDOWN);
		return LE_ERROR;
	}

	if( bufCount > MAX_BUFS_COUNT || bufCount < 1 ) {
		le_setErrorCode(connection->loop, EINVAL);
		return LE_ERROR;
	}

	le_initWriteReq(connection, req, bufs, bufCount, cb);

	if( bufCount <= LE_ARRAY_SIZE(req->bufsml) ) {
		req->bufs = req->bufsml;
	} else {
		req->bufs = le_malloc(bufCount * sizeof(le_Buffer));
	}

	le_initWriteReqBufs(req, bufs, bufCount);
	bufRemainSize = connection->writeTotalSize;
	le_queueAdd(&connection->writeReqHead, &req->writeReqNode);
	connection->writeTotalSize += req->totalSize;

	if( bufRemainSize == 0 ) {
		le_processWriting(connection);
		if( connection->writeTotalSize > 0 ) {
			le_addEvent(connection->loop, &connection->basicEvent, EPOLLOUT);
		}
	}

	return LE_OK;
}
    {abvfFeatureTag, abvfFeatureMask},
    {pstfFeatureTag, pstfFeatureMask},
    {presFeatureTag, presFeatureMask},
    {blwsFeatureTag, blwsFeatureMask},
    {abvsFeatureTag, abvsFeatureMask},
    {pstsFeatureTag, pstsFeatureMask},
    {cligFeatureTag, cligFeatureMask},

    // Positioning features
    {distFeatureTag, distFeatureMask},
    {blwmFeatureTag, blwmFeatureMask},
    {abvmFeatureTag, abvmFeatureMask},
    {mkmkFeatureTag, mkmkFeatureMask},
};

static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap);

// The stateTable is used to calculate the end (the length) of a well
// formed Khmer Syllable.
//
// Each horizontal line is ordered exactly the same way as the values
// in KhmerClassTable CharClassValues in KhmerReordering.h This
// coincidence of values allows the follow up of the table.
//
// Each line corresponds to a state, which does not necessarily need
// to be a type of component... for example, state 2 is a base, with
// is always a first character in the syllable, but the state could be
// produced a consonant of any type when it is the first character
// that is analysed (in ground state).
//
// Differentiating 3 types of consonants is necessary in order to
Exemple #3
0
const FeatureMap *ArabicShaping::getFeatureMap(le_int32 &count)
{
    count = LE_ARRAY_SIZE(featureMap);

    return featureMap;
}
Exemple #4
0
#include "MorphTables.h"

#include "DefaultCharMapper.h"

#include "KernTable.h"

U_NAMESPACE_BEGIN

const LEUnicode32 DefaultCharMapper::controlChars[] = {
    0x0009, 0x000A, 0x000D,
    /*0x200C, 0x200D,*/ 0x200E, 0x200F,
    0x2028, 0x2029, 0x202A, 0x202B, 0x202C, 0x202D, 0x202E,
    0x206A, 0x206B, 0x206C, 0x206D, 0x206E, 0x206F
};

const le_int32 DefaultCharMapper::controlCharsCount = LE_ARRAY_SIZE(controlChars);

LEUnicode32 DefaultCharMapper::mapChar(LEUnicode32 ch) const
{
    if (fFilterControls) {
        le_int32 index = OpenTypeUtilities::search((le_uint32)ch, (le_uint32 *)controlChars, controlCharsCount);

        if (controlChars[index] == ch) {
            return 0xFFFF;
        }
    }

    if (fMirror) {
        le_int32 index = OpenTypeUtilities::search((le_uint32) ch, (le_uint32 *)DefaultCharMapper::mirroredChars, DefaultCharMapper::mirroredCharsCount);

        if (mirroredChars[index] == ch) {