blob: da5bdfae3dfb58f37becfa1452ac016f8def528c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*
* include file for pkg.c
*
*
* Copyright (c) 1995, Marc van Kempen
*
* All rights reserved.
*
* This software may be used, modified, copied, distributed, and
* sold, in both source and binary form provided that the above
* copyright and these terms are retained, verbatim, as the first
* lines of this file. Under no circumstances is the author
* responsible for the proper functioning of this software, nor does
* the author assume any responsibility for damages incurred with
* its use.
*
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/dirent.h>
#include <ncurses.h>
#include <dialog.h>
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
typedef struct {
int N; /* size of buf in bytes */
int Nitems; /* # of packages */
char *buf; /* buffer to hold package info */
char **name; /* array of char pointer to locations in buf */
char **comment; /* idem */
char **description; /* idem */
unsigned char **mnu; /* pointers to be used with dialog_menu() */
} PKG_info;
typedef struct DirList { /* structure to hold the directory entries */
char filename[MAXNAMLEN]; /* together with the stat-info per file */
struct stat filestatus; /* filename, or the name to which it points */
int link; /* is it a link ? */
char *linkname; /* the name of the file the link points to */
} DirList;
#define PKG_DELETE "/usr/sbin/pkg_delete"
#define PKG_INFO "/usr/sbin/pkg_info"
#define PKG_ADD "/usr/sbin/pkg_add"
#define TAR "/usr/bin/tar"
/* HELP_PATH must have a trailing '/' */
#ifndef HELP_PATH
#define HELP_PATH "/home/marc/src/pkg_manage/"
#endif
#define VIEW_INST_HLP HELP_PATH##"pkg_view-inst.hlp"
#define DEL_INST_HLP HELP_PATH##"pkg_del-inst.hlp"
#define PREVIEW_HLP HELP_PATH##"pkg_preview.hlp"
#define INSTALL_HLP HELP_PATH##"pkg_install.hlp"
#define MAIN_HLP HELP_PATH##"pkg_main.hlp"
|