Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11587 - in /trunk/sat-solver: applayer/ bindings/ package/
  • From: kkaempf@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Nov 2008 08:51:07 -0000
  • Message-id: <20081106085107.CB1E3236C3@xxxxxxxxxxxxxxxx>
Author: kkaempf
Date: Thu Nov 6 09:51:07 2008
New Revision: 11587

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11587&view=rev
Log:
add 'user_data' argument to all applayer iterator callbacks (bnc#418491)

Modified:
trunk/sat-solver/applayer/applayer.c
trunk/sat-solver/applayer/applayer.h
trunk/sat-solver/applayer/decision.c
trunk/sat-solver/applayer/decision.h
trunk/sat-solver/applayer/problem.c
trunk/sat-solver/applayer/problem.h
trunk/sat-solver/applayer/xsolvable.c
trunk/sat-solver/applayer/xsolvable.h
trunk/sat-solver/bindings/pool.i
trunk/sat-solver/bindings/problem.i
trunk/sat-solver/bindings/repo.i
trunk/sat-solver/bindings/satsolver.i
trunk/sat-solver/bindings/solver.i
trunk/sat-solver/package/libsatsolver.changes

Modified: trunk/sat-solver/applayer/applayer.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/applayer.c?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/applayer.c (original)
+++ trunk/sat-solver/applayer/applayer.c Thu Nov 6 09:51:07 2008
@@ -35,7 +35,7 @@
}

void
-pool_xsolvables_iterate( Pool *pool, int (*callback)(const XSolvable *xs))
+pool_xsolvables_iterate( Pool *pool, int (*callback)(const XSolvable *xs, void
*user_data), void *user_data)
{
Solvable *s;
Id p;
@@ -44,7 +44,7 @@
{
if (!s->name)
continue;
- if (callback( xsolvable_new( pool, p ) ) )
+ if (callback( xsolvable_new( pool, p ), user_data ) )
break;
}
}

Modified: trunk/sat-solver/applayer/applayer.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/applayer.h?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/applayer.h (original)
+++ trunk/sat-solver/applayer/applayer.h Thu Nov 6 09:51:07 2008
@@ -33,6 +33,6 @@
*/

unsigned int pool_size( Pool *pool );
-void pool_xsolvables_iterate( Pool *pool, int (*callback)(const XSolvable
*xs));
+void pool_xsolvables_iterate( Pool *pool, int (*callback)(const XSolvable *xs,
void *user_data), void *user_data);

#endif /* SATSOLVER_APPLAYER_H */

Modified: trunk/sat-solver/applayer/decision.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/decision.c?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/decision.c (original)
+++ trunk/sat-solver/applayer/decision.c Thu Nov 6 09:51:07 2008
@@ -37,7 +37,7 @@
}

void
-solver_decisions_iterate( Solver *solver, int (*callback)( const Decision *d )
)
+solver_decisions_iterate( Solver *solver, int (*callback)( const Decision *d,
void *user_data ), void *user_data )
{
Pool *pool = solver->pool;
Repo *installed = solver->installed;
@@ -65,7 +65,7 @@
{
d = decision_new( pool, DECISION_REMOVE, s, NULL );
}
- callback( d );
+ callback( d, user_data );
}
}
#endif
@@ -120,7 +120,7 @@
}
}
d = decision_new( pool, op, s, r );
- if (callback( d ))
+ if (callback( d, user_data ))
break;
}
}

Modified: trunk/sat-solver/applayer/decision.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/decision.h?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/decision.h (original)
+++ trunk/sat-solver/applayer/decision.h Thu Nov 6 09:51:07 2008
@@ -37,6 +37,6 @@
Decision *decision_new( Pool *pool, int op, Id solvable, Id reason );
void decision_free( Decision *d );

-void solver_decisions_iterate( Solver *solver, int (*callback)( const Decision
*d ) );
+void solver_decisions_iterate( Solver *solver, int (*callback)( const Decision
*d, void *user_data ), void *user_data);

#endif /* SATSOLVER_DECISION_H */

Modified: trunk/sat-solver/applayer/problem.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/problem.c?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/problem.c (original)
+++ trunk/sat-solver/applayer/problem.c Thu Nov 6 09:51:07 2008
@@ -44,7 +44,7 @@


void
-solver_problems_iterate( Solver *solver, Transaction *t, int (*callback)(
const Problem *p) )
+solver_problems_iterate( Solver *solver, Transaction *t, int (*callback)(const
Problem *p, void *user_data), void *user_data )
{
Id problem = 0;
if (!callback)
@@ -53,14 +53,14 @@
while ((problem = solver_next_problem( solver, problem )) != 0)
{
Problem *p = problem_new( solver, t, problem );
- if (callback( p ) )
+ if (callback( p, user_data ) )
break;
}
}


