Skip to content

Commit 55a8ad5

Browse files
committed
repo: update C function names for restrictive repo iterator
1 parent 7173d87 commit 55a8ad5

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

src/pkgcraft/pkgcraft_c.pxd

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,27 @@ cdef extern from "pkgcraft.h":
11571157
# The argument must be a non-null RepoIter pointer.
11581158
Pkg *pkgcraft_repo_iter_next(RepoIter *i)
11591159

1160+
# Return a restriction package iterator for a repo.
1161+
#
1162+
# # Safety
1163+
# The repo argument must be a non-null Repo pointer and the restrict argument must be a non-null
1164+
# Restrict pointer.
1165+
RepoIterRestrict *pkgcraft_repo_iter_restrict(Repo *repo, Restrict *restrict)
1166+
1167+
# Free a repo restriction iterator.
1168+
#
1169+
# # Safety
1170+
# The argument must be a non-null RepoIterRestrict pointer or NULL.
1171+
void pkgcraft_repo_iter_restrict_free(RepoIterRestrict *i)
1172+
1173+
# Return the next package from a restriction package iterator.
1174+
#
1175+
# Returns NULL when the iterator is empty.
1176+
#
1177+
# # Safety
1178+
# The argument must be a non-null RepoIterRestrict pointer.
1179+
Pkg *pkgcraft_repo_iter_restrict_next(RepoIterRestrict *i)
1180+
11601181
# Return a repo's length.
11611182
#
11621183
# # Safety
@@ -1177,27 +1198,6 @@ cdef extern from "pkgcraft.h":
11771198
# The argument must be a non-null Repo pointer.
11781199
char *pkgcraft_repo_path(Repo *r)
11791200

1180-
# Return a restriction package iterator for a repo.
1181-
#
1182-
# # Safety
1183-
# The repo argument must be a non-null Repo pointer and the restrict argument must be a non-null
1184-
# Restrict pointer.
1185-
RepoIterRestrict *pkgcraft_repo_restrict_iter(Repo *repo, Restrict *restrict)
1186-
1187-
# Free a repo restriction iterator.
1188-
#
1189-
# # Safety
1190-
# The argument must be a non-null RepoIterRestrict pointer or NULL.
1191-
void pkgcraft_repo_restrict_iter_free(RepoIterRestrict *i)
1192-
1193-
# Return the next package from a restriction package iterator.
1194-
#
1195-
# Returns NULL when the iterator is empty.
1196-
#
1197-
# # Safety
1198-
# The argument must be a non-null RepoIterRestrict pointer.
1199-
Pkg *pkgcraft_repo_restrict_iter_next(RepoIterRestrict *i)
1200-
12011201
# Perform a set operation on a repo set and repo, assigning to the set.
12021202
#
12031203
# # Safety

src/pkgcraft/repo/base.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ cdef class _IterRestrict:
195195

196196
def __cinit__(self, Repo repo not None, object obj not None):
197197
cdef Restrict r = obj if isinstance(obj, Restrict) else Restrict(obj)
198-
self.ptr = C.pkgcraft_repo_restrict_iter(repo.ptr, r.ptr)
198+
self.ptr = C.pkgcraft_repo_iter_restrict(repo.ptr, r.ptr)
199199

200200
def __iter__(self):
201201
return self
202202

203203
def __next__(self):
204-
ptr = C.pkgcraft_repo_restrict_iter_next(self.ptr)
204+
ptr = C.pkgcraft_repo_iter_restrict_next(self.ptr)
205205
if ptr is not NULL:
206206
return Pkg.from_ptr(ptr)
207207
raise StopIteration
208208

209209
def __dealloc__(self):
210-
C.pkgcraft_repo_restrict_iter_free(self.ptr)
210+
C.pkgcraft_repo_iter_restrict_free(self.ptr)

0 commit comments

Comments
 (0)