예제 #1
0
int main(void)
{
    int arr[N][M];
    int i;

    init(arr);
    putit(arr);
    printf("\n");

    for (i=0; i<N; i++)
        csort(arr[i], M);
    putit(arr);
    printf("\n");

    csort((int *)arr, N*M);
    putit(arr);

    return 0;
}
예제 #2
0
int main(void)
{
    int num[N];

    init(num);
    putit(num);
    bsort(num);
    putit(num);

    printf("\nwait 2s\n\n");
    sleep(2);

    init(num);
    putit(num);
    csort(num);
    putit(num);

    return 0;

}
예제 #3
0
파일: OZGETL.C 프로젝트: arpruss/ozdev
int ozeditline1(byte _x0,byte y0,char *s0,byte slen,byte _xlen)
{
    static char c;
    static byte l1;
    static unsigned k;
    static byte i;
    register char *p;
    xlen=_xlen;
    /*
    switch(ozgetfont())
    {
        case FONT_PC_NORMAL:
        case FONT_OZ_NORMAL:
            height=8;
            break;
        default:
            height=13;
            break;
    }
    */
    height=ozgetfontheight(ozgetfont());
    x=x0=_x0;
    y1=y0;
    if((int)x0+(int)xlen>239 || (int)y1+(int)height>79)
        return OZEDITLINE_ERROR;
    xlen--;
    s=s0;
    pos=strlen(s0);
    if(pos>=slen) return OZEDITLINE_ERROR;
    putit();
    setxorcursor();
    for(;;)
        switch(k=getch())
        {
            case KEY_BACKLIGHT:
                oztogglelight();
                break;
            case KEY_LEFT:
              if(pos>0)
              {
                 pos--;
                 movecursor();
              }
              break;
            case KEY_RIGHT:
              if(s[pos])
              {
                 pos++;
                 movecursor();
              }
              break;
            case KEY_MAIN:
            case KEY_SCHEDULE:
            case KEY_MEMO:
            case KEY_TELEPHONE:
            case KEY_MYPROGRAMS:
            case KEY_UPPER_ESC:
            case 27:
              xorcursor();
              return OZEDITLINE_CANCEL;
            case KEY_LOWER_ENTER:
            case KEY_UPPER_ENTER:
/*            case '\r': */
            case '\n':
                 xorcursor();
                 return strlen(s);
            case KEY_BACKSPACE:
              if(pos>0)
              {
                 pos--;
                 p=s+pos;
                 c=*p;
                 while(*p)
                 {
                    *p=p[1];
                    p++;
                 }
                 xorcursor();
                 _ozfilledbox(putit(),y1,measurechar(c),height,WHITE);
/*                 putit(); */
                 setxorcursor();
               }
               break;
            default:
               if(k<127 && (byte)measurechar(k)+(byte)measurestring(s) < xlen
                 && (l1=strlen(s)+1) < slen)
               {
                 xorcursor();
                 for(i=l1;i>pos;i--)
                    s[i]=s[i-1];
/*                 if(s[pos]==0) s[pos+1]=0; */
                 s[pos]=k;
                 pos++;
                 putit();
                 setxorcursor();
               }
               break;
          }
}
예제 #4
0
파일: utilities.c 프로젝트: malaise/c
extern void debug3 (int severity, const char *msg, const char *data,
                    const char *extra) {
    if (! putit (severity) ) return;
    fprintf (stderr, "-> %s, %s, %s\n", msg, data, extra);
}
예제 #5
0
파일: utilities.c 프로젝트: malaise/c
extern void debug1 (int severity, const char *msg) {
    if (! putit (severity) ) return;
    fprintf (stderr, "-> %s\n", msg);
}