Example #1
0
int twin::getca ( int row, int col )
{
	int	r, c	;

	r = (row==0 ? row_+vR1_ : row+vR0_) ;
	c = (col==0 ? col_+vC1_ : col+vC0_) ;

	if ( toVideo() )
#if defined(__DJGPP__)
		return _farpeekw(_dos_ds,(long)(&videoPtr[r*videoWidth+c])) ;
#else
		return videoPtr[r*videoWidth+c] ;
#endif

	if ( toBuffer() && pBuffer_ != 0 )
		return pBuffer_[(r-_R1_)*(_C2_-_C1_+1)+(c-_C1_)] ;

	int	ca	;
	int	notCurr = (r!=row_ || c!=col_)	;

	if ( notCurr ) Bios_locate(page_,r,c) ;
	ca = Bios_getca(page_) ;
	if ( notCurr ) Bios_locate(page_,row_,col_) ;

	return ca ;
}
Example #2
0
void toMorse(int size,char** args){
		
	char *morse;
	char output[100000];
	int i;
	int k;
	int j;
	int index = 0;
		
	
	for(i = 0; i < size; i++){
		for(j = 0; args[i][j] != '\0'; j++){
			if(isNumber(args[i][j])){
				morse = getMorseNumber(args[i][j]);
			}else{
				if(isLetter(args[i][j])){
					morse = getMorseLetter(args[i][j]);
				}
					
			}	
			
			for(k = 0; morse[k] != '\0'; k++){
				output[index++] = morse[k];
			}
		}
		output[index++] = ' ';
	}
	output[index++] = '\0';
	
	toBuffer(output);
}
Example #3
0
    void visit(Dsymbol *s)
    {
    #if 0
        printf("Dsymbol::mangle() '%s'", s->toChars());
        if (s->parent)
            printf("  parent = %s %s", s->parent->kind(), s->parent->toChars());
        printf("\n");
    #endif

        mangleParent(s);

        char *id = s->ident ? s->ident->toChars() : s->toChars();
        toBuffer(id, s);

        //printf("Dsymbol::mangle() %s = %s\n", s->toChars(), id);
    }
Example #4
0
    void mangleDecl(Declaration *sthis)
    {
        mangleParent(sthis);

        assert(sthis->ident);
        const char *id = sthis->ident->toChars();
        toBuffer(id, sthis);

        if (FuncDeclaration *fd = sthis->isFuncDeclaration())
        {
            mangleFunc(fd, false);
        }
        else if (sthis->type->deco)
        {
            buf->writestring(sthis->type->deco);
        }
        else
            assert(0);
    }
Example #5
0
    void visit(TemplateInstance *ti)
    {
    #if 0
        printf("TemplateInstance::mangle() %p %s", ti, ti->toChars());
        if (ti->parent)
            printf("  parent = %s %s", ti->parent->kind(), ti->parent->toChars());
        printf("\n");
    #endif

        if (!ti->tempdecl)
            ti->error("is not defined");
        else
            mangleParent(ti);

        ti->getIdent();
        const char *id = ti->ident ? ti->ident->toChars() : ti->toChars();
        toBuffer(id, ti);

        //printf("TemplateInstance::mangle() %s = %s\n", ti->toChars(), ti->id);
    }
Example #6
0
	size_t bodyBuffers(bool chunked, list<string> &chunkLines, const iovec* vec, int c, Buffers& buffers) {
		size_t rsize = 0;
		for (int i = 0; i < c; ++i)
			rsize += vec[i].iov_len;

		if (rsize != 0) {
			if (chunked) {
				chunkLines.push_back(hexSize(rsize));
				buffers.push_back(toBuffer(chunkLines.back()));
				buffers.push_back(blanklineBuffer());
				buffers.insert(buffers.end(), vec, vec + c);
				buffers.push_back(blanklineBuffer());
			}
			else {
				buffers.insert(buffers.end(), vec, vec + c);
			}
		}

		return rsize;
	}
Example #7
0
    void mangleParent(Dsymbol *s)
    {
        Dsymbol *p;
        if (TemplateInstance *ti = s->isTemplateInstance())
            p = ti->isTemplateMixin() ? ti->parent : ti->tempdecl->parent;
        else
            p = s->parent;

        if (p)
        {
            mangleParent(p);

            if (p->getIdent())
            {
                const char *id = p->ident->toChars();
                toBuffer(id, s);

                if (FuncDeclaration *f = p->isFuncDeclaration())
                    mangleFunc(f, true);
            }
            else
                buf->writeByte('0');
        }
    }