text.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (C) 2005-2010 Valeriy Argunov (nporep AT mail DOT ru) */
  2. /*
  3. * This library is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU Lesser General Public License as published by
  5. * the Free Software Foundation; either version 2.1 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public License
  14. * along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. */
  17. #include "declarations.h"
  18. #ifndef QSP_TEXTDEFINES
  19. #define QSP_TEXTDEFINES
  20. #define QSP_STRSDELIM QSP_FMT("\r\n")
  21. #define QSP_LSUBEX QSP_FMT("<<")
  22. #define QSP_RSUBEX QSP_FMT(">>")
  23. /* Helpers */
  24. #define QSP_LEN(x) (sizeof(x) / sizeof(QSP_CHAR) - 1)
  25. /* External functions */
  26. int qspAddText(QSP_CHAR **, QSP_CHAR *, int, int, QSP_BOOL);
  27. QSP_CHAR *qspGetNewText(QSP_CHAR *, int);
  28. QSP_CHAR *qspGetAddText(QSP_CHAR *, QSP_CHAR *, int, int);
  29. QSP_BOOL qspClearText(void **, int *);
  30. QSP_BOOL qspIsInList(QSP_CHAR *, QSP_CHAR);
  31. QSP_BOOL qspIsInListEOL(QSP_CHAR *, QSP_CHAR);
  32. QSP_BOOL qspIsDigit(QSP_CHAR);
  33. QSP_CHAR *qspSkipSpaces(QSP_CHAR *);
  34. QSP_CHAR *qspStrEnd(QSP_CHAR *);
  35. QSP_CHAR *qspDelSpc(QSP_CHAR *);
  36. QSP_CHAR *qspDelSpcCanRetSelf(QSP_CHAR *);
  37. QSP_BOOL qspIsAnyString(QSP_CHAR *);
  38. void qspLowerStr(QSP_CHAR *);
  39. void qspUpperStr(QSP_CHAR *);
  40. int qspStrsNComp(QSP_CHAR *, QSP_CHAR *, int);
  41. int qspStrsComp(QSP_CHAR *, QSP_CHAR *);
  42. QSP_CHAR *qspStrCopy(QSP_CHAR *, QSP_CHAR *);
  43. QSP_CHAR *qspStrChar(QSP_CHAR *, QSP_CHAR);
  44. QSP_CHAR *qspStrNCopy(QSP_CHAR *, QSP_CHAR *, int);
  45. int qspStrLen(QSP_CHAR *);
  46. QSP_CHAR *qspStrStr(QSP_CHAR *, QSP_CHAR *);
  47. QSP_CHAR *qspStrPBrk(QSP_CHAR *, QSP_CHAR *);
  48. QSP_CHAR *qspInStrRChars(QSP_CHAR *, QSP_CHAR *, QSP_CHAR *);
  49. QSP_CHAR *qspJoinStrs(QSP_CHAR **, int, QSP_CHAR *);
  50. int qspSplitStr(QSP_CHAR *, QSP_CHAR *, QSP_CHAR ***);
  51. void qspCopyStrs(QSP_CHAR ***, QSP_CHAR **, int, int);
  52. void qspFreeStrs(void **, int);
  53. int qspStrToNum(QSP_CHAR *, QSP_CHAR **);
  54. QSP_CHAR *qspNumToStr(QSP_CHAR *, int);
  55. QSP_CHAR *qspStrPos(QSP_CHAR *, QSP_CHAR *, QSP_BOOL);
  56. QSP_CHAR *qspReplaceText(QSP_CHAR *, QSP_CHAR *, QSP_CHAR *);
  57. QSP_CHAR *qspFormatText(QSP_CHAR *, QSP_BOOL);
  58. #ifdef _UNICODE
  59. int qspToWLower(int);
  60. int qspToWUpper(int);
  61. #endif
  62. #endif