Subversion Repositories SvarDOS

Rev

Rev 228 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 228 Rev 232
Line 8... Line 8...
8
#include <stdlib.h>   /* atoi(), qsort() - not using it after all, redefining it manually later */
8
#include <stdlib.h>   /* atoi(), qsort() - not using it after all, redefining it manually later */
9
#include <string.h>   /* strlen() */
9
#include <string.h>   /* strlen() */
10
#include <sys/types.h>
10
#include <sys/types.h>
11
#include <direct.h> /* opendir() and friends */
11
#include <direct.h> /* opendir() and friends */
12
 
12
 
13
#include "fdnpkg.h"   /* PKGINST_UPDATE */
13
#include "fdnpkg.h"
14
#include "fileexst.h"
14
#include "fileexst.h"
15
#include "getdelim.h"
15
#include "getdelim.h"
16
#include "helpers.h"  /* fdnpkg_strcasestr(), slash2backslash()... */
16
#include "helpers.h"  /* fdnpkg_strcasestr(), slash2backslash()... */
17
#include "kprintf.h"
17
#include "kprintf.h"
18
#include "libunzip.h"  /* zip_freelist()... */
18
#include "libunzip.h"  /* zip_freelist()... */
Line 31... Line 31...
31
  char **s2 = (char **)str2;
31
  char **s2 = (char **)str2;
32
  return(strcasecmp(*s1, *s2));
32
  return(strcasecmp(*s1, *s2));
33
}
33
}
34
 
34
 
35
 
35
 
36
static int loadinstpkglist(char **packagelist, char **packagelist_ver, int packagelist_maxlen, char *filterstr, char *dosdir) {
36
static int loadinstpkglist(char **packagelist, char **packagelist_ver, int packagelist_maxlen, char *filterstr, const char *dosdir) {
37
  DIR *dp;
37
  DIR *dp;
38
  int packagelist_len = 0, x;
38
  int packagelist_len = 0, x;
39
  struct dirent *ep;
39
  struct dirent *ep;
40
  #define verstr_maxlen 64
40
  #define verstr_maxlen 64
41
  char pkgdir[512], lsmfilename[1024], verstr[verstr_maxlen];
41
  char pkgdir[512], lsmfilename[1024], verstr[verstr_maxlen];
Line 77... Line 77...
77
  }
77
  }
78
}
78
}
79
 
79
 
80
#define packagelist_maxlen 1024
80
#define packagelist_maxlen 1024
81
 
81
 
82
void showinstalledpkgs(char *filterstr, char *dosdir) {
82
void showinstalledpkgs(char *filterstr, const char *dosdir) {
83
  char *packagelist[packagelist_maxlen];
83
  char *packagelist[packagelist_maxlen];
84
  char *packagelist_ver[packagelist_maxlen];
84
  char *packagelist_ver[packagelist_maxlen];
85
  int packagelist_len, x;
85
  int packagelist_len, x;
86
 
86
 
87
  /* load the list of packages */
87
  /* load the list of packages */
Line 109... Line 109...
109
  }
109
  }
110
}
110
}
111
 
111
 
112
 
112
 
113
/* returns a linked list of the files that belong to package pkgname */
113
/* returns a linked list of the files that belong to package pkgname */
114
struct flist_t *pkg_loadflist(char *pkgname, char *dosdir) {
114
struct flist_t *pkg_loadflist(const char *pkgname, const char *dosdir) {
115
  struct flist_t *res = NULL, *newnode;
115
  struct flist_t *res = NULL, *newnode;
116
  FILE *fd;
116
  FILE *fd;
117
  char *lineptr;
117
  char *lineptr;
118
  char buff[512];
118
  char buff[512];
119
  int getdelimlen, fnamelen;
119
  int getdelimlen, fnamelen;
Line 161... Line 161...
161
  return(res);
161
  return(res);
162
}
162
}
163
 
163
 
164
 
164
 
165
/* Prints files owned by a package */
165
/* Prints files owned by a package */
166
void listfilesofpkg(char *pkgname, char *dosdir) {
166
void listfilesofpkg(char *pkgname, const char *dosdir) {
167
  struct flist_t *flist, *flist_ptr;
167
  struct flist_t *flist, *flist_ptr;
168
  /* load the list of files belonging to pkgname */
168
  /* load the list of files belonging to pkgname */
169
  flist = pkg_loadflist(pkgname, dosdir);
169
  flist = pkg_loadflist(pkgname, dosdir);
170
  /* display each filename on screen */
170
  /* display each filename on screen */
171
  for (flist_ptr = flist; flist_ptr != NULL; flist_ptr = flist_ptr->next) {
171
  for (flist_ptr = flist; flist_ptr != NULL; flist_ptr = flist_ptr->next) {