// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: error.h,v 1.6 1999/01/18 06:20:08 jgg Exp $
+// $Id: error.h,v 1.8 2001/05/07 05:06:52 jgg Exp $
/* ######################################################################
Global Erorr Class - Global error mechanism
#ifndef PKGLIB_ERROR_H
#define PKGLIB_ERROR_H
-#ifdef __GNUG__
-#pragma interface "apt-pkg/error.h"
-#endif
+#include <apt-pkg/macros.h>
#include <string>
{
struct Item
{
- string Text;
+ std::string Text;
bool Error;
Item *Next;
};
public:
// Call to generate an error from a library call.
- bool Errno(const char *Function,const char *Description,...);
- bool WarningE(const char *Function,const char *Description,...);
+ bool Errno(const char *Function,const char *Description,...) __like_printf_2 __cold;
+ bool WarningE(const char *Function,const char *Description,...) __like_printf_2 __cold;
/* A warning should be considered less severe than an error, and may be
ignored by the client. */
- bool Error(const char *Description,...);
- bool Warning(const char *Description,...);
+ bool Error(const char *Description,...) __like_printf_1 __cold;
+ bool Warning(const char *Description,...) __like_printf_1 __cold;
// Simple accessors
inline bool PendingError() {return PendingFlag;};
inline bool empty() {return List == 0;};
- bool PopMessage(string &Text);
+ bool PopMessage(std::string &Text);
void Discard();
// Usefull routine to dump to cerr