PROJECT(libzypp)
-SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Woverloaded-virtual" )
-SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall " )
-
# Library
IF ( DEFINED LIB )
SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
SET( PACKAGE "libzypp" )
SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
-ADD_DEFINITIONS( -g )
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -Wall -Woverloaded-virtual" )
+SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -Wall" )
+ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 )
ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
SET( LIBZYPP_VERSION_INFO "${LIBZYPP_SO_FIRST}.${LIBZYPP_AGE}.${LIBZYPP_PATCH}" )
-#if 0
-#include "Tools.h"
+#include <iostream>
+#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
+#include "zypp/base/Function.h"
+#include "zypp/base/IOStream.h"
+#include "zypp/base/InputStream.h"
+#include "zypp/ProgressData.h"
-#include "zypp/base/Sysconfig.h"
+#include "zypp/base/Random.h"
+
+#include <boost/thread.hpp>
using std::endl;
using namespace zypp;
-namespace sysconfig = base::sysconfig;
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+void action( int i_r )
+{
+ unsigned sec = base::random( 3 );
+ sleep( sec );
+ MIL << "Action " << i_r << " (" << sec << ")" << endl;
+}
-/******************************************************************
-**
-** FUNCTION NAME : main
-** FUNCTION TYPE : int
-*/
int main( int argc, char * argv[] )
{
- DBG << "===[START]==========================================" << endl;
+ INT << "===[START]==========================================" << endl;
- Capability f( CapFactory().parse( Resolvable::Kind( "package" ), "filesystem(foo)" ) );
- Capability e( CapFactory().filesystemEvalCap() );
+ for ( unsigned i = 0; i < 5; ++i )
+ {
+ new boost::thread( bind( action, i ) );
+ }
- MIL << f << endl;
- MIL << e << endl;
- MIL << f.matches( e ) << endl;
- MIL << e.matches( f ) << endl;
-
- DBG << "===[END]============================================" << endl;
- zypp::base::LogControl::instance().logNothing();
- return 0;
+ INT << "===[END]============================================" << endl << endl;
+ return ( 0 );
}
-#endif
-
- #include <iostream>
- #include "zypp/base/Logger.h"
- #include "zypp/base/IOStream.h"
- #include "zypp/base/InputStream.h"
- #include "zypp/ProgressData.h"
-
- using namespace zypp;
-
- // Defined in ProgressData.h:
- // Initialize ProgressData from an InputStream.
- //
- // ProgressData makeProgressData( const InputStream & input_r )
- // {
- // ProgressData ret;
- // ret.name( input_r.name() );
- // if ( input_r.size() > 0 )
- // ret.range( input_r.size() );
- // return ret;
- // }
-
- void simpleParser( const InputStream & input_r,
- const ProgressData::ReceiverFnc & fnc_r = ProgressData::ReceiverFnc() )
- {
- ProgressData ticks( makeProgressData( input_r ) );
- ticks.sendTo( fnc_r );
- ticks.toMin(); // start sending min (0)
-
- iostr::EachLine line( input_r );
- for( ; line; line.next() )
- {
- /* process the line */
-
- if ( ! ticks.set( input_r.stream().tellg() ) )
- return; // user requested abort
- }
-
- ticks.toMax(); // take care 100% are reported on success
- }
-
- int main( int argc, char * argv[] )
- {
- simpleParser( "packages" );
- simpleParser( "packages.gz" );
- return ( 0 );
- }
//! \todo maybe appendChangelog(const data::RecordId & resolvable_id, Changelog changelog) will be needed
//! for inserting the changelog using in-memory record id of corresponding resolvable.
//! (first, we'll see how fast is the inserting without remembering those ids)
+ return data::noRecordId;
}
RecordId CacheStore::consumeFilelist( const data::RecordId & repository_id,
const data::Filenames & filenames )
{
//! \todo maybe consumeFilelist(const data::RecordId & resolvable_id, data::Filenames &) will be needed
+ return data::noRecordId;
}
RecordId CacheStore::appendResolvable( const RecordId &repository_id,
#include <stdlib.h>
#include <string.h>
-static
+static int
mkarray(filename, file, ofile, varname)
char *filename;
FILE *file;
char *varname;
{
char buf[BUFSIZ];
- size_t i, rsize, tsize=0;
+ size_t rsize, tsize=0;
int done=0, line=8, status=EXIT_SUCCESS;
fprintf(ofile, "/*\n");
if(8!=line) fputc('\n', ofile);
fputs("};\n\n", ofile);
- fprintf(ofile, "size_t _%s_size=%d;\n", varname, tsize);
+ fprintf(ofile, "size_t _%s_size=%d;\n", varname, (int)tsize);
fprintf(ofile, "size_t *%s_size=&_%s_size;\n", varname, varname);
if(ferror(ofile)) {
return status;
}
+int
main(argc, argv)
char *argv[];
{
char *filename, *ofilename, *varname;
- FILE *file;
int status=EXIT_SUCCESS;
--argc;
sqlite3_command::sqlite3_command(sqlite3_connection &con, const wchar_t *sql) : con(con),refs(0)\r
{\r
const wchar_t *tail=NULL;\r
- if (sqlite3_prepare16(con.db, sql, -1, &this->stmt, (const void**)&tail)!=SQLITE_OK)\r
+ const wchar_t **tmpptr=&tail;\r
+ if (sqlite3_prepare16(con.db, sql, -1, &this->stmt, (const void**)tmpptr)!=SQLITE_OK)\r
SQLITE3X_THROW(database_error(con));\r
\r
this->argc=sqlite3_column_count(this->stmt);\r
sqlite3_command::sqlite3_command(sqlite3_connection &con, const std::wstring &sql) : con(con),refs(0)\r
{\r
const wchar_t *tail=NULL;\r
- if (sqlite3_prepare16(con.db, sql.data(), (int)sql.length()*2, &this->stmt, (const void**)&tail)!=SQLITE_OK)\r
+ const wchar_t **tmpptr=&tail;\r
+ if (sqlite3_prepare16(con.db, sql.data(), (int)sql.length()*2, &this->stmt, (const void**)tmpptr)!=SQLITE_OK)\r
SQLITE3X_THROW(database_error(con));\r
\r
this->argc=sqlite3_column_count(this->stmt);\r
| |
\---------------------------------------------------------------------*/
+#include <iostream>
#include <map>
#include "zypp/base/Exception.h"
#include "RepoType.h"
| |
\---------------------------------------------------------------------*/
+#include <iostream>
#include <map>
#include "zypp/base/Exception.h"
#include "ResourceType.h"