void
-problem_solutions_iterate( Problem *problem, int (*callback)( const Solution
*s ) )
+problem_solutions_iterate( Problem *problem, int (*callback)( const Solution
*s, void *user_data ), void *user_data )
{
if (!callback) /* no use to iterate without callback */
return;
@@ -179,9 +179,7 @@
}
}
Solution *s = solution_new( problem->solver->pool, code, s1, n1, s2, n2
);
- if (callback( s ))
+ if (callback( s, user_data ))
break;
}
}
-
-

Modified: trunk/sat-solver/applayer/problem.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/problem.h?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/problem.h (original)
+++ trunk/sat-solver/applayer/problem.h Thu Nov 6 09:51:07 2008
@@ -36,7 +36,7 @@
Problem *problem_new( Solver *s, Transaction *t, Id id );
void problem_free( Problem *p );

-void solver_problems_iterate( Solver *solver, Transaction *t, int (*callback)(
const Problem *p) );
-void problem_solutions_iterate( Problem *p, int (*callback)( const Solution *s
) );
+void solver_problems_iterate( Solver *solver, Transaction *t, int (*callback)(
const Problem *p, void *user_data ), void *user_data );
+void problem_solutions_iterate( Problem *p, int (*callback)( const Solution
*s, void *user_data ), void *user_data );

#endif /* SATSOLVER_PROBLEM_H */

Modified: trunk/sat-solver/applayer/xsolvable.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/xsolvable.c?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/xsolvable.c (original)
+++ trunk/sat-solver/applayer/xsolvable.c Thu Nov 6 09:51:07 2008
@@ -202,7 +202,7 @@
*/

void
-solver_installs_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs ) )
+solver_installs_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs, void *user_data ), void *user_data )
{
Id p;
Solvable *s;
@@ -231,7 +231,7 @@
continue; /* already installed resolvable */

if (!obsoletesmap || !obsoletesmap[p])
- if (callback( xsolvable_new( solver->pool, p ) ) )
+ if (callback( xsolvable_new( solver->pool, p ), user_data ) )
break;
}
if (obsoletesmap)
@@ -244,7 +244,7 @@
*/

void
-solver_removals_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs ) )
+solver_removals_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs, void *user_data ), void *user_data )
{
Id p;
Solvable *s;
@@ -267,7 +267,7 @@
continue; /* we keep this package */
if (obsoletesmap && obsoletesmap[p])
continue; /* its being obsoleted (updated) */
- if (callback( xsolvable_new( solver->pool, p ) ) )
+ if (callback( xsolvable_new( solver->pool, p ), user_data ) )
break;
}
if (obsoletesmap)
@@ -280,7 +280,7 @@
*/

void
-solver_updates_iterate( Solver *solver, int (*callback)( const XSolvable
*xs_old, const XSolvable *xs_new ) )
+solver_updates_iterate( Solver *solver, int (*callback)( const XSolvable
*xs_old, const XSolvable *xs_new, void *user_data ), void *user_data )
{
Id p;
Solvable *s;
@@ -302,7 +302,7 @@
if (solver->decisionmap[p] >= 0)
continue; /* we keep this package */
if (obsoletesmap[p])
- if (callback( xsolvable_new( solver->pool, p ), xsolvable_new(
solver->pool, obsoletesmap[p] ) ) )
+ if (callback( xsolvable_new( solver->pool, p ), xsolvable_new(
solver->pool, obsoletesmap[p] ), user_data ) )
break;
}
sat_free( obsoletesmap );
@@ -310,7 +310,7 @@


void
-solver_suggestions_iterate( Solver *solver, int (*callback)( const XSolvable
*xs ) )
+solver_suggestions_iterate( Solver *solver, int (*callback)( const XSolvable
*xs, void *user_data ), void *user_data )
{
int i;

@@ -319,14 +319,14 @@

for (i = 0; i < solver->suggestions.count; i++)
{
- if (callback( xsolvable_new( solver->pool,
solver->suggestions.elements[i] ) ) )
+ if (callback( xsolvable_new( solver->pool,
solver->suggestions.elements[i] ), user_data ) )
break;
}
}


void
-repo_xsolvables_iterate( Repo *repo, int (*callback)( const XSolvable *xs ) )
+repo_xsolvables_iterate( Repo *repo, int (*callback)( const XSolvable *xs,
void *user_data ), void *user_data )
{
Solvable *s;
Id p;
@@ -336,7 +336,7 @@
continue;
if (!s->name)
continue;
- if (callback( xsolvable_new( repo->pool, s - repo->pool->solvables ) ) )
+ if (callback( xsolvable_new( repo->pool, s - repo->pool->solvables ),
user_data ) )
break;
}
}

Modified: trunk/sat-solver/applayer/xsolvable.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/xsolvable.h?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/applayer/xsolvable.h (original)
+++ trunk/sat-solver/applayer/xsolvable.h Thu Nov 6 09:51:07 2008
@@ -83,27 +83,27 @@
* if all = 0, only report *newly* installed ones (non-updates)
* if all = 1, report all to-be-installed ones
*/
-void solver_installs_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs ) );
+void solver_installs_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs, void *user_data ), void *user_data );

/* iterate over all to-be-removed solvables
* if all = 0, only report *dropped* ones (non-updates)
* if all = 1, report all to-be-removed ones
*/
-void solver_removals_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs ) );
+void solver_removals_iterate( Solver *solver, int all, int (*callback)( const
XSolvable *xs, void *user_data ), void *user_data );

/*
* Iterate over all solvables which update installed ones
*/
-void solver_updates_iterate( Solver *solver, int (*callback)( const XSolvable
*xs_old, const XSolvable *xs_new ) );
+void solver_updates_iterate( Solver *solver, int (*callback)( const XSolvable
*xs_old, const XSolvable *xs_new, void *user_data ), void *user_data );

/*
* Iterate over all solvables being suggested in the last solver run
*/
-void solver_suggestions_iterate( Solver *solver, int (*callback)( const
XSolvable *xs ) );
+void solver_suggestions_iterate( Solver *solver, int (*callback)( const
XSolvable *xs, void *user_data ), void *user_data );

/*
* Iterate over all solvables of the given repo
*/
-void repo_xsolvables_iterate( Repo *repo, int (*callback)( const XSolvable *xs
) );
+void repo_xsolvables_iterate( Repo *repo, int (*callback)( const XSolvable
*xs, void *user_data ), void *user_data );

#endif /* SATSOLVER_XSOLVABLE_H */

Modified: trunk/sat-solver/bindings/pool.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/pool.i?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/bindings/pool.i (original)
+++ trunk/sat-solver/bindings/pool.i Thu Nov 6 09:51:07 2008
@@ -198,7 +198,7 @@
pool_createwhatprovides( $self );

FOR_PROVIDES(p, pp, rel->id)
- generic_xsolvables_iterate_callback( xsolvable_new( $self, p ) );
+ generic_xsolvables_iterate_callback( xsolvable_new( $self, p ), NULL );
}
#endif

@@ -247,7 +247,7 @@
pool_createwhatprovides($self);

FOR_PROVIDES(p, pp, str2id( $self, name, 0) )
- generic_xsolvables_iterate_callback( xsolvable_new( $self, p ) );
+ generic_xsolvables_iterate_callback( xsolvable_new( $self, p ), NULL );
#endif
}

@@ -281,7 +281,7 @@

#if defined(SWIGRUBY)
void each()
- { pool_xsolvables_iterate( $self, generic_xsolvables_iterate_callback ); }
+ { pool_xsolvables_iterate( $self, generic_xsolvables_iterate_callback, NULL
); }
#endif

#if defined(SWIGPYTHON)

Modified: trunk/sat-solver/bindings/problem.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/problem.i?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/bindings/problem.i (original)
+++ trunk/sat-solver/bindings/problem.i Thu Nov 6 09:51:07 2008
@@ -8,7 +8,7 @@
*/

static int
-problem_solutions_iterate_callback( const Solution *s )
+problem_solutions_iterate_callback(const Solution *s, void *user_data)
{
#if defined(SWIGRUBY)
/* FIXME: how to pass 'break' back to the caller ? */
@@ -61,7 +61,7 @@
{ return xsolvable_new( $self->solver->pool, $self->target ); }

void each_solution()
- { problem_solutions_iterate( $self, problem_solutions_iterate_callback ); }
+ { problem_solutions_iterate( $self, problem_solutions_iterate_callback, NULL
); }

}


Modified: trunk/sat-solver/bindings/repo.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/repo.i?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/bindings/repo.i (original)
+++ trunk/sat-solver/bindings/repo.i Thu Nov 6 09:51:07 2008
@@ -91,7 +91,7 @@

