亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aruqsort.c

?? roots--一個輕量級的內存數據庫系統。基于Hash Map的table設計。快速輕巧。
?? C
字號:
/*
Copyright (c) 2003, Dan Kranz and Arnold Rom
All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

    * Redistributions of source code must retain the above
      copyright notice, this list of conditions and the following
      disclaimer.

    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials
      provided with the distribution.

    * The names of its contributors may not be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <roots.h>

/* ############################################################################# */
/*                                                                             # */
/*    UQSORT (BLOCK,CPL,NLINE,FIELDS,NF,FIRST,LNEXTL,LFRSTL,LLASTL,TMP)        # */
/*    -----------------------------------------------------------------------  # */
/*                                                                             # */
/*    UQSORTS  sorts  and  groups  BLOCK  of  dimension  CPL*NLINE  by the NF  # */
/*    FIELDS.  The physical BLOCK line arrangement is not altered.             # */
/*                                                                             # */
/*    LNEXTL,  LFRSTL,  LLASTL,  and TMP are INTEGER*2 arrays of length NLINE  # */
/*    each.                                                                    # */
/*                                                                             # */
/*    TMP is a temporary array needed by UQSORT.                               # */
/*                                                                             # */
/*    LNEXTL,  LFRSTL,  and  LLASTL  are  output  from  UQSORT.  These arrays  # */
/*    contain  the list structure reflecting the sorted groups of BLOCK.  The  # */
/*    list components are as follows:                                          # */
/*                                                                             # */
/*    FIRST,LNEXTL  contains all lines with unique BLOCK(FIELDS).  The unique  # */
/*    lines appear in ascending sort sequence.                                 # */
/*                                                                             # */
/*    LFRSTL(L),LNEXTL contains the clones of L, for any L of FIRST,LNEXTL.    # */
/*                                                                             # */
/*    Let L be a line of FIRST,LNEXTL;                                         # */
/*                                                                             # */
/*    then BLOCK(FIEDLS,L)=BLOCK(FIELDS,LC);                                   # */
/*                                                                             # */
/*    For all LC of LC1=LFRSTL(L), LC2=LNEXTL(LC1) ... 0=LNEXTL(LCN).          # */
/*                                                                             # */
/*    LLASTL(L)  is  the  final  clone  in a sub-list of clones starting with  # */
/*    LFRSTL(L). N.B.  LLASTL may be ignored unless one wants to re-structure  # */
/*    the list.  i.e.  LNEXTL(LLASTL(L))=0 for LLASTL(L).NE.0.                 # */
/*                                                                             # */
/*    L's  of  FIRST,LNEXTL  with LFRSTL(L)=0 have no clones and are therfore  # */
/*    unique with respect to the entire BLOCK.                                 # */
/*                                                                             # */
/*    UQSORT  is  used  mainly to derive tables of unique entries; however, a  # */
/*    simple  re-structuring of the output list yields a list of all lines in  # */
/*    sort  sequence.   UQSORT is several times faster than CHSORT for BLOCKS  # */
/*    with a large clone population.                                           # */
/*                                                                             # */
/* ############################################################################# */


#define Compare_q_p_and_branch_Low_High_Equal(low,high,equal)           \
        ppoint=block+*cpl*p;                                            \
        qpoint=block+*cpl*q;                                            \
        for (j=0,fld=field; j<*nf; j++,fld+=2) {                        \
           rc = compare(qpoint+*(fld),ppoint+*(fld),*(fld+1),types[j]); \
           if (rc!=0)                                                   \
              break;                                                    \
        }                                                               \
        if (rc<0) goto low;                                             \
        if (rc>0) goto high;                                            \
        goto equal;


void uqsort(BYTE *block, long *cpl, long *nline, long *field,
            short *types, long *nf, long *first, unsigned short *lnextl,
            unsigned short *lfrstl, unsigned short *llastl, 
            unsigned short *temp,
            int (*compare)(const void *el, const void *e2, size_t count, short type))

