Changeset 8694


Ignore:
Timestamp:
2004-11-29T16:15:13+13:00 (19 years ago)
Author:
kjdon
Message:

added some changes made by Emanuel Dejanu (Simple Words)

Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/packages/mg/lib/memlib.c

    r3745 r8694  
    2424/*
    2525   $Log$
     26   Revision 1.2  2004/11/29 03:15:13  kjdon
     27   added some changes made by Emanuel Dejanu (Simple Words)
     28
    2629   Revision 1.1  2003/02/20 21:14:16  mdewsnip
    2730   Addition of MG package for search and retrieval
     
    4548
    4649/* Defined as strdup is not an ANSI function */
     50/* change the name so we do not have problems with other libs */
    4751char *
    48 my_strdup(const char *str)
     52my_mg_strdup(const char *str)
    4953{
    5054  char *ret_str = malloc(strlen(str)+1);
     
    6064Free_func Xfree = free;
    6165
    62 Strdup_func Xstrdup = my_strdup;
     66Strdup_func Xstrdup = my_mg_strdup;
  • trunk/gsdl3/packages/mg/src/text/bool_parser.c

    r3745 r8694  
    10171017    {
    10181018      /* jump over whitespace */
    1019       while (isspace(*buf_ptr))
    1020     buf_ptr++;
     1019      buf_ptr = skipspace(buf_ptr, end);
    10211020 
    10221021      if (inaword(buf_ptr, end))
  • trunk/gsdl3/packages/mg/src/text/bool_parser.y

    r3745 r8694  
    137137    {
    138138      /* jump over whitespace */
    139       while (isspace(*buf_ptr))
    140     buf_ptr++;
    141  
     139      buf_ptr = skipspace(buf_ptr, end);
     140
    142141      if (inaword(buf_ptr, end))
    143142    {
  • trunk/gsdl3/packages/mg/src/text/mg_passes.c

    r7228 r8694  
    2727# include <malloc.h>
    2828#endif
    29 
     29#include <stdlib.h>
    3030#include "memlib.h"
    3131#include "messages.h"
     
    4444/*
    4545   $Log$
     46   Revision 1.3  2004/11/29 03:15:13  kjdon
     47   added some changes made by Emanuel Dejanu (Simple Words)
     48
    4649   Revision 1.2  2004/04/25 23:01:18  kjdon
    4750   added a new -M option to mg_passes, allowing maxnumeric to be altered - made this change to keep gsdl3 mg inline with gsdl2 mg.
  • trunk/gsdl3/packages/mg/src/text/words.c

    r3745 r8694  
    1010  return 0;
    1111}
     12
     13/* Return a the UTF-8 encoded Unicode string with begining
     14   unicode spaces skipped. */
     15u_char *skipspace(u_char *here, u_char *end)
     16{
     17  unsigned short c;
     18  int length;
     19  while(here != end) {
     20    length = parse_utf8_char(here, end, &c);
     21    if (length == 0 || !is_unicode_space(c)) break;
     22    here += length;
     23  }
     24  return here;
     25}
     26
     27/* It determines whether a given place in a UTF-8 encoded
     28   Unicode string is a unicode space. */
     29int isaspace (const u_char *here, const u_char *end)
     30{
     31  unsigned short c;
     32  if (parse_utf8_char(here, end, &c) > 0) return is_unicode_space(c);
     33  return 0;
     34}
  • trunk/gsdl3/packages/mg/src/text/words.h

    r7228 r8694  
    8181       is part of a word. */
    8282
     83int isaspace (const u_char *here, const u_char *end);
     84        /* It determines whether a given place in a UTF-8 encoded
     85       Unicode string is a unicode space. */
     86
     87u_char *skipspace(u_char *here, u_char *end);
     88        /* Return a the UTF-8 encoded Unicode string with
     89       begining unicode spaces skipped. */
    8390
    8491/* =========================================================================
  • trunk/gsdl3/packages/mg/sysfuncs.h

    r3745 r8694  
    271271
    272272#ifndef _POSIX_VERSION
    273 #ifdef __MSDOS__
     273#if defined(__WIN32__)
     274#include <io.h>
     275#define lseek _lseek
     276#elif defined(__MSDOS__)
    274277#include <io.h>
    275278#else
  • trunk/gsdl3/src/packages/mg/lib/memlib.c

    r3745 r8694  
    2424/*
    2525   $Log$
     26   Revision 1.2  2004/11/29 03:15:13  kjdon
     27   added some changes made by Emanuel Dejanu (Simple Words)
     28
    2629   Revision 1.1  2003/02/20 21:14:16  mdewsnip
    2730   Addition of MG package for search and retrieval
     
    4548
    4649/* Defined as strdup is not an ANSI function */
     50/* change the name so we do not have problems with other libs */
    4751char *
    48 my_strdup(const char *str)
     52my_mg_strdup(const char *str)
    4953{
    5054  char *ret_str = malloc(strlen(str)+1);
     
    6064Free_func Xfree = free;
    6165
    62 Strdup_func Xstrdup = my_strdup;
     66Strdup_func Xstrdup = my_mg_strdup;
  • trunk/gsdl3/src/packages/mg/src/text/bool_parser.c

    r3745 r8694  
    10171017    {
    10181018      /* jump over whitespace */
    1019       while (isspace(*buf_ptr))
    1020     buf_ptr++;
     1019      buf_ptr = skipspace(buf_ptr, end);
    10211020 
    10221021      if (inaword(buf_ptr, end))
  • trunk/gsdl3/src/packages/mg/src/text/bool_parser.y

    r3745 r8694  
    137137    {
    138138      /* jump over whitespace */
    139       while (isspace(*buf_ptr))
    140     buf_ptr++;
    141  
     139      buf_ptr = skipspace(buf_ptr, end);
     140
    142141      if (inaword(buf_ptr, end))
    143142    {
  • trunk/gsdl3/src/packages/mg/src/text/mg_passes.c

    r7228 r8694  
    2727# include <malloc.h>
    2828#endif
    29 
     29#include <stdlib.h>
    3030#include "memlib.h"
    3131#include "messages.h"
     
    4444/*
    4545   $Log$
     46   Revision 1.3  2004/11/29 03:15:13  kjdon
     47   added some changes made by Emanuel Dejanu (Simple Words)
     48
    4649   Revision 1.2  2004/04/25 23:01:18  kjdon
    4750   added a new -M option to mg_passes, allowing maxnumeric to be altered - made this change to keep gsdl3 mg inline with gsdl2 mg.
  • trunk/gsdl3/src/packages/mg/src/text/words.c

    r3745 r8694  
    1010  return 0;
    1111}
     12
     13/* Return a the UTF-8 encoded Unicode string with begining
     14   unicode spaces skipped. */
     15u_char *skipspace(u_char *here, u_char *end)
     16{
     17  unsigned short c;
     18  int length;
     19  while(here != end) {
     20    length = parse_utf8_char(here, end, &c);
     21    if (length == 0 || !is_unicode_space(c)) break;
     22    here += length;
     23  }
     24  return here;
     25}
     26
     27/* It determines whether a given place in a UTF-8 encoded
     28   Unicode string is a unicode space. */
     29int isaspace (const u_char *here, const u_char *end)
     30{
     31  unsigned short c;
     32  if (parse_utf8_char(here, end, &c) > 0) return is_unicode_space(c);
     33  return 0;
     34}
  • trunk/gsdl3/src/packages/mg/src/text/words.h

    r7228 r8694  
    8181       is part of a word. */
    8282
     83int isaspace (const u_char *here, const u_char *end);
     84        /* It determines whether a given place in a UTF-8 encoded
     85       Unicode string is a unicode space. */
     86
     87u_char *skipspace(u_char *here, u_char *end);
     88        /* Return a the UTF-8 encoded Unicode string with
     89       begining unicode spaces skipped. */
    8390
    8491/* =========================================================================
  • trunk/gsdl3/src/packages/mg/sysfuncs.h

    r3745 r8694  
    271271
    272272#ifndef _POSIX_VERSION
    273 #ifdef __MSDOS__
     273#if defined(__WIN32__)
     274#include <io.h>
     275#define lseek _lseek
     276#elif defined(__MSDOS__)
    274277#include <io.h>
    275278#else
  • trunk/indexers/mg/lib/memlib.c

    r3745 r8694  
    2424/*
    2525   $Log$
     26   Revision 1.2  2004/11/29 03:15:13  kjdon
     27   added some changes made by Emanuel Dejanu (Simple Words)
     28
    2629   Revision 1.1  2003/02/20 21:14:16  mdewsnip
    2730   Addition of MG package for search and retrieval
     
    4548
    4649/* Defined as strdup is not an ANSI function */
     50/* change the name so we do not have problems with other libs */
    4751char *
    48 my_strdup(const char *str)
     52my_mg_strdup(const char *str)
    4953{
    5054  char *ret_str = malloc(strlen(str)+1);
     
    6064Free_func Xfree = free;
    6165
    62 Strdup_func Xstrdup = my_strdup;
     66Strdup_func Xstrdup = my_mg_strdup;
  • trunk/indexers/mg/src/text/bool_parser.c

    r3745 r8694  
    10171017    {
    10181018      /* jump over whitespace */
    1019       while (isspace(*buf_ptr))
    1020     buf_ptr++;
     1019      buf_ptr = skipspace(buf_ptr, end);
    10211020 
    10221021      if (inaword(buf_ptr, end))
  • trunk/indexers/mg/src/text/bool_parser.y

    r3745 r8694  
    137137    {
    138138      /* jump over whitespace */
    139       while (isspace(*buf_ptr))
    140     buf_ptr++;
    141  
     139      buf_ptr = skipspace(buf_ptr, end);
     140
    142141      if (inaword(buf_ptr, end))
    143142    {
  • trunk/indexers/mg/src/text/mg_passes.c

    r7228 r8694  
    2727# include <malloc.h>
    2828#endif
    29 
     29#include <stdlib.h>
    3030#include "memlib.h"
    3131#include "messages.h"
     
    4444/*
    4545   $Log$
     46   Revision 1.3  2004/11/29 03:15:13  kjdon
     47   added some changes made by Emanuel Dejanu (Simple Words)
     48
    4649   Revision 1.2  2004/04/25 23:01:18  kjdon
    4750   added a new -M option to mg_passes, allowing maxnumeric to be altered - made this change to keep gsdl3 mg inline with gsdl2 mg.
  • trunk/indexers/mg/src/text/words.c

    r3745 r8694  
    1010  return 0;
    1111}
     12
     13/* Return a the UTF-8 encoded Unicode string with begining
     14   unicode spaces skipped. */
     15u_char *skipspace(u_char *here, u_char *end)
     16{
     17  unsigned short c;
     18  int length;
     19  while(here != end) {
     20    length = parse_utf8_char(here, end, &c);
     21    if (length == 0 || !is_unicode_space(c)) break;
     22    here += length;
     23  }
     24  return here;
     25}
     26
     27/* It determines whether a given place in a UTF-8 encoded
     28   Unicode string is a unicode space. */
     29int isaspace (const u_char *here, const u_char *end)
     30{
     31  unsigned short c;
     32  if (parse_utf8_char(here, end, &c) > 0) return is_unicode_space(c);
     33  return 0;
     34}
  • trunk/indexers/mg/src/text/words.h

    r7228 r8694  
    8181       is part of a word. */
    8282
     83int isaspace (const u_char *here, const u_char *end);
     84        /* It determines whether a given place in a UTF-8 encoded
     85       Unicode string is a unicode space. */
     86
     87u_char *skipspace(u_char *here, u_char *end);
     88        /* Return a the UTF-8 encoded Unicode string with
     89       begining unicode spaces skipped. */
    8390
    8491/* =========================================================================
  • trunk/indexers/mg/sysfuncs.h

    r3745 r8694  
    271271
    272272#ifndef _POSIX_VERSION
    273 #ifdef __MSDOS__
     273#if defined(__WIN32__)
     274#include <io.h>
     275#define lseek _lseek
     276#elif defined(__MSDOS__)
    274277#include <io.h>
    275278#else
Note: See TracChangeset for help on using the changeset viewer.