Skip to content

Commit ff8fc24

Browse files
committed
Squashed 'libreadtags/' changes from 95888db2..6925e6f5
6925e6f5 Merge pull request #28 from masatake/propagate-errors c97d20de Version 0.1.0 3422ef75 [TODO] comments unexpected control flows 3e58c4eb buildsys: add README.md and NEWS.md to EXTRA_DIST 3f5c7a6b docs: update README.md 6a0429ec docs: add NEWS.md 30c51c4e tests: add missing tagsClose() invocations 2d5015c7 tests: add a case passing NULL as tagEntry to tagsFirstPseudoTag() and tagsNextPseudoTag 6812fb8c tests: fix a typo in a log message a369c2cd tests: add cases for tagsSetSortType() c9348b83 [BREAKING API] add "tag" as prefix for "sortType" ecef20b5 tests: add cases for tagsClose() a1883a78 tests: test tagsFind() and tagsFindNext() for broken input 6f446db9 tests: verify error numbers with tagsGetError() when API functions return TagFailure 4d008c61 tests: add cases for testing tagsFirst() and tagsNext() for broken input d9177bf9 Remove 'if (info)' condition from file static fucntions to make the code simple fb0e4653 tests: extend the test cases for tagsOpen() 79cf071f API: add tagGetErrno() as a new API function cf57242d Propagate errors from tagsFind() to its callers 31a03653 refactor: delete unused functions 1968197d Propagate errors from findBinary() and find() to their callers f6e06290 Propagate errors from findFirstNonMatchBefore() and findFirstMatchBefore() to their callers 4924cf94 Propagate errors from readTagLineSeek() to its callers d854c3cb Propagate errors from tagsSetSortType() to its callers 21b80f4a Propagate errors from tagsFindNext() to its callers f02051d3 Propagate errors from findPseudoTag() to its callers db42c18f Propagate errors from findNextFull() to its callers 36ad1434 Propagate errors from findSequentialFull() 684c2ffc Propagate errors from readNext() to tagsFirst() and tagsNext() 637081b9 Propagate errors from gotoFirstLogicalTag() to tagsFirst() 4f3976cc Introduce err field to tagFile structure 4ca2a2ef Propagate errors in converting the value of "line:" field to a number 382a3ce7 Propagate errno from parseExtensionFields to callers 44598d8d Don't use rewind() in tagsOpen to propagate a file-seek error 034a181f tests: add cases for testing error_number field f69205d4 Detect broken pseudo tag entries when opening tags file 7b225b37 Set status.opened and status.error_number members of tagFileInfo struct even when tagsOpen returns NULL f32762fd Use ENOMEM when memory allocation is failed in tagsOpen e810fbd2 Propagate errors from duplicate() to readPseudoTags() 9a3e4212 Propagate errors from parseExtensionFields and parseTagLine to readPseudoTags 588a780c Propagate errors from readTagLineRaw to readPseudoTags c45f750c Propagate errors from growString and copyName to readTagLineRaw 3b95bcd7 Propagate errors returned from growString() to callers of copyName() 36bcb86b refactor: use tagResult type as the return type of growString() 0b02049b refactor: don't pass NULL as the second argument to readTagLineRaw() c651d872 tests: add a case for tagsFirst() and tagsNext() 57d68675 tests: add missing log messages for a test case ac4ba2a2 cosmetic,tests: delete a trailing whitespace 80863ea3 Merge pull request #26 from masatake/enable-gcov c61d5c90 comment: fix typos in the API description 2d9717d6 build-sys: enable gcov git-subtree-dir: libreadtags git-subtree-split: 6925e6f5b12d6ffe48cf28c1e9e050434631366c
1 parent cb2cf1c commit ff8fc24

30 files changed

