aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-arg.c
blob: bc6ececd2ee85dd96b71d47d7b0e130cb78275b4 (plain) (blame)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- *
 *
 * Author:
 *  Michael Zucchi <notzed@ximian.com>
 *
 * Copyright 2002 Ximian, Inc. (www.ximian.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "camel-arg.h"

int camel_argv_build(CamelArgV *tv)
{
    register guint32 tag;
    register int i;
    register CamelArg *a;
    int more = TRUE;

    for (i=0;i<CAMEL_ARGV_MAX;i++) {
        a = &tv->argv[i];

        if ( (tag = va_arg(tv->ap, guint32)) == 0) {
            more = FALSE;
            break;
        }

        a->tag = tag;

        switch((tag & CAMEL_ARG_TYPE)) {
        case CAMEL_ARG_OBJ:
            a->ca_object = va_arg(tv->ap, void *);
            break;
        case CAMEL_ARG_INT:
            a->ca_int = va_arg(tv->ap, int);
            break;
        case CAMEL_ARG_DBL:
            a->ca_double = va_arg(tv->ap, double);
            break;
        case CAMEL_ARG_STR:
            a->ca_str = va_arg(tv->ap, char *);
            break;
        case CAMEL_ARG_PTR:
            a->ca_ptr = va_arg(tv->ap, void *);
            break;
        default:
            printf("Error, unknown type, truncating result\n");
            more = FALSE;
            goto fail;
        }

    }
fail:
    tv->argc = i;

    return more;
}

int camel_arggetv_build(CamelArgGetV *tv)
{
    register guint32 tag;
    register int i;
    register CamelArgGet *a;
    int more = TRUE;

    for (i=0;i<CAMEL_ARGV_MAX;i++) {
        a = &tv->argv[i];

        if ( (tag = va_arg(tv->ap, guint32)) == 0) {
            more = FALSE;
            break;
        }

        a->tag = tag;

        switch((tag & CAMEL_ARG_TYPE)) {
        case CAMEL_ARG_OBJ:
            a->ca_object = va_arg(tv->ap, void **);
            *a->ca_object = NULL;
            break;
        case CAMEL_ARG_INT:
            a->ca_int = va_arg(tv->ap, int *);
            *a->ca_int = 0;
            break;
        case CAMEL_ARG_DBL:
            a->ca_double = va_arg(tv->ap, double *);
            *a->ca_double = 0.0;
            break;
        case CAMEL_ARG_STR:
            a->ca_str = va_arg(tv->ap, char **);
            *a->ca_str = NULL;
            break;
        case CAMEL_ARG_PTR:
            a->ca_ptr = va_arg(tv->ap, void **);
            *a->ca_ptr = NULL;
            break;
        default:
            printf("Error, unknown type, truncating result\n");
            more = FALSE;
            goto fail;
        }

    }
fail:
    tv->argc = i;

    return more;
}
t from pkg Differential Revision: https://reviews.freebsd.org/D1377 Reviewed by: rene, antoine Approved by: rene * Add new keyword for to run glib-compile-schemas.kwm2014-12-031-0/+16 | | | | | | | It be used by the GLIB_SCHEMAS macro in the next gnome update, for ports using GLIB_SCHEMAS nothing will change. Approved by: portmgr (bapt) * - Accept absolute path for @fc, @fontsdir, @fcfontsdir, @shell keywordsak2014-10-094-22/+54 | | | | | Approved by: portmgr (antoine, bapt) Differential Revision: https://reviews.freebsd.org/D721 * Accept absolute path for @info keywordbapt2014-10-081-2/+8 | * @sample: chmod u+w to ensure user may write to it.bdrewery2014-10-041-1/+2 | | | | | | PR: 193209 Submitted by: ohauer With hat: portmgr * Replace the dirrmtry action with dir.mat2014-10-023-3/+3 | | | | | With hat: portmgr Sponsored by: Absolight * Use keywords to control exactly when is excutiedbapt2014-09-222-0/+22 | | | | the different database updates * Remove the yaml files as pkg 1.3.8 is now the minimal required versionbapt2014-09-227-128/+0 | * @sample: Alert user that there is a stale file to be removed.bdrewery2014-09-122-0/+4 | | | | | Submitted by: amdmi3 With hat: portmgr * Convert rmtry into regular Keywordbapt2014-09-031-0/+11 | | | | | | | | | | Note that this allows to control when it is executed (always in post-installation) This makes @rmtry accept both absolute path and relative path (to latest prefix/cwd) While here now that it is not used, remove the old PLIST_REINPLACE macro Reviewed by: antoine Differential Revision: https://reviews.freebsd.org/D713 * - Make it possible to use sample keyword with a full pathantoine2014-09-022-4/+16 | | | | | | | | - Prefer @dirrmtry over @unexec rmdir in makeplist Differential Revision: https://reviews.freebsd.org/D705 Reviewed by: bapt With hat: portmgr * Remove support for pkg_installbapt2014-09-011-111/+0 | | | | | | | | Merge back bsd.pkgng.mk into bsd.port.mk Add a note about @stopdaemon not being supported anymore With hat: portmgr Differential Revision: https://reviews.freebsd.org/D693 * Fix fmtutil keyword with pkg_installantoine2014-08-061-0/+1 | | | | | | PR: ports/192124 Submitted by: John Hein With hat: portmgr * Add support for @fmtutil for pkg_installbapt2014-07-251-0/+8 | * Convert keywords in pure ucl formatbapt2014-07-257-0/+134 | | | | yaml version will be removed later * Support stage for texlive, given it is impossible to rebuild the fmt files intobapt2014-07-051-0/+13 | | | | | the stage then they are now rebuild in post-installation, like it is done in other package system * Use print/indexinfo to generate index of info pagesantoine2014-06-281-8/+2 | | | | | | | | | It is much more lightweight than ginstall-info (12kB vs 400kB) and ginstall-info had a regression causing some index leftover on uninstall Submitted by: bapt Exp-run: self With hat: portmgr * Use print/texinfo-lite to install info pagesbapt2014-06-251-3/+3 | | | | | This allows to use modern version of texinfo as well as allow packages to install properly on a system built WITHOUT_INFO * Make @dirrmtry handling in pkg_install closer to what pkg doesantoine2014-06-211-0/+12 | | | | | | | | Original patch: bapt Phabric: D215 Exp-run: self, less orphans/leftovers with pkg_install with patch than without and no new failures with pkg With hat: portmgr * Add missing font_dir initialization for @fontsdirantoine2014-06-181-0/+1 | | | | With hat: portmgr * Remove another extra '`'bapt2014-06-161-1/+1 | | | | Reported by: antoine * Remove extra '`'bapt2014-06-161-1/+1 | | | | Reported by: antoine * Cosmeticbapt2014-06-121-9/+9 | * Make pkg_install aware of @fc @fcfontsdir and @fontsdirbapt2014-06-121-0/+39 | | | | | | Forgotten in previous commit Tested by: mandree * Add an @shell keyword to handle adding and remove a shell path in /etc/shellbapt2014-06-122-0/+41 | | | | | | | | Bump port revision of all ports that were doing it wrong prior to the keyword CR: D208 Reviewed by: antoine With hat: portmgr * - Add a @sample plist keywordbdrewery2014-04-122-0/+60 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It accepts a file (must end in .sample, this is not configurable): @sample file.conf.sample This will install file.conf.sample and copy it to file.conf. The file.conf will be removed if it matches file.conf.sample on deinstall. This replaces older patterns of: @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.sample; then rm -f %D/etc/pkgtools.conf; fi etc/pkgtools.conf.sample @exec [ -f %B/pkgtools.conf ] || cp %B/%f %B/pkgtools.conf [1] This somewhat obsoletes work in ports/157168 which added CONF_FILES, but we have been moving towards more logic in pkg-plist where possible and less magical macros. Though this thinking does clash with autoplist ideas. We may still want CONF_FILES, which just drops a list of @sample entries into the plist anyway. - Add a Keywords/pkg_install.awk and hook it into generate-plist. This is for pkg_install compatibility since it does not know how to read Keywords/sample.yaml. This file gives us a strategy to implement more keywords before pkg_install is EOL. Keywords are documented here: https://github.com/freebsd/pkg/commit/bffc31420b1fd6146a43c9abcd45109dd901198a - This needs to be documented in PH and portlint support added still. PR: ports/157168 [1] Discussed with: bapt Reviewed by: bapt Requested by: many With hat: portmgr * Fix fontdir handling to work properly.zeising2013-12-211-4/+4 | | | | Fix the name of mkfontdir and use correct paths. * Try to fix font handling for xorg fonts when using staging and pkgng.zeising2013-12-193-0/+45 | | | | | | | | This should silence all QAT messages about leftover font files. Bump portrevision for all affected ports. Original idea: bapt * Fix handling of info files with pkgng, when dealing with .info-X files and ↵bapt2013-11-231-2/+2 | | | | | | | | | | also what INFO_SUBDIR. The .info-X handling was wrong since the beginning of pkgng, the INFO_SUBDIR regression was introduced with stage PR: ports/184178 Reported by: gerald Tested by: gerald * Fix leftovers with INFO_SUBDIRbapt2013-11-181-0/+3 |