Ejemplo n.º 1
0
char RawLD::getEntry(long away) const
{
    uint32_t start = 0;
    uint16_t size = 0;
    char *idxbuf = 0;
    char retval = 0;

    char *buf = new char [ strlen(*key) + 6 ];
    strcpy(buf, *key);

    if (strongsPadding) strongsPad(buf);

    if (!(retval = findOffset(buf, &start, &size, away))) {
        readText(start, &size, &idxbuf, entryBuf);
        rawFilter(entryBuf, 0);    // hack, decipher
        rawFilter(entryBuf, key);
        entrySize = size;        // support getEntrySize call
        if (!key->isPersist())            // If we have our own key
            *key = idxbuf;                // reset it to entry index buffer

        stdstr(&entkeytxt, idxbuf);    // set entry key text that module 'snapped' to.
        delete [] idxbuf;
    }
    else {
        entryBuf = "";
    }

    delete [] buf;
    return retval;
}
Ejemplo n.º 2
0
void RawLD::deleteEntry() {
    char *buf = new char [ strlen(*key) + 6 ];
    strcpy(buf, *key);

    if (strongsPadding) strongsPad(buf);

    doSetText(buf, "");

    delete [] buf;
}
Ejemplo n.º 3
0
void RawLD::linkEntry(const SWKey *inkey) {
    char *buf = new char [ strlen(*key) + 6 ];
    strcpy(buf, *key);

    if (strongsPadding) strongsPad(buf);

    doLinkEntry(buf, *inkey);

    delete [] buf;
}
Ejemplo n.º 4
0
void RawLD::setEntry(const char *inbuf, long len) {
    char *buf = new char [ strlen(*key) + 6 ];
    strcpy(buf, *key);

    if (strongsPadding) strongsPad(buf);

    doSetText(buf, inbuf, len);

    delete [] buf;
}
Ejemplo n.º 5
0
long RawLD::getEntryForKey(const char *key) const {
    uint32_t start, offset;
    uint16_t size;

    char *buf = new char [ strlen(key) + 6 ];
    strcpy(buf, key);

    if (strongsPadding) strongsPad(buf);

    findOffset(buf, &start, &size, 0, &offset);

    delete [] buf;

    return offset / IDXENTRYSIZE;
}
Ejemplo n.º 6
0
long RawLD4::getEntryForKey(const char *key) const {
	__u32 start, offset;
	__u32 size;

	char *buf = new char [ strlen(key) + 6 ];
	strcpy(buf, key);

	strongsPad(buf);
	
	findOffset(buf, &start, &size, 0, &offset);

	delete [] buf;

	return offset / IDXENTRYSIZE;
}