#if defined(SWIGRUBY)
void each()
- { repo_xsolvables_iterate( $self, generic_xsolvables_iterate_callback ); }
+ { repo_xsolvables_iterate( $self, generic_xsolvables_iterate_callback, NULL
); }
#endif
#if defined(SWIGPYTHON)
%pythoncode %{

Modified: trunk/sat-solver/bindings/satsolver.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/satsolver.i?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/bindings/satsolver.i (original)
+++ trunk/sat-solver/bindings/satsolver.i Thu Nov 6 09:51:07 2008
@@ -136,7 +136,7 @@
*/

static int
-generic_xsolvables_iterate_callback( const XSolvable *xs )
+generic_xsolvables_iterate_callback( const XSolvable *xs, void *user_data )
{
/* FIXME: how to pass 'break' back to the caller ? */
rb_yield( SWIG_NewPointerObj((void*)xs, SWIGTYPE_p__Solvable, 0) );

Modified: trunk/sat-solver/bindings/solver.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/solver.i?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/bindings/solver.i (original)
+++ trunk/sat-solver/bindings/solver.i Thu Nov 6 09:51:07 2008
@@ -9,7 +9,7 @@
*/

static int
-update_xsolvables_iterate_callback( const XSolvable *xs_old, const XSolvable
*xs_new )
+update_xsolvables_iterate_callback( const XSolvable *xs_old, const XSolvable
*xs_new, void *user_data )
{
/* FIXME: how to pass 'break' back to the caller ? */
rb_yield_values( 2, SWIG_NewPointerObj((void*)xs_old, SWIGTYPE_p__Solvable,
0), SWIG_NewPointerObj((void*)xs_new, SWIGTYPE_p__Solvable, 0) );
@@ -21,7 +21,7 @@
*/

static int
-solver_decisions_iterate_callback( const Decision *d )
+solver_decisions_iterate_callback( const Decision *d, void *user_data )
{
/* FIXME: how to pass 'break' back to the caller ? */
rb_yield(SWIG_NewPointerObj((void*) d, SWIGTYPE_p__Decision, 0));
@@ -34,7 +34,7 @@
*/

static int
-solver_problems_iterate_callback( const Problem *p )
+solver_problems_iterate_callback( const Problem *p, void *user_data )
{
/* FIXME: how to pass 'break' back to the caller ? */
rb_yield( SWIG_NewPointerObj((void*) p, SWIGTYPE_p__Problem, 0) );
@@ -271,7 +271,7 @@

#if defined(SWIGRUBY)
void each_decision()
- { return solver_decisions_iterate( $self, solver_decisions_iterate_callback
); }
+ { return solver_decisions_iterate( $self, solver_decisions_iterate_callback,
NULL ); }
#endif

#if defined(SWIGRUBY)
@@ -291,7 +291,7 @@

#if defined(SWIGRUBY)
void each_problem( Transaction *t )
- { return solver_problems_iterate( $self, t, solver_problems_iterate_callback
); }
+ { return solver_problems_iterate( $self, t,
solver_problems_iterate_callback, NULL ); }

/*
* iterate over all to-be-*newly*-installed solvables
@@ -301,10 +301,10 @@
* solvables
*/
void each_to_install(int bflag = 0)
- { return solver_installs_iterate( $self, bflag,
generic_xsolvables_iterate_callback ); }
+ { return solver_installs_iterate( $self, bflag,
generic_xsolvables_iterate_callback, NULL ); }

void each_to_update()
- { return solver_updates_iterate( $self, update_xsolvables_iterate_callback
); }
+ { return solver_updates_iterate( $self, update_xsolvables_iterate_callback,
NULL ); }

/*
* iterate over all to-be-removed-without-replacement solvables
@@ -313,10 +313,10 @@
* if true (resp '1') is passed, iterate over *all* to-be-removed solvables
*/
void each_to_remove(int bflag = 0)
- { return solver_removals_iterate( $self, bflag,
generic_xsolvables_iterate_callback ); }
+ { return solver_removals_iterate( $self, bflag,
generic_xsolvables_iterate_callback, NULL ); }

void each_suggested()
- { return solver_suggestions_iterate( $self,
generic_xsolvables_iterate_callback); }
+ { return solver_suggestions_iterate( $self,
generic_xsolvables_iterate_callback, NULL ); }
#endif /* SWIGRUBY */

#if defined(SWIGPERL)

Modified: trunk/sat-solver/package/libsatsolver.changes
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/package/libsatsolver.changes?rev=11587&r1=11586&r2=11587&view=diff
==============================================================================
--- trunk/sat-solver/package/libsatsolver.changes (original)
+++ trunk/sat-solver/package/libsatsolver.changes Thu Nov 6 09:51:07 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Nov 6 09:49:51 CET 2008 - kkaempf@xxxxxxx
+
+- Add 'user_data' argument to all applayer iterator callbacks
+ (bnc#418491)
+
+-------------------------------------------------------------------
Wed Oct 29 12:36:57 CET 2008 - ma@xxxxxxx

- Add 'sh4' architectures.

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages