Skip to content

Commit

Permalink
A bit more of consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Oct 12, 2011
1 parent 6f75a8d commit 5fd64e8
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions libpkg/pkg.c
Expand Up @@ -219,7 +219,7 @@ pkg_flatsize(struct pkg *pkg)
}

int
pkg_setautomatic(struct pkg *pkg)
pkg_set_automatic(struct pkg *pkg)
{
assert(pkg != NULL);

Expand All @@ -229,7 +229,7 @@ pkg_setautomatic(struct pkg *pkg)
}

int
pkg_isautomatic(struct pkg *pkg)
pkg_is_automatic(struct pkg *pkg)
{
assert(pkg != NULL);

Expand All @@ -253,7 +253,7 @@ pkg_new_pkgsize(struct pkg *pkg)
}

int
pkg_setflatsize(struct pkg *pkg, int64_t size)
pkg_set_flatsize(struct pkg *pkg, int64_t size)
{
assert(pkg != NULL);
assert(size >= 0);
Expand All @@ -263,7 +263,7 @@ pkg_setflatsize(struct pkg *pkg, int64_t size)
}

int
pkg_setnewflatsize(struct pkg *pkg, int64_t size)
pkg_set_newflatsize(struct pkg *pkg, int64_t size)
{
assert(pkg != NULL);
assert(size >= 0);
Expand All @@ -274,7 +274,7 @@ pkg_setnewflatsize(struct pkg *pkg, int64_t size)
}

int
pkg_setnewpkgsize(struct pkg *pkg, int64_t size)
pkg_set_newpkgsize(struct pkg *pkg, int64_t size)
{
assert(pkg != NULL);
assert(size >= 0);
Expand All @@ -301,7 +301,7 @@ pkg_licenselogic(struct pkg *pkg)
}

int
pkg_setrowid(struct pkg *pkg, int64_t rowid) {
pkg_set_rowid(struct pkg *pkg, int64_t rowid) {
assert(pkg != NULL);
pkg->rowid = rowid;
return (EPKG_OK);
Expand Down
12 changes: 6 additions & 6 deletions libpkg/pkg.h
Expand Up @@ -345,8 +345,8 @@ int pkg_set_mtree(struct pkg *pkg, const char *value);
*/
int pkg_set_from_file(struct pkg *pkg, pkg_attr attr, const char *file);

int pkg_setautomatic(struct pkg *pkg);
int pkg_isautomatic(struct pkg *pkg);
int pkg_set_automatic(struct pkg *pkg);
int pkg_is_automatic(struct pkg *pkg);

/**
* set the logic for license combinaison
Expand All @@ -362,19 +362,19 @@ lic_t pkg_licenselogic(struct pkg *pkg);
* Set the uncompressed size of the package.
* @return An error code.
*/
int pkg_setflatsize(struct pkg *pkg, int64_t size);
int pkg_set_flatsize(struct pkg *pkg, int64_t size);

/**
* Set the uncompressed size of the package, in its futur version.
* @return An error code.
*/
int pkg_setnewflatsize(struct pkg *pkg, int64_t size);
int pkg_set_newflatsize(struct pkg *pkg, int64_t size);

/**
* Set the compressed size of the package, in its futur version.
* @return An error code.
*/
int pkg_setnewpkgsize(struct pkg *pkg, int64_t size);
int pkg_set_newpkgsize(struct pkg *pkg, int64_t size);

/**
* Allocate a new struct pkg and add it to the deps of pkg.
Expand Down Expand Up @@ -555,7 +555,7 @@ int pkgdb_has_flag(struct pkgdb *db, int flag);
#define PKGDB_FLAG_IN_FLIGHT (1 << 0)

/**
* Register a package to the database.
* register a package to the database.
* @return An error code.
*/
int pkgdb_register_pkg(struct pkgdb *db, struct pkg *pkg);
Expand Down
4 changes: 2 additions & 2 deletions libpkg/pkg_add.c
Expand Up @@ -117,7 +117,7 @@ pkg_add2(struct pkgdb *db, const char *path, int upgrade, int automatic)
}

if (automatic == 1)
pkg_setautomatic(pkg);
pkg_set_automatic(pkg);

if (uname(&u) != 0) {
pkg_emit_errno("uname", "");
Expand Down Expand Up @@ -190,7 +190,7 @@ pkg_add2(struct pkgdb *db, const char *path, int upgrade, int automatic)
}
}

/* Register the package before installing it in case there are
/* register the package before installing it in case there are
* problems that could be caught here. */
retcode = pkgdb_register_pkg(db, pkg);
if (retcode != EPKG_OK || pkgdb_has_flag(db, PKGDB_FLAG_IN_FLIGHT) == 0)
Expand Down
2 changes: 1 addition & 1 deletion libpkg/pkg_jobs.c
Expand Up @@ -131,7 +131,7 @@ pkg_jobs_install(struct pkg_jobs *j)
return (EPKG_FATAL);
}

if (pkg_add2(j->db, path, 0, pkg_isautomatic(p)) != EPKG_OK)
if (pkg_add2(j->db, path, 0, pkg_is_automatic(p)) != EPKG_OK)
return (EPKG_FATAL);
}

Expand Down
2 changes: 1 addition & 1 deletion libpkg/pkg_manifest.c
Expand Up @@ -181,7 +181,7 @@ pkg_set_flatsize_from_node(struct pkg *pkg, yaml_node_t *val, __unused yaml_docu
return (EPKG_FATAL);
}

return (pkg_setflatsize(pkg, flatsize));
return (pkg_set_flatsize(pkg, flatsize));
}
static int
pkg_set_licenselogic_from_node(struct pkg *pkg, yaml_node_t *val, __unused yaml_document_t *doc, __unused int attr)
Expand Down
2 changes: 1 addition & 1 deletion libpkg/pkg_ports.c
Expand Up @@ -318,7 +318,7 @@ ports_parse_plist(struct pkg *pkg, char *plist)
}
}

pkg_setflatsize(pkg, flatsize);
pkg_set_flatsize(pkg, flatsize);

if (sbuf_len(pre_unexec_scripts) > 0) {
sbuf_finish(unexec_scripts);
Expand Down
2 changes: 1 addition & 1 deletion libpkg/pkg_private.h
Expand Up @@ -182,7 +182,7 @@ int pkgdb_is_dir_used(struct pkgdb *db, const char *dir, int64_t *res);
int pkgdb_integrity_append(struct pkgdb *db, struct pkg *p);
int pkgdb_integrity_check(struct pkgdb *db);

int pkg_setrowid(struct pkg *, int64_t rowid);
int pkg_set_rowid(struct pkg *, int64_t rowid);

/* pkgdb commands */
int sql_exec(sqlite3 *, const char *);
Expand Down
12 changes: 6 additions & 6 deletions libpkg/pkgdb.c
Expand Up @@ -59,11 +59,11 @@ static struct column_int_mapping {
const char * const name;
int (*set_int)(struct pkg *pkg, int64_t);
} columns_int[] = {
{ "flatsize", pkg_setflatsize },
{ "newflatsize", pkg_setnewflatsize },
{ "pkgsize", pkg_setnewpkgsize },
{ "flatsize", pkg_set_flatsize },
{ "newflatsize", pkg_set_newflatsize },
{ "pkgsize", pkg_set_newpkgsize },
{ "licenselogic", pkg_set_licenselogic},
{ "rowid", pkg_setrowid},
{ "rowid", pkg_set_rowid},
{ NULL, NULL}
};

Expand Down Expand Up @@ -131,7 +131,7 @@ populate_pkg(sqlite3_stmt *stmt, struct pkg *pkg) {
}
if (strcmp(colname, "automatic") == 0) {
if (sqlite3_column_int64(stmt, icol) == 1)
pkg_setautomatic(pkg);
pkg_set_automatic(pkg);
break;
}
if (columns_int[i].name == NULL)
Expand Down Expand Up @@ -1288,7 +1288,7 @@ pkgdb_register_pkg(struct pkgdb *db, struct pkg *pkg)
sqlite3_bind_text(stmt_pkg, 10, pkg_get(pkg, PKG_WWW), -1, SQLITE_STATIC);
sqlite3_bind_text(stmt_pkg, 11, pkg_get(pkg, PKG_PREFIX), -1, SQLITE_STATIC);
sqlite3_bind_int64(stmt_pkg, 12, pkg_flatsize(pkg));
sqlite3_bind_int(stmt_pkg, 13, pkg_isautomatic(pkg));
sqlite3_bind_int(stmt_pkg, 13, pkg_is_automatic(pkg));
sqlite3_bind_int64(stmt_pkg, 14, pkg_licenselogic(pkg));
sqlite3_bind_text(stmt_pkg, 15, pkg_get(pkg, PKG_MTREE), -1, SQLITE_STATIC);

Expand Down
2 changes: 1 addition & 1 deletion pkg/main.c
Expand Up @@ -41,7 +41,7 @@ static struct commands {
int (*exec)(int argc, char **argv);
void (* const usage)(void);
} cmd[] = {
{ "add", "Registers a package and installs it on the system", exec_add, usage_add},
{ "add", "registers a package and installs it on the system", exec_add, usage_add},
{ "autoremove", "Removes orphan packages", exec_autoremove, usage_autoremove},
{ "backup", "Backup and restore the local package database", exec_backup, usage_backup},
{ "clean", "Cleans old packages from the cache", exec_clean, usage_clean},
Expand Down
2 changes: 1 addition & 1 deletion pkg/query.c
Expand Up @@ -77,7 +77,7 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
sbuf_cat(dest, pkg_get(pkg, PKG_WWW));
break;
case 'a':
sbuf_printf(dest, "%d", pkg_isautomatic(pkg));
sbuf_printf(dest, "%d", pkg_is_automatic(pkg));
break;
case 's':
qstr++;
Expand Down
2 changes: 1 addition & 1 deletion pkg/register.c
Expand Up @@ -95,7 +95,7 @@ exec_register(int argc, char **argv)
err(1, "cannot allocate memory");
break;
case 'd':
pkg_setautomatic(pkg);
pkg_set_automatic(pkg);
break;
case 'i':
if ((input_path = strdup(optarg)) == NULL)
Expand Down

0 comments on commit 5fd64e8

Please sign in to comment.