Subversion Repositories SvarDOS

Rev

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

Rev 1678 Rev 1963
Line 28... Line 28...
28
 
28
 
29
  sprintf(buff, "%s\\appinfo", dosdir);
29
  sprintf(buff, "%s\\appinfo", dosdir);
30
  dp = opendir(buff);
30
  dp = opendir(buff);
31
  if (dp == NULL) {
31
  if (dp == NULL) {
32
    kitten_printf(9, 0, buff); /* "ERROR: Could not access directory %s" */
32
    kitten_printf(9, 0, buff); /* "ERROR: Could not access directory %s" */
33
    puts("");
33
    outputnl("");
34
    return(-1);
34
    return(-1);
35
  }
35
  }
36
 
36
 
37
  while ((ep = readdir(dp)) != NULL) { /* readdir() result must never be freed (statically allocated) */
37
  while ((ep = readdir(dp)) != NULL) { /* readdir() result must never be freed (statically allocated) */
38
    int tlen = strlen(ep->d_name);
38
    int tlen = strlen(ep->d_name);
Line 48... Line 48...
48
    /* load the metadata from %DOSDIR\APPINFO\*.lsm */
48
    /* load the metadata from %DOSDIR\APPINFO\*.lsm */
49
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, ep->d_name);
49
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, ep->d_name);
50
    readlsm(buff, ver, sizeof(ver));
50
    readlsm(buff, ver, sizeof(ver));
51
 
51
 
52
    printf("%s %s", ep->d_name, ver);
52
    printf("%s %s", ep->d_name, ver);
53
    puts("");
53
    outputnl("");
54
    matchfound = 1;
54
    matchfound = 1;
55
  }
55
  }
56
  if (matchfound == 0) puts(svarlang_str(5, 0)); /* "No package matched the search." */
56
  if (matchfound == 0) outputnl(svarlang_str(5, 0)); /* "No package matched the search." */
57
 
57
 
58
  closedir(dp);
58
  closedir(dp);
59
  return(0);
59
  return(0);
60
}
60
}
61
 
61
 
Line 81... Line 81...
81
  if (fd == NULL) {
81
  if (fd == NULL) {
82
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, pkgname);
82
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, pkgname);
83
    fd = fopen(buff, "rb");
83
    fd = fopen(buff, "rb");
84
    if (fd == NULL) {
84
    if (fd == NULL) {
85
      kitten_printf(9, 1, pkgname); /* "ERROR: Local package '%s' not found." */
85
      kitten_printf(9, 1, pkgname); /* "ERROR: Local package '%s' not found." */
86
      puts("");
86
      outputnl("");
87
      return(NULL);
87
      return(NULL);
88
    }
88
    }
89
  }
89
  }
90
 
90
 
91
  /* iterate through all lines of the file */
91
  /* iterate through all lines of the file */
Line 126... Line 126...
126
  /* load the list of files belonging to pkgname */
126
  /* load the list of files belonging to pkgname */
127
  flist = pkg_loadflist(pkgname, dosdir);
127
  flist = pkg_loadflist(pkgname, dosdir);
128
  if (flist == NULL) return(-1);
128
  if (flist == NULL) return(-1);
129
  /* display each filename on screen */
129
  /* display each filename on screen */
130
  for (flist_ptr = flist; flist_ptr != NULL; flist_ptr = flist_ptr->next) {
130
  for (flist_ptr = flist; flist_ptr != NULL; flist_ptr = flist_ptr->next) {
131
    puts(flist_ptr->fname);
131
    outputnl(flist_ptr->fname);
132
  }
132
  }
133
  /* free the list of files */
133
  /* free the list of files */
134
  pkg_freeflist(flist);
134
  pkg_freeflist(flist);
135
  return(0);
135
  return(0);
136
}
136
}