~click-hackers/click/trunk

« back to all changes in this revision

Viewing changes to click/tests/preload.h

  • Committer: Colin Watson
  • Date: 2014-03-03 17:01:37 UTC
  • mto: This revision was merged to the branch mainline in revision 354.
  • Revision ID: cjwatson@canonical.com-20140303170137-4gs1zjmqtgkvzphq
Move an initial core of functionality (database, hooks, osextras, query,
user) from Python into a new "libclick" library, allowing
performance-critical clients to avoid the cost of starting a new Python
interpreter (LP: #1282311).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <sys/stat.h>
 
2
#include <sys/types.h>
 
3
 
 
4
#include <glib.h>
 
5
 
 
6
#include "click.h"
 
7
 
 
8
/**
 
9
 * chown:
 
10
 *
 
11
 * Attributes: (headers unistd.h)
 
12
 */
 
13
extern int chown (const char *file, uid_t owner, gid_t group);
 
14
 
 
15
/* Workaround for g-ir-scanner not picking up the type properly: mode_t is
 
16
 * uint32_t on all glibc platforms.
 
17
 */
 
18
/**
 
19
 * mkdir:
 
20
 * @mode: (type guint32)
 
21
 *
 
22
 * Attributes: (headers sys/stat.h,sys/types.h)
 
23
 */
 
24
extern int mkdir (const char *pathname, mode_t mode);
 
25
 
 
26
/**
 
27
 * getpwnam:
 
28
 *
 
29
 * Attributes: (headers sys/types.h,pwd.h)
 
30
 * Returns: (transfer none):
 
31
 */
 
32
extern struct passwd *getpwnam (const char *name);
 
33
 
 
34
/**
 
35
 * under_under_xstat:
 
36
 *
 
37
 * Attributes: (headers sys/types.h,sys/stat.h,unistd.h)
 
38
 */
 
39
extern int under_under_xstat (int ver, const char *pathname, struct stat *buf);
 
40
 
 
41
/**
 
42
 * under_under_xstat64:
 
43
 *
 
44
 * Attributes: (headers sys/types.h,sys/stat.h,unistd.h)
 
45
 */
 
46
extern int under_under_xstat64 (int ver, const char *pathname, struct stat64 *buf);
 
47
 
 
48
/**
 
49
 * g_spawn_sync:
 
50
 * @argv: (array zero-terminated=1):
 
51
 * @envp: (array zero-terminated=1):
 
52
 * @flags: (type gint)
 
53
 * @child_setup: (type gpointer)
 
54
 * @standard_output: (out) (array zero-terminated=1) (element-type guint8):
 
55
 * @standard_error: (out) (array zero-terminated=1) (element-type guint8):
 
56
 * @exit_status: (out):
 
57
 *
 
58
 * Attributes: (headers glib.h)
 
59
 */
 
60
gboolean g_spawn_sync         (const gchar          *working_directory,
 
61
                               gchar               **argv,
 
62
                               gchar               **envp,
 
63
                               GSpawnFlags           flags,
 
64
                               GSpawnChildSetupFunc  child_setup,
 
65
                               gpointer              user_data,
 
66
                               gchar               **standard_output,
 
67
                               gchar               **standard_error,
 
68
                               gint                 *exit_status,
 
69
                               GError              **error);
 
70
 
 
71
/**
 
72
 * click_find_on_path:
 
73
 *
 
74
 * Attributes: (headers glib.h)
 
75
 */
 
76
gboolean click_find_on_path (const gchar *command);
 
77
 
 
78
/**
 
79
 * click_get_db_dir:
 
80
 *
 
81
 * Attributes: (headers glib.h)
 
82
 */
 
83
gchar *click_get_db_dir (void);
 
84
 
 
85
/**
 
86
 * click_get_hooks_dir:
 
87
 *
 
88
 * Attributes: (headers glib.h)
 
89
 */
 
90
gchar *click_get_hooks_dir (void);
 
91
 
 
92
/**
 
93
 * click_get_user_home:
 
94
 *
 
95
 * Attributes: (headers glib.h)
 
96
 */
 
97
gchar *click_get_user_home (const gchar *user_name);
 
98
 
 
99
/**
 
100
 * click_package_install_hooks:
 
101
 * @db: (type gpointer)
 
102
 *
 
103
 * Attributes: (headers glib.h,click.h)
 
104
 */
 
105
void click_package_install_hooks (ClickDB *db, const gchar *package,
 
106
                                  const gchar *old_version,
 
107
                                  const gchar *new_version,
 
108
                                  const gchar *user_name, GError **error);