Esempio n. 1
0
void
_qsort(void *v[], int left, int right, int(*comp)(void *, void *))
{
	__qsort(v, 0, right, comp);
	if (reverse)
		reverselines((void *) v, right + 1);
}
Esempio n. 2
0
void printheader(int y, long startdate)
{
    static byte x;
    reverse=1;
#ifndef OLDSTYLE
    if(propfont) x=ozputch(0,y,' ');
      else termputch(' ');
#else
    x=0;
#endif
    x=dumpdate(x,y,startdate,0,0);
    if(propfont) x=ozputs(x,y," - ");
     else termputs(" - ");
    x=dumpdate(x,y,startdate,NUMDAYS-1,0);
    if(!propfont) while(curcol<WIDTH) termputch(' ');
     else reverselines(y,PROP_FONT_HEIGHT);
    reverse=0;
}
Esempio n. 3
0
void highlight(byte cursor)
{
    reverselines(cursor*2*curfontheight,curfontheight*2);
}
Esempio n. 4
0
int dumpday(int _y, long start, int index, int from, int maxn)
{
    static int i;
    static char *b;
    static byte x0;
    register char *b2;
    if((!viewempty || !viewheaders || repeatchooser) && !num_appts[index]) return 0;
    if(index>=NUMDAYS || maxn==0) return 0;
    x=0; y=_y;
    if(from==-1)
    {
      reverse=1;
#ifndef OLDSTYLE
      if(propfont) x=ozputch(x,y,' '); else termputch(' ');
#endif
      x=dumpdate(x,y,start,index,1);
      if(propfont)
      {
        PROPPUTS(": ");
#ifndef ITALIAN
        PROPPUTS(num_appts[index]?itoa(num_appts[index]):"no");
        ozputs(x,y,num_appts[index]==1?" entry.":" entries.");
#else /* ITALIAN */
        PROPPUTS(num_appts[index]?itoa(num_appts[index]):"nessun");
        ozputs(x,y,num_appts[index]==1?" campo.":" campi.");
#endif /* ITALIAN */
        reverselines(y,PROP_FONT_HEIGHT);
        x=0; y+=PROP_FONT_HEIGHT;
      }
      else
      {
          termputs(": ");
          termputs(num_appts[index]?itoa(num_appts[index]):"no");
#ifndef ITALIAN
          termputs(num_appts[index]==1?" entry.":" entries.");
#else /* ITALIAN */
          termputs(num_appts[index]==1?" campo.":" campi.");
#endif /* ITALIAN */
          while(curcol<WIDTH) ttyprint(' ');
      }
      reverse=0;
    }
    if(num_appts[index]-from>maxn) maxn=from+maxn; else maxn=num_appts[index];
    for(i=from<0?0:from; i<maxn; i++)
    {
        if(repeatchooser)
        {
            dumpdate(x,y,start,index,1);
            if(propfont)
            {
                y+=PROP_FONT_HEIGHT;
                x=0;
            }
            else
            {
                currow++;
                curcol=0;
            }
        }
        else
        if(!viewheaders) minihead(start,index,i);
        b=ozloadcluster(appts[index][i].loc);
        switch(appts[index][i].type)
        {
            case TYPE_SCHEDULE:
                x0=x;
                x=puthour(x,b+24);
                if(propfont)
                {
                    PROPPUTCH(':');
                    PROPPUTCH0(b[26]);
                    PROPPUTCH0(b[27]);
                    x=putampm(x,b+24);
                    PROPPUTCH('-');
                    x=puthour(x,b+28);
                    PROPPUTCH(':');
                    PROPPUTCH0(b[30]);
                    PROPPUTCH0(b[31]);
                    x=putampm(x,b+28);
                    x=x0+time_indent;
                }
                else
                {
                    ttyprint(':');
                    ttyprint(b[26]);
                    ttyprint(b[27]);
                    putampm(0,b+24);
                    ttyprint('-');
                    puthour(0,b+28);
                    ttyprint(':');
                    termputs(b+30);
                    putampm(0,b+28);
                    ttyprint(' ');
                }
                b2=b+38;
                break;
            case TYPE_ANNIVERSARY:
                if(propfont)
                {
                    ozputs(x,y,"Anniv.");
                    x+=time_indent;
                }
                else
                {
                    underline=1;
#ifndef ITALIAN
                    termputs("Anniversary");
#else /* ITALIAN */
                    termputs("Anniversario");
#endif /* ITALIAN */
                    underline=0;
                    if(!_24hr)
                        termputs("  ");
                    ttyprint(' ');
                }
                b2=b+2+13+5;
                break;
            case TYPE_TODO:
                if(propfont)
                {
                    int x0=x;
#ifndef ITALIAN
                    PROPPUTS("TO DO [");
#else /* ITALIAN */
                    PROPPUTS("DAFARE[");
#endif /* ITALIAN */
                    PROPPUTCH(b[2+13+2+9]);
                    ozputch(x,y,']');
                    x=x0+time_indent;
                }
                else
                {
                    underline=1;
#ifndef ITALIAN
                    termputs("TO DO [");
#else /* ITALIAN */
                    termputs("DAFARE[");
#endif /* ITALIAN */
                    ttyprint(b[2+13+2+9]);
                    termputs("]");
                    underline=0;
                    termputs("   ");
                    if(!_24hr) termputs("  ");
                }
                b2=b+2+13+2+9+4;
                break;
        }
        if(propfont)
            PROPPUTS(b2);
        else
            while(*b2 && b2<b+64 && curcol<WIDTH)
              ttyprint(*b2++);
        if(b[1]!='\xFF' || b[0]!='\xFF')
        {
            unsigned loc2;
            b2=2+ozloadcluster(loc2=ozinclocation(appts[index][i].loc));
            if(propfont)
            {
                if(x<SCREEN_WIDTH && !*(ozputsgetend())) PROPPUTS(b2);
                if(x<SCREEN_WIDTH && (b2[-2]!='\xFF' || b2[-1]!='\xFF')
                  && !*(ozputsgetend()))
                  ozputs(x,y,2+ozloadcluster(ozinclocation(loc2)));
            }
            else
              while(*b2 && curcol<WIDTH)
                ttyprint(*b2++);
        }
        if(propfont)
        {
            x=0;
            y+=PROP_FONT_HEIGHT;
        }
        else curcol=WIDTH;
    }
    return i-from;
}