+1390
-208
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.deps
22
.libs
3+
*.gcda
4+
*.gcno
5+
*.gcov
36
*.la
47
*.lo
58
*.o
@@ -29,6 +32,7 @@ test-driver
2932
tests/*.log
3033
tests/*.trs
3134
tests/test-api-tagsFind
35+
tests/test-api-tagsFirst
3236
tests/test-api-tagsFirstPseudoTag
3337
tests/test-api-tagsOpen
3438
tests/test-fix-null-deref

Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ ACLOCAL_AMFLAGS = -I m4
33

44
AM_CFLAGS=-Wall
55

6+
EXTRA_DIST = README.md NEWS.md
7+
68
lib_LTLIBRARIES = libreadtags.la
79
libreadtags_la_LDFLAGS = -no-undefined -version-info $(LT_VERSION)
10+
libreadtags_la_CFLAGS = $(GCOV_CFLAGS)
811

912
libreadtags_la_SOURCES = readtags.c readtags.h
1013
nobase_include_HEADERS = readtags.h
1114

12-
EXTRA_DIST = libreadtags.pc.in
15+
EXTRA_DIST += libreadtags.pc.in
1316
pkgconfigdir = $(libdir)/pkgconfig
1417
pkgconfig_DATA = libreadtags.pc
1518

NEWS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Version 0.1.0
2+
3+
- propagate internal errors to caller
4+
5+
- LT_VERSION 1:0:0
6+
7+
- extend the API for the error propagation
8+
9+
- add tagsGetErrno function
10+
- add tagErrno eum type
11+
12+
- break the API
13+
14+
- rename sortType to tagSortType for avoiding name conflictions
15+
However, sortType is still defined as a macro.
16+
See readtags.h

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
# libreadtags
1+
libreadtags is a library for reading tags files generated by ctags.
2+
libreadtags assumes the tags file format explained in [tags(5)](https://docs.ctags.io/en/latest/man/tags.5.html)
3+
of Universal-ctags.
24

3-
THIS REPOSITORY IS FOR TESTING.
4-
DON'T FORK ME. THIS REPOSITORY WILL BE
5-
DELETED AFTER TESTING.
5+
See the comments at the top of readtags.h about the license and copyright.
6+
libreadtags was derived from readtags.c of Exuberant-ctags.
7+
8+
NEWS.md describes note worty changes.
9+
10+
If you are looking for command line interface for tags files,
11+
you will like [readtags command](https://docs.ctags.io/en/latest/man/readtags.1.html)
12+
shipped as part of Universal-ctags. It uses libreadtags extensively.

configure.ac

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
11
# -*- Autoconf -*-
2-
AC_INIT(libreadtags, 0.0.0)
2+
AC_INIT(libreadtags, 0.1.0)
33
AC_CONFIG_MACRO_DIR([m4])
44
AC_CONFIG_SRCDIR([readtags.c])
55

66
AM_INIT_AUTOMAKE
77
AC_PROG_LIBTOOL
88

9-
# libtool -version-info
10-
AC_SUBST(LT_VERSION, [0:0:0])
9+
# LT_VERSION => CURRENT[:REVISION[:AGE]]
10+
#
11+
# (the following instructions are taken from configure.ac in libskk)
12+
#
13+
# If library source has changed since last release, increment revision
14+
# If public symbols have been added, removed or changed since last release,
15+
# increment current and set revision to 0
16+
# If public symbols have been added since last release, increment age
17+
# If public symbols have been removed since last release, set age to 0
18+
#
19+
# Revision history
20+
#
21+
# 0:0:0
22+
# initial version; API is the same as readtags.h in Exuberant-ctags.
23+
#
24+
# 1:0:0
25+
# introduced tagsGetErrno() and tagErrno.
26+
# rename sortType to tagSortType.
27+
28+
AC_SUBST(LT_VERSION, [1:0:0])
29+
30+
AC_ARG_ENABLE([gcov],
31+
[AS_HELP_STRING([--enable-gcov],
32+
[enable 'gcov' coverage testing tool [no]])])
33+
if test "${enable_gcov}" = "yes"; then
34+
GCOV_CFLAGS="--coverage"
35+
fi
36+
AC_SUBST([GCOV_CFLAGS])
1137

1238
AC_PROG_CC_C99
1339

0 commit comments

Comments
 (0)