選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

52 行
1.8 KiB

  1. /*
  2. Copyright (C) 2019 Genome Research Ltd.
  3. Author: Petr Danecek <pd3@sanger.ac.uk>
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  15. THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  17. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  18. DEALINGS IN THE SOFTWARE.
  19. */
  20. #ifndef __COLS_H__
  21. #define __COLS_H__
  22. #include <stdlib.h>
  23. typedef struct
  24. {
  25. int n,m;
  26. char **off, *rmme;
  27. }
  28. cols_t;
  29. /*
  30. cols_split() can be called repeatedly to split new strings, memory is allocated
  31. and deallocated automatically
  32. */
  33. cols_t *cols_split(const char *line, cols_t *cols, char delim);
  34. /*
  35. Although cols_append() can be combined with cols_split(), it is much slower and
  36. the string must exist throughout the life of cols unless initialized with cols_split().
  37. */
  38. void cols_append(cols_t *cols, char *str);
  39. void cols_clear(cols_t *cols);
  40. void cols_destroy(cols_t *cols);
  41. #endif