/* --------------------------------------------------------- */
{       /* uqsort START */
/* --------------------------------------------------------- */

/*      local data */

        BYTE *ppoint,*qpoint;
        unsigned short p,q,ngroup,prevp,k,npairs,pair,last,nextq,lastp,lastq;
        unsigned short g1;
        long *fld;
        int rc,j;

/* ---------------------------------------------------- */
/*      validate the arguments */
/* ---------------------------------------------------- */

        if (*nf<=0                         ||
            *cpl<=0                        ||
            *nline<0                       ||
            *nline>MAXLIN                  ||
            *field<=0                      ||
            *(field+1)<=0                  ||
            *(field+1)>*cpl                ||
            *field + *(field+1) - 1 > *cpl)
        {
           RootsSOS("uqsort sos exit\n");
           abort();
        }

/* ---------------------------------------------------- */
/*      adjust arrays for relative zero addressing */
/* ---------------------------------------------------- */

        block-=*cpl; --block; --lnextl; --lfrstl; --llastl; --temp;

/* ------------------------------------------------------ */
/*      intialize for trivial case and leave if nline<=1. */
/* ------------------------------------------------------ */

        *(lnextl+1)=*(lfrstl+1)=*(llastl+1)=0;
        *(temp+1)=1;

        if(*nline<=1) {*first=*nline; return;}

/* ---------------------------------------------------------------- */
/*      derive intial natural groups */
/* ---------------------------------------------------------------- */

        ngroup=p=prevp=1;

        for(q=2; q<=*nline; q++)
        {
        *(lfrstl+q)=*(lnextl+q)=*(llastl+q)=0;

           Compare_q_p_and_branch_Low_High_Equal(newgroup,oldgroup,iclone)

iclone:    if(*(llastl+prevp)==0) *(lfrstl+prevp)=*(llastl+prevp)=q;  /* new */
           else
           {
           k=*(llastl+prevp);                                        /* old */
           *(llastl+prevp)=q;     /* llastl(prevp)=q */
           *(lnextl+k)=q;         /* lnextl(old llastl(prevp))=q */
           }
           p=q; continue;

newgroup:  ++ngroup;
           *(temp+ngroup)=q;
           prevp=q;
           p=q;
           continue;

oldgroup:  *(lnextl+prevp)=q;
           prevp=q;
           p=q;
           continue;

        }
/* --------------------------------------------------------------------------- */
/*      merge process */
/* --------------------------------------------------------------------------- */

        while((npairs=ngroup/2)!=0)
/* --------------------- */
{       /* merge START */
/* --------------------- */

        pair=0;
        while(++pair<=npairs)
/* -------------------------------- */
{       /* merge current pair START */
/* -------------------------------- */

        last=0;
        g1=2*(pair-1)+1;
        p=*(temp+g1); q=*(temp+g1+1);

        Compare_q_p_and_branch_Low_High_Equal(storeq1,storep1,clone1)

/* ----------------------------------------------- */
/*         p is the first member of new output list */
/* ----------------------------------------------- */

storep1:   last=*(temp+pair)=p; p=*(lnextl+p);

           if(p==0){*(lnextl+last)=q; continue;}  /* append remaining q's */

           Compare_q_p_and_branch_Low_High_Equal(storeqn,storepn,clonen)

/* ----------------------------------------------- */
/*         q is the first member of new output list */
/* ----------------------------------------------- */

storeq1:   last=*(temp+pair)=q; q=*(lnextl+q);

           if(q==0){*(lnextl+last)=p; continue;}  /* append remaining p's */

           Compare_q_p_and_branch_Low_High_Equal(storeqn,storepn,clonen)

/* ----------------------------------------------- */
/*         store p in established output list */
/* ----------------------------------------------- */

storepn:   *(lnextl+last)=p; last=p; p=*(lnextl+p);

           if(p==0){*(lnextl+last)=q; continue;}   /* append remaining q's */

           Compare_q_p_and_branch_Low_High_Equal(storeqn,storepn,clonen)

/* ----------------------------------------------- */
/*         store q in established output list */
/* ----------------------------------------------- */

storeqn:   *(lnextl+last)=q; last=q; q=*(lnextl+q);

           if(q==0){*(lnextl+last)=p; continue;}   /* append remaining p's */

           Compare_q_p_and_branch_Low_High_Equal(storeqn,storepn,clonen)

/* -------------------------------------------------------------- */
/*        remove redundant q and store as a clone of p for first */
/* -------------------------------------------------------------- */

clone1:    nextq=*(lnextl+q);

/*         connect q to p's clones */

           if((lastp=*(llastl+p))==0) *(lfrstl+p)=q; else *(lnextl+lastp)=q;

           *(lnextl+q)=*(lfrstl+q);

           if((lastq=*(llastl+q))==0) *(llastl+p)=q; else *(llastl+p)=lastq;

           *(lfrstl+q)=*(llastl+q)=0;

/*         move to next q and store p (no compare needed) */

           if((q=nextq)!=0)
             {                                     /* copy storep1 */
             last=*(temp+pair)=p; p=*(lnextl+p);

             if(p==0){*(lnextl+last)=q; continue;}  /* append remaining q's */

             Compare_q_p_and_branch_Low_High_Equal(storeqn,storepn,clonen)
             }

/*         q's exhausted */

           if(last!=0) {*(lnextl+last)=p; continue;}   /* store remaining p's */
                                                       /* in unique list */

           *(temp+pair)=p; continue;                   /* p is the first of the */
                                                       /* stack */

/* ---------------------------------------------------------- */
/*        remove redundant q and store as a clone of p for n */
/* ---------------------------------------------------------- */

clonen:    nextq=*(lnextl+q);

/*         connect q to p's clones */

           if((lastp=*(llastl+p))==0) *(lfrstl+p)=q; else *(lnextl+lastp)=q;

           *(lnextl+q)=*(lfrstl+q);

           if((lastq=*(llastl+q))==0) *(llastl+p)=q; else *(llastl+p)=lastq;

           *(lfrstl+q)=*(llastl+q)=0;

/*         move to next q and store p (no compare needed) */

           if((q=nextq)!=0)
             {                                          /* copy of storepn */
             *(lnextl+last)=p; last=p; p=*(lnextl+p);

             if(p==0){*(lnextl+last)=q; continue;}   /* append remaining q's */

             Compare_q_p_and_branch_Low_High_Equal(storeqn,storepn,clonen)
             }

/*         q's exhausted */

           if(last!=0) {*(lnextl+last)=p; continue;}   /* store remaining p's */
                                                       /* in unique list */

           *(temp+pair)=p; continue;                   /* p is the first of the */
                                                       /* stack */
/* -------------------------------- */
}       /* merge current pair END */
/* -------------------------------- */

/*      redefine ngroup */

/*      odd case. add odd ball to new groups */

        if(ngroup%2==1)
        {
        *(temp+npairs+1)=*(temp+ngroup);
        ngroup=npairs+1;
        continue;
        }

/*      even case */

        ngroup=npairs;

/* --------------------- */
}       /* merge END */
/* --------------------- */

        *first=*(temp+1);
        return;

/* --------------------------------------------------------- */
}       /* uqsort END */
/* --------------------------------------------------------- */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人亚洲人成电影网站色| 最近日韩中文字幕| 91久久奴性调教| 色av一区二区| 欧美优质美女网站| 欧美日韩在线观看一区二区 | 欧美精品欧美精品系列| 色哟哟一区二区在线观看| 色综合久久久久久久久久久| 91激情五月电影| 欧美日韩在线电影| 欧美成人一区二区三区在线观看| 欧美一级高清片| 久久日韩精品一区二区五区| 国产免费成人在线视频| 综合久久给合久久狠狠狠97色 | 欧美在线视频不卡| 欧美午夜片在线看| 成人av网在线| 欧美在线一区二区| 26uuu亚洲| 亚洲天堂av老司机| 日韩精品成人一区二区在线| 国内精品伊人久久久久影院对白| 春色校园综合激情亚洲| 欧美亚洲国产一区二区三区| 欧美一区二区国产| 国产精品久久毛片a| 亚洲自拍偷拍综合| 九一九一国产精品| 9i在线看片成人免费| 欧美区一区二区三区| 久久久精品国产99久久精品芒果| 亚洲视频在线一区观看| 久色婷婷小香蕉久久| 成人av电影免费观看| 7777精品久久久大香线蕉| 欧美国产日产图区| 蜜臀va亚洲va欧美va天堂| av不卡一区二区三区| 日韩网站在线看片你懂的| 亚洲欧美偷拍三级| 国产精一区二区三区| 欧美色精品天天在线观看视频| 久久一二三国产| 视频一区二区三区入口| 99国产精品国产精品毛片| 欧美成人在线直播| 亚洲午夜羞羞片| 不卡一区二区三区四区| 精品国产乱码久久久久久浪潮| 亚洲国产一区二区视频| 97精品国产露脸对白| 久久久精品国产免费观看同学| 视频一区中文字幕| 欧美在线观看视频一区二区| 国产精品夫妻自拍| 风间由美一区二区三区在线观看 | 亚洲视频免费看| 国产精品自在在线| 日韩欧美一级在线播放| 亚洲成人久久影院| 91久久香蕉国产日韩欧美9色| 亚洲欧洲av另类| 成人午夜精品在线| 国产日韩成人精品| 国产电影一区在线| 26uuu色噜噜精品一区| 麻豆国产精品官网| 欧美电影免费观看完整版| 亚洲妇女屁股眼交7| 91免费在线看| 一区二区三区美女| 欧美性受极品xxxx喷水| 一区二区三区四区视频精品免费 | 久久国产精品99久久久久久老狼 | 中文字幕欧美国产| 成人精品视频一区二区三区尤物| 久久―日本道色综合久久| 精品一区精品二区高清| 国产喂奶挤奶一区二区三区| 国产一区二区三区| 中文字幕免费不卡| 99亚偷拍自图区亚洲| 综合色中文字幕| 欧美日韩中文字幕一区| 日韩不卡一区二区三区| 日韩三级在线免费观看| 国产一区久久久| 1000部国产精品成人观看| 日本精品视频一区二区| 亚洲电影欧美电影有声小说| 欧美一区二区三区系列电影| 狠狠色丁香久久婷婷综合_中| 国产欧美日韩另类视频免费观看| 国产不卡高清在线观看视频| 日韩美女视频一区二区 | 久久噜噜亚洲综合| 成人国产免费视频| 亚洲风情在线资源站| 欧美成人三级在线| 成人性色生活片| 亚洲国产精品久久久久秋霞影院 | 国产在线播精品第三| 国产精品欧美久久久久无广告| 91美女在线看| 九九九久久久精品| 亚洲精品视频一区二区| 日韩欧美不卡一区| 91蜜桃婷婷狠狠久久综合9色| 蜜桃av噜噜一区| 一区二区三区美女| 久久精品一区二区三区四区| 91精彩视频在线| 国产福利91精品一区| 日韩高清一区在线| 中文字幕一区二区三区乱码在线| 欧美一区二区三区的| 91麻豆国产福利在线观看| 国产一区二区三区久久悠悠色av| 亚洲黄网站在线观看| 日本一区二区动态图| 欧美一区二区精品久久911| 97久久人人超碰| 国产精品123区| 三级影片在线观看欧美日韩一区二区| 久久午夜老司机| 91精品国产乱码久久蜜臀| 91免费在线播放| 成人免费va视频| 国产一区二区福利视频| 视频一区视频二区在线观看| 亚洲欧美另类久久久精品| 国产日韩av一区| 久久综合色综合88| 欧美成人性福生活免费看| 欧美日韩国产三级| 欧美性生活一区| 色狠狠桃花综合| 色综合久久66| 91在线免费播放| gogogo免费视频观看亚洲一| 国产美女在线精品| 激情欧美日韩一区二区| 久久成人羞羞网站| 免费三级欧美电影| 日韩电影在线观看一区| 丝袜亚洲另类丝袜在线| 亚洲成人精品一区二区| 亚洲成a人v欧美综合天堂| 夜夜嗨av一区二区三区四季av| 亚洲天堂精品在线观看| 一区二区三区在线视频免费| 亚洲欧美国产三级| 一区二区三区在线高清| 亚洲欧美一区二区三区孕妇| 亚洲女子a中天字幕| 亚洲欧美日韩一区二区三区在线观看 | 最新日韩在线视频| 亚洲天堂2014| 亚洲成人免费在线| 日本怡春院一区二区| 另类小说视频一区二区| 国产呦精品一区二区三区网站| 国产精品伊人色| 成人av网址在线| 欧美午夜精品久久久久久孕妇 | 日韩一区二区三区视频| 欧美tickling网站挠脚心| 日韩欧美国产三级电影视频| 精品国产一区二区三区久久久蜜月 | 久久精品亚洲一区二区三区浴池| 久久欧美一区二区| 亚洲欧洲av一区二区三区久久| 亚洲一区二区三区自拍| 看片的网站亚洲| av电影在线观看完整版一区二区| 欧美这里有精品| 欧美精品一区二区高清在线观看| 欧美激情中文字幕| 亚洲国产成人91porn| 久草热8精品视频在线观看| 懂色av噜噜一区二区三区av | 日韩1区2区3区| 国产精品18久久久久久久久| 不卡一二三区首页| 91精品国产综合久久久久| 国产亚洲精品免费| 亚洲午夜日本在线观看| 极品少妇xxxx精品少妇| 91在线视频官网| 欧美大尺度电影在线| 中文字幕在线不卡视频| 日韩高清欧美激情| 99久久精品久久久久久清纯| 欧美裸体一区二区三区| 一区二区三区四区激情| 日韩精品欧美成人高清一区二区| 日韩高清不卡一区二区三区| 青娱乐精品在线视频|