Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dbp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
dbp
Commits
09492d8b
Commit
09492d8b
authored
Nov 01, 2015
by
Steven Arnow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install headers for dbpbase, move dbp_error_log into dbpbase
parent
733143ec
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
54 additions
and
24 deletions
+54
-24
Makefile
Makefile
+4
-0
dbp-cfg/main.c
dbp-cfg/main.c
+2
-5
dbp-cmd/dbp-cmd.c
dbp-cmd/dbp-cmd.c
+3
-3
dbp-desktopd/desktopd.c
dbp-desktopd/desktopd.c
+2
-4
dbp-meta/dbp-meta.c
dbp-meta/dbp-meta.c
+2
-5
dbpd/daemon.c
dbpd/daemon.c
+2
-6
libdbpbase/Makefile
libdbpbase/Makefile
+2
-0
libdbpbase/config.h
libdbpbase/config.h
+3
-1
libdbpbase/dbp.c
libdbpbase/dbp.c
+18
-0
libdbpbase/dbp.h
libdbpbase/dbp.h
+1
-0
libdbpbase/dbpbase.h
libdbpbase/dbpbase.h
+11
-0
libdbpbase/loop.c
libdbpbase/loop.c
+1
-0
libdbpbase/meta.c
libdbpbase/meta.c
+1
-0
libdbpbase/meta.h
libdbpbase/meta.h
+2
-0
No files found.
Makefile
View file @
09492d8b
...
...
@@ -20,6 +20,8 @@ all:
@
echo
" [INIT] build/include/dbpmgr"
@
$(MKDIR)
build/include
@
$(MKDIR)
build/include/dbpmgr
@
echo
" [INIT] build/include/dbpbase"
@
$(MKDIR)
build/include/dbpbase
@
echo
" [ CD ] libdbpbase/"
+@make
-C
libdbpbase/
@
echo
" [ CD ] libdbpmgr/"
...
...
@@ -103,3 +105,5 @@ install:
install
-m
644
$(STRIP_FLAG)
-t
"
$(PREFIX)
/usr/lib/"
"
$(TOPDIR)
/build/lib/libdbpbase.so"
install
-d
"
$(PREFIX)
/usr/include/dbpmgr"
install
-m
644
-t
"
$(PREFIX)
/usr/include/dbpmgr"
$(TOPDIR)
/build/include/dbpmgr/
*
.h
install
-d
"
$(PREFIX)
/usr/include/dbpbase"
install
-m
644
-t
"
$(PREFIX)
/usr/include/dbpbase"
$(TOPDIR)
/build/include/dbpbase/
*
.h
dbp-cfg/main.c
View file @
09492d8b
#include "config.h"
#include "desktop.h"
#include <dbpbase/dbpbase.h>
#include <stdio.h>
#include <libintl.h>
#include <locale.h>
#define _(STRING) gettext(STRING)
FILE
*
dbp_error_log
;
void
usage
(
char
*
name
)
{
...
...
@@ -21,11 +19,10 @@ int main(int argc, char **argv) {
struct
DBPDesktopFile
*
df
;
const
char
*
value
;
dbp_error_log
=
stderr
;
setlocale
(
LC_ALL
,
""
);
textdomain
(
"dbp-run"
);
dbp_init
(
NULL
);
if
(
argc
<
2
)
return
usage
(
argv
[
0
]),
-
1
;
if
(
!
strcmp
(
argv
[
1
],
"--help"
))
...
...
dbp-cmd/dbp-cmd.c
View file @
09492d8b
#include <dbpbase/dbpbase.h>
#include <dbpmgr/dbpmgr.h>
#include <stdio.h>
...
...
@@ -7,7 +8,6 @@
#include <locale.h>
#define _(STRING) gettext(STRING)
FILE
*
dbp_error_log
=
NULL
;
struct
FunctionLookup
{
char
*
name
;
void
(
*
func
)(
int
argc
,
char
**
argv
);
...
...
@@ -172,13 +172,13 @@ static struct FunctionLookup lookup[] = {
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
dbp_error_log
=
stderr
;
setlocale
(
LC_ALL
,
""
);
textdomain
(
"dbp-run"
);
if
(
argc
<
2
)
exit
(
usage
());
dbp_init
(
NULL
);
if
(
dbpmgr_server_connect
()
<
0
)
return
1
;
for
(
i
=
0
;
lookup
[
i
].
name
;
i
++
)
...
...
dbp-desktopd/desktopd.c
View file @
09492d8b
...
...
@@ -9,13 +9,12 @@
#include <pthread.h>
#include <dbpmgr/dbpmgr.h>
#include
"config.h"
#include
<dbpbase/dbpbase.h>
#define HAS_SUFFIX(str, suffix) (strlen((suffix)) < strlen((str)) && !strcmp((str) + strlen((str)) - strlen((suffix)), suffix))
#define HAS_PREFIX(str, prefix) (strstr((str), (prefix)) == (str))
static
char
*
desktop_directory
=
NULL
;
FILE
*
dbp_error_log
;
static
char
*
find_desktop
()
{
char
*
desktop_dir
,
*
home_dir
,
*
desktop_path
;
...
...
@@ -135,8 +134,7 @@ static void sighndlr(const char *signal, const char *value, void *data) {
int
main
(
int
argc
,
char
**
argv
)
{
struct
DBPList
*
list
,
*
next
;
(
void
)
argc
;
(
void
)
argv
;
dbp_error_log
=
stderr
;
dbp_config_init
();
dbp_init
(
NULL
);
if
(
!
(
desktop_directory
=
find_desktop
()))
return
1
;
nuke_desktop
(
desktop_directory
);
...
...
dbp-meta/dbp-meta.c
View file @
09492d8b
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include "meta.h"
#include "config.h"
#include <dbpbase/dbpbase.h>
#define _(STRING) gettext(STRING)
FILE
*
dbp_error_log
;
void
usage
()
{
fprintf
(
stdout
,
_
(
"Extracts meta keys from a DBP
\n
"
));
fprintf
(
stdout
,
_
(
"By Steven Arnow, 2015, version %s
\n
"
),
dbp_config_version_get
());
...
...
@@ -23,13 +20,13 @@ int main(int argc, char **argv) {
setlocale
(
LC_ALL
,
""
);
textdomain
(
"dbp-run"
);
dbp_error_log
=
stderr
;
if
(
argc
<
3
)
{
usage
();
return
1
;
}
dbp_init
(
NULL
);
if
(
dbp_meta_package_open
(
argv
[
2
],
&
mp
))
{
fprintf
(
stderr
,
_
(
"Unable to open package %s
\n
"
),
argv
[
2
]);
return
1
;
...
...
dbpd/daemon.c
View file @
09492d8b
...
...
@@ -5,15 +5,12 @@
#include <dirent.h>
#include <string.h>
#include <signal.h>
#include <dbpbase/dbpbase.h>
#include "mountwatch.h"
#include "config.h"
#include "package.h"
#include "dbp.h"
#include "comm.h"
#include "loop.h"
#include "state.h"
FILE
*
dbp_error_log
;
static
struct
package_s
*
p_s
;
static
void
sleep_usec
(
int
usec
)
{
...
...
@@ -141,9 +138,8 @@ int main(int argc, char **argv) {
char
*
n
;
pid_t
procid
;
dbp_error_log
=
stderr
;
p_s
=
&
p
;
if
(
!
dbp_
config_init
(
))
if
(
!
dbp_
init
(
NULL
))
return
-
1
;
if
(
!
(
dbp_error_log
=
fopen
(
dbp_config_struct
.
daemon_log
,
"w"
)))
{
dbp_error_log
=
stderr
;
...
...
libdbpbase/Makefile
View file @
09492d8b
...
...
@@ -10,6 +10,8 @@ LDFLAGS += -Wl,-soname,$(LIBBASEFILE)
all
:
$(OBJFILES) $(DEPENDS)
@
echo
" [ LD ]
$(LIBBASE)
"
@
$(CC)
$(CFLAGS)
-o
$(LIBBASE)
$(OBJFILES)
$(LDFLAGS)
@
echo
" [COPY] Headers into build directory"
@
$(CP)
*
.h
$(TOPDIR)
/build/include/dbpbase/
@
echo
"Done."
@
echo
...
...
libdbpbase/config.h
View file @
09492d8b
#ifndef __DBP_CONFIG_H__
#define __DBP_CONFIG_H__
#ifdef _LIBINTERNAL
#include "desktop.h"
#endif
#define DBP_CONFIG_FILE_PATH "/etc/dbp/dbp_config.ini"
struct
DBPConfig
{
...
...
@@ -42,7 +44,7 @@ struct DBPConfig {
};
int
dbp_config_init
();
//
int dbp_config_init();
extern
struct
DBPConfig
dbp_config_struct
;
char
*
dbp_config_version_get
();
void
dbp_config_expand_token
(
char
***
target
,
int
*
targets
,
char
*
token
);
...
...
libdbpbase/dbp.c
0 → 100644
View file @
09492d8b
#define _LIBINTERNAL
#include "dbp.h"
#include "config.h"
#include <stdio.h>
int
dbp_config_init
();
FILE
*
dbp_error_log
;
int
dbp_init
(
FILE
*
error_log
)
{
if
(
!
error_log
)
dbp_error_log
=
stderr
;
else
dbp_error_log
=
error_log
;
if
(
!
dbp_config_init
())
return
0
;
return
1
;
}
libdbpbase/dbp.h
View file @
09492d8b
...
...
@@ -45,5 +45,6 @@
#define DBP_ERROR_MUTILATED -1023
/* Uncleanly removed media with active programs */
extern
FILE
*
dbp_error_log
;
int
dbp_init
(
FILE
*
dbp_error_log
);
#endif
libdbpbase/dbpbase.h
0 → 100644
View file @
09492d8b
#ifndef __DBP_BASE_H__
#define __DBP_BASE_H__
#include <dbpbase/dbp.h>
#include <dbpbase/config.h>
#include <dbpbase/desktop.h>
#include <dbpbase/loop.h>
#include <dbpbase/util.h>
#include <dbpbase/meta.h>
#endif
libdbpbase/loop.c
View file @
09492d8b
#define _LIBINTERNAL
#include "loop.h"
#include "util.h"
#include "dbp.h"
...
...
libdbpbase/meta.c
View file @
09492d8b
#define _LIBINTERNAL
#include "dbp.h"
#include "meta.h"
#include <time.h>
...
...
libdbpbase/meta.h
View file @
09492d8b
#ifndef __META_H__
#define __META_H__
#ifdef _LIBINTERNAL
#include "desktop.h"
#endif
struct
DBPMetaPackage
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment