Skip to content

Commit

Permalink
focusing on setlimit (peopel moved on from TC 1.4.10). Closes gh-26
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Dec 22, 2009
1 parent ee5e442 commit 4b0a75e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
4 changes: 1 addition & 3 deletions lib/rufus/edo/tabcore.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -533,9 +533,7 @@ def add (colname, operator, val, affirmative=true, no_index=false)
# #
def limit (i, offset=-1) def limit (i, offset=-1)


@query.respond_to?(:setlimit) ? @query.setlimit(i, offset)
@query.setlimit(i, offset) :
@query.setmax(i)
end end


# Sets the sort order for the result of the query # Sets the sort order for the result of the query
Expand Down
7 changes: 1 addition & 6 deletions lib/rufus/tokyo/cabinet/lib.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -177,12 +177,7 @@ class << self
callback :TDBQRYPROC, [:pointer, :int, :pointer, :pointer], :int callback :TDBQRYPROC, [:pointer, :int, :pointer, :pointer], :int
attfunc :qry_proc, :tctdbqryproc, [ :pointer, :TDBQRYPROC, :pointer], :bool attfunc :qry_proc, :tctdbqryproc, [ :pointer, :TDBQRYPROC, :pointer], :bool



attfunc :qry_setlimit, :tctdbqrysetlimit, [ :pointer, :int, :int ], :void
begin # since TC 1.4.10
attfunc :qry_setmax, :tctdbqrysetmax, [ :pointer, :int ], :void
rescue FFI::NotFoundError => nfe
attfunc :qry_setlimit, :tctdbqrysetlimit, [ :pointer, :int, :int ], :void
end


attfunc :qry_search, :tctdbqrysearch, [ :pointer ], :pointer attfunc :qry_search, :tctdbqrysearch, [ :pointer ], :pointer
attfunc :qry_searchout, :tctdbqrysearchout, [ :pointer ], :bool attfunc :qry_searchout, :tctdbqrysearchout, [ :pointer ], :bool
Expand Down
4 changes: 1 addition & 3 deletions lib/rufus/tokyo/cabinet/table.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -722,9 +722,7 @@ def add (colname, operator, val, affirmative=true, no_index=false)
# #
def limit (i, offset=-1) def limit (i, offset=-1)


lib.respond_to?(:qry_setlimit) ? lib.qry_setlimit(@query, i, offset)
lib.qry_setlimit(@query, i, offset) :
lib.qry_setmax(@query, i)
end end


# Sets the sort order for the result of the query # Sets the sort order for the result of the query
Expand Down
6 changes: 1 addition & 5 deletions lib/rufus/tokyo/tyrant/lib.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ class << self
attfunc :qry_addcond, :tcrdbqryaddcond, [ :pointer, :string, :int, :string ], :void attfunc :qry_addcond, :tcrdbqryaddcond, [ :pointer, :string, :int, :string ], :void
attfunc :qry_setorder, :tcrdbqrysetorder, [ :pointer, :string, :int ], :void attfunc :qry_setorder, :tcrdbqrysetorder, [ :pointer, :string, :int ], :void


begin attfunc :qry_setlimit, :tcrdbqrysetlimit, [ :pointer, :int, :int ], :void
attfunc :qry_setmax, :tcrdbqrysetmax, [ :pointer, :int ], :void
rescue FFI::NotFoundError => nfe
attfunc :qry_setlimit, :tcrdbqrysetlimit, [ :pointer, :int, :int ], :void
end


attfunc :qry_search, :tcrdbqrysearch, [ :pointer ], :pointer attfunc :qry_search, :tcrdbqrysearch, [ :pointer ], :pointer
attfunc :qry_searchout, :tcrdbqrysearchout, [ :pointer ], :bool attfunc :qry_searchout, :tcrdbqrysearchout, [ :pointer ], :bool
Expand Down

0 comments on commit 4b0a75e

Please sign in to comment.