summaryrefslogtreecommitdiff
path: root/python/tag.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-11-24 10:00:29 +0000
committerArch Librarian <arch@canonical.com>2004-11-24 10:00:29 +0000
commitc0bf63530bcb93425a6088c14fca1868e8b3a9fc (patch)
treeed6e003cffe4bd09366437f82434e24ad746b233 /python/tag.cc
parentbd0b7c36a57ddf88abe8e3d6cf388b783780a40b (diff)
downloadpython-apt-c0bf63530bcb93425a6088c14fca1868e8b3a9fc.tar.gz
Fix g++-3.0 compilation issues
Author: mdz Date: 2002-02-26 01:36:15 GMT Fix g++-3.0 compilation issues
Diffstat (limited to 'python/tag.cc')
-rw-r--r--python/tag.cc55
1 files changed, 29 insertions, 26 deletions
diff --git a/python/tag.cc b/python/tag.cc
index 682aa0a1..41db059c 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: tag.cc,v 1.2 2002/01/08 06:53:04 jgg Exp $
+// $Id: tag.cc,v 1.3 2002/02/26 01:36:15 mdz Exp $
/* ######################################################################
Tag - Binding for the RFC 822 tag file parser
@@ -19,18 +19,20 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include "generic.h"
#include "apt_pkgmodule.h"
#include <apt-pkg/tagfile.h>
#include <stdio.h>
+#include <iostream>
#include <Python.h>
- /*}}}*/
-static PyMethodDef TagSecMethods[];
-static PyMethodDef TagFileMethods[];
+using namespace std;
+ /*}}}*/
/* We need to keep a private copy of the data.. */
struct TagSecData : public CppPyObject<pkgTagSection>
{
@@ -45,28 +47,6 @@ struct TagFileData : public PyObject
FileFd Fd;
};
-// TagSecGetAttr - Get an attribute - variable/method /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-static PyObject *TagSecGetAttr(PyObject *Self,char *Name)
-{
- return Py_FindMethod(TagSecMethods,Self,Name);
-}
- /*}}}*/
-// TagFileGetAttr - Get an attribute - variable/method /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-static PyObject *TagFileGetAttr(PyObject *Self,char *Name)
-{
- if (strcmp("Section",Name) == 0)
- {
- PyObject *Obj = ((TagFileData *)Self)->Section;
- Py_INCREF(Obj);
- return Obj;
- }
-
- return Py_FindMethod(TagFileMethods,Self,Name);
-}
/*}}}*/
// TagSecFree - Free a Tag Section /*{{{*/
// ---------------------------------------------------------------------
@@ -388,6 +368,14 @@ static PyMethodDef TagSecMethods[] =
{}
};
+// TagSecGetAttr - Get an attribute - variable/method /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+static PyObject *TagSecGetAttr(PyObject *Self,char *Name)
+{
+ return Py_FindMethod(TagSecMethods,Self,Name);
+}
+ /*}}}*/
// Type for a Tag Section
PyMappingMethods TagSecMapMeth = {TagSecLength,TagSecMap,0};
PyTypeObject TagSecType =
@@ -423,6 +411,21 @@ static PyMethodDef TagFileMethods[] =
{}
};
+// TagFileGetAttr - Get an attribute - variable/method /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+static PyObject *TagFileGetAttr(PyObject *Self,char *Name)
+{
+ if (strcmp("Section",Name) == 0)
+ {
+ PyObject *Obj = ((TagFileData *)Self)->Section;
+ Py_INCREF(Obj);
+ return Obj;
+ }
+
+ return Py_FindMethod(TagFileMethods,Self,Name);
+}
+
// Type for a Tag File
PyTypeObject TagFileType =
{