Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=cfpm.git;a=commitdiff;h=73835d39920a7d31b0f79b60bc580bc41e1ff279

commit 73835d39920a7d31b0f79b60bc580bc41e1ff279
Author: James Buren <r...@frugalware.org>
Date:   Thu Jun 4 15:36:37 2009 -0500

update

diff --git a/README b/README
deleted file mode 100644
index 4b8d044..0000000
--- a/README
+++ /dev/null
@@ -1,9 +0,0 @@
-Notes:
-
-Objective-C types:
-
-BOOL is equal to a regular C 'char' type, with symbolic names 'YES' and 'NO' 
for true/false.
-STR is equal to a regular null-terminated C string, aka a pointer of 'char' 
type.
-IOD is equal to a regular FILE pointer.
-SEL is essentially the same as STR but its a unique string used as a selector.
-DIGIT is equal to a unsigned short int type, only used in the math objects.
diff --git a/main.m b/main.m
deleted file mode 100644
index 19572c9..0000000
--- a/main.m
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "pm.h"
-#include "util.h"
-
-int main(void)
-{
-       id db;
-       id pkg;
-       id str;
-
-       /* initialize libpacman */
-       pacman_initialize ("/");
-
-       /* register the local package database */
-       db = [[Database new] Register: "local"];
-
-       if ( [db Status] )
-       {
-               [db PrintStatus:stderr];
-               return 1;
-       }
-
-       printf ("Repository: %s\n", [db Name]);
-
-       puts("Input a package name to test:");
-
-       str = [UString GetLine:stdin];
-
-       /* query the database */
-       pkg = [db ReadPackage: [str str]];
-       if ( pkg == nil )
-       {
-               printf ("Error, no such package.\n");
-               return 1;
-       }
-
-       /* Print some info about the package */
-       printf ("Name: %s\n", [pkg Name]);
-       printf ("Description: %s\n", [pkg Description]);
-       printf ("Version: %s\n", [pkg Version]);
-       printf ("URL: %s\n", [pkg URL]);
-       printf ("Packager: %s\n", [pkg Packager]);
-
-       /* release memory */
-       [pkg free];
-       [db free];
-       [str free];
-
-       /* release libpacman */
-       pacman_release();
-
-       return 0;
-}
diff --git a/pm.h b/pm.h
deleted file mode 100644
index 6a6dab4..0000000
--- a/pm.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef _PM_HEADER_
-#define _PM_HEADER_
-#include <objcrt/Object.h>
-#include <pacman.h>
-
-/* The shared class */
-...@interface PM_Shared : Object
-{
-       int en; /* error number */
-}
-- (int) Status;
-- (STR) StatusString;
-- PrintStatus: (IOD) f;
-- ResetStatus;
-...@end
-
-/* The database class */
-...@interface Database : PM_Shared
-{
-       PM_DB *db; /* database pointer */
-}
-- (STR) Name;
-- (STR) FirstServer;
-- Register: (STR) s;
-- Unregister;
-- Update: (int) f;
-- ReadPackage: (STR) name;
-- free;
-...@end
-
-/* The package class */
-...@interface Package : PM_Shared
-{
-       PM_PKG *pkg; /* package pointer */
-}
-- (id) initWithPkg: (PM_PKG *) p;
-- (STR) Name;
-- (STR) Version;
-- (STR) Description;
-- (STR) URL;
-- (STR) License;
-- (STR) Arch;
-- (STR) BuildDate;
-- (STR) BuildType;
-- (STR) InstallDate;
-- (STR) Packager;
-- (int) CompressedSize;
-- (int) UncompressedSize;
-- (int) Reason;
-- (STR) MD5Sum;
-- (STR) SHA1Sum;
-- CheckSHA1Sum;
-- CheckMD5Sum;
-- free;
-+ (int) VerCmp: (STR) ver1: (STR) ver2;
-...@end
-
-#endif
-/* -%- indent-width: 4; tab-width: 4; lang: objc -%- */
diff --git a/pm.m b/pm.m
deleted file mode 100644
index 20f6d1c..0000000
--- a/pm.m
+++ /dev/null
@@ -1,171 +0,0 @@
-#include "pm.h"
-
-...@implementation PM_Shared
-- (int) Status { return en; }
-- (STR) StatusString { return pacman_strerror(en); }
-- PrintStatus: (IOD) f
-{
-       if (en != 0)
-       {
-               fprintf(f,"%s\n",[self StatusString]);
-       }
-       return self;
-}
-- ResetStatus
-{
-       en = 0;
-       return self;
-}
-- _set_status
-{
-       en = pm_errno;
-       return self;
-}
-...@end
-
-...@implementation Database
-- (STR) Name
-{
-       return pacman_db_getinfo(db,PM_DB_TREENAME);
-}
-- (STR) FirstServer
-{
-       return pacman_db_getinfo(db,PM_DB_FIRSTSERVER);
-}
-- Register: (STR) s
-{
-
-       if( (db = pacman_db_register(s)) == NULL )
-       {
-               [self _set_status];
-       }
-       return self;
-}
-- Unregister
-{
-       if( pacman_db_unregister(db) == -1 )
-               [self _set_status];
-       return self;
-}
-- Update: (int) f
-{
-       if( pacman_db_update(f,db) == -1 )
-               [self _set_status];
-       return self;
-}
-- ReadPackage: (STR) name
-{
-       id              p = nil;
-       PM_PKG  *pkg = NULL;
-       if( (pkg=pacman_db_readpkg(db,name))!=NULL )
-       {
-               p = [[Package new] initWithPkg:pkg];
-       }
-       return p;
-}
-- free
-{
-       [self Unregister];
-       [super free];
-       return self;
-}
-...@end
-
-...@implementation Package
-- (id) initWithPkg: (PM_PKG *) p
-{
-       pkg = p;
-       return self;
-}
-- (void*) _info: (char) param
-{
-       void *ret = NULL;
-       ret = pacman_pkg_getinfo(pkg,param);
-       if( ret == NULL )
-               [self _set_status];
-       return ret;
-}
-- (STR) Name
-{
-       return (STR) [self _info: PM_PKG_NAME];
-}
-- (STR) Version
-{
-       return (STR) [self _info: PM_PKG_VERSION];
-}
-- (STR) Description
-{
-       return (STR) [self _info: PM_PKG_DESC];
-}
-- (STR) URL
-{
-       return (STR) [self _info: PM_PKG_URL];
-}
-- (STR) License
-{
-       return (STR) [self _info: PM_PKG_LICENSE];
-}
-- (STR) Arch
-{
-       return (STR) [self _info: PM_PKG_ARCH];
-}
-- (STR) BuildDate
-{
-       return (STR) [self _info: PM_PKG_BUILDDATE];
-}
-- (STR) BuildType
-{
-       return (STR) [self _info: PM_PKG_BUILDTYPE];
-}
-- (STR) InstallDate
-{
-       return (STR) [self _info: PM_PKG_INSTALLDATE];
-}
-- (STR) Packager
-{
-       return (STR) [self _info: PM_PKG_PACKAGER];
-}
-- (int) CompressedSize
-{
-       return (int) [self _info: PM_PKG_SIZE];
-}
-- (int) UncompressedSize
-{
-       return (int) [self _info: PM_PKG_USIZE];
-}
-- (int) Reason
-{
-       return (int) [self _info: PM_PKG_REASON];
-}
-- (STR) MD5Sum
-{
-       return (STR) [self _info: PM_PKG_MD5SUM];
-}
-- (STR) SHA1Sum
-{
-       return (STR) [self _info: PM_PKG_SHA1SUM];
-}
-- CheckSHA1Sum
-{
-       if( pacman_pkg_checksha1sum(pkg) == -1 )
-               [self _set_status];
-       return self;
-}
-- CheckMD5Sum
-{
-       if( pacman_pkg_checkmd5sum(pkg) == -1)
-               [self _set_status];
-       return self;
-}
-- free
-{
-       if( pacman_pkg_free(pkg) == -1 )
-               [self _set_status];
-       return self;
-}
-+ (int) VerCmp: (STR) ver1: (STR) ver2
-{
-       return pacman_pkg_vercmp(ver1,ver2);
-}
-...@end
-/* -%- indent-width: 4; tab-width: 4; lang: objc -%- */
diff --git a/util.h b/util.h
deleted file mode 100644
index 1bcf24d..0000000
--- a/util.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _UTIL_HEADER_
-#define _UTIL_HEADER_
-#include <objpak/ocstring.h>
-
-...@interface UString : String
-+ GetLine: (IOD) f;
-- lstrip: (BOOL) ls rstrip: (BOOL) rs;
-...@end
-#endif
-/* -%- indent-width: 4; tab-width: 4; lang: objc -%- */
diff --git a/util.m b/util.m
deleted file mode 100644
index bd55089..0000000
--- a/util.m
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <ctype.h>
-#include "util.h"
-
-...@implementation UString
-+ GetLine: (IOD) f
-{
-       id s = [super new];
-       char b[2];
-       int c;
-
-       b[1] = '\0';
-
-       while( (c = fgetc(f)) != EOF )
-       {
-               if(c == '\n')
-                       break;
-               b[0] = c;
-               [s concatSTR:b];
-       }
-
-       return s;
-}
-- lstrip: (BOOL) ls rstrip: (BOOL) rs
-{
-       unsigned lw = 0, tw = 0;
-
-       if(ls)
-               while( isspace([self charAt:lw]) )
-                       ++lw;
-
-       if(rs)
-               while( isspace([self charAt:[self size]-1-tw]) )
-                       ++tw;
-
-       if(lw+tw == 0)
-               return self;
-
-       if( lw == [self size] || tw == [self size] )
-       {
-               [self assignSTR:""];
-               return self;
-       }
-
-       if(lw)
-               [self deleteFrom:0 to:lw-1];
-
-       if(tw)
-               [self deleteFrom:[self size]-tw to:[self size]-1];
-
-       return self;
-}
-...@end
-/* -%- indent-width: 4; tab-width: 4; lang: objc -%- */
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to