home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Tools / lib / getamigaguidenode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  955 b   |  62 lines

  1. /*
  2. ** $PROJECT: xrefsupport.lib
  3. **
  4. ** $VER: getamigaguidenode.c 1.1 (08.09.94)
  5. **
  6. ** by
  7. **
  8. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. **
  10. ** (C) Copyright 1994
  11. ** All Rights Reserved !
  12. **
  13. ** $HISTORY:
  14. **
  15. ** 08.09.94 : 001.001 :  initial
  16. */
  17.  
  18. #include "/source/def.h"
  19.  
  20. #define EOS    '\0'
  21.  
  22. void getamigaguidenode(STRPTR *nameptr,STRPTR *titleptr)
  23. {
  24.    STRPTR ptr = *nameptr;
  25.    STRPTR title;
  26.    STRPTR name;
  27.  
  28.    while(*ptr == ' ' || *ptr == '\t')
  29.       ptr++;
  30.  
  31.    name = ptr;
  32.  
  33.    if(*name == '"')
  34.    {
  35.       name++;
  36.       ptr++;
  37.       while(*ptr != '"' && *ptr != EOS)
  38.          ptr++;
  39.    } else
  40.       while(*ptr != ' ' && *ptr != '\t' && *ptr != EOS)
  41.          ptr++;
  42.  
  43.    *ptr++ = EOS;
  44.  
  45.    while(*ptr == ' ' || *ptr == '\t')
  46.       ptr++;
  47.  
  48.    if(*ptr == '"')
  49.    {
  50.       title = ++ptr;
  51.       while(*ptr != '"' && *ptr != EOS)
  52.          ptr++;
  53.  
  54.       *ptr = EOS;
  55.    } else
  56.       title = name;
  57.  
  58.    *titleptr = title;
  59.    *nameptr = name;
  60. }
  61.  
  62.