• 大小: 273KB
    文件类型: .gz
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: 数据库
  • 标签: rlwrap  

资源简介

在Linux中的Oracle数据库中使用上下左右键

资源截图

代码片段和文件信息

#line 1 “completion.rb“
/*  completion.c is generated from completion.rb by the program rbgen
    (cf. http://libredblack.sourceforge.net/)
    
    completion.rb: maintaining the completion list my_completion_function()
    (callback for readline lib)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License  or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; see the file COPYING.  If not write to
    the Free Software Foundation 675 Mass Ave Cambridge MA 02139 USA.

    You may contact the author by:
       e-mail:  hlub@knoware.nl
*/

#pragma GCC diagnostic ignored “-Wunused-but-set-variable“
#pragma GCC diagnostic ignored “-Wunused-function“


#include “rlwrap.h“

#ifdef assert
#undef assert
#endif


int completion_is_case_sensitive = 1;

int
compare(const char *string1 const char *string2)
{
  const char *p1;
  const char *p2; 
  int count;

  for (p1 = string1 p2 = string2 count = 0;
       *p1 && *p2 && count < BUFFSIZE; p1++ p2++ count++) {
    char c1 = completion_is_case_sensitive ? *p1 : tolower(*p1);
    char c2 = completion_is_case_sensitive ? *p2 : tolower(*p2);

    if (c1 != c2)
      return (c1 < c2 ? -1 : 1);
  }
  if ((*p1 && *p2) || (!*p1 && !*p2))
    return 0;
  return (*p1 ? 1 : -1);
}





#ifdef malloc
#  undef malloc
#endif
#define malloc(x) mymalloc(x) /* This is a bit evil but there is no other way to make libredblack use mymalloc() */



/* This file has to be processed by the program rbgen  */

/* rbgen generated code begins here */
/* rbgen: $Id: rbgen.inv 1.3 2003/10/24 01:31:21 damo Exp $ */
#define RB_CUSTOMIZE
#define rbdata_t char
#define RB_CMP(s t) compare(s t)
#define RB_ENTRY(name) rb##name
#undef RB_INLINE
#define RB_STATIC static
#line 1 “completion.c“
/*
 * RCS $Id: redblack.hv 1.9 2003/10/24 01:31:21 damo Exp $
 */

/*
   Redblack balanced tree algorithm
   Copyright (C) Damian Ivereigh 2000

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published by
   the Free Software Foundation; either version 2.1 of the License or
   (at your option) any later version. See the file COPYING for details.

   This program is distributed in the hope that it will be useful
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU Lesser General Public Licens

评论

共有 条评论