RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/rpmdb/ hdrfmt.c header.c header.h

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 18 Oct 2007 - 16:08:49 CEST
Message-Id: <20071018140849.108AA34845F@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   18-Oct-2007 16:08:49
  Branch: HEAD                             Handle: 2007101815084800

  Modified files:
    rpm                     CHANGES
    rpm/rpmdb               hdrfmt.c header.c header.h

  Log:
    - drill HE_t through (*headerTagFormatFunction).

  Summary:
    Revision    Changes     Path
    1.1726      +1  -0      rpm/CHANGES
    1.16        +21 -12     rpm/rpmdb/hdrfmt.c
    1.87        +19 -13     rpm/rpmdb/header.c
    1.42        +2  -1      rpm/rpmdb/header.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1725 -r1.1726 CHANGES
  --- rpm/CHANGES	18 Oct 2007 04:41:05 -0000	1.1725
  +++ rpm/CHANGES	18 Oct 2007 14:08:48 -0000	1.1726
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: drill HE_t through (*headerTagFormatFunction).
       - jbj: debugedit segfault (#336951,#337011) see #337051 too.
       - jbj: commit to hge(h, he, ...) extraction in API. ABI not yet.
       - jbj: remove the pointless ;-) indirection in *(HE_t) for type/count.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/hdrfmt.c
  ============================================================================
  $ cvs diff -u -r1.15 -r1.16 hdrfmt.c
  --- rpm/rpmdb/hdrfmt.c	17 Oct 2007 18:32:57 -0000	1.15
  +++ rpm/rpmdb/hdrfmt.c	18 Oct 2007 14:08:48 -0000	1.16
  @@ -70,6 +70,7 @@
   }
   /**
    * Identify type of trigger.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	(unused)
  @@ -77,7 +78,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static /*@only@*/ char * triggertypeFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * triggertypeFormat(HE_t he, rpmTagType type, hPTR_t data,
   		/*@unused@*/ char * formatPrefix, /*@unused@*/ int padding,
   		/*@unused@*/ int element)
   	/*@requires maxRead(data) >= 0 @*/
  @@ -102,6 +103,7 @@
   
   /**
    * Format file permissions for display.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix
  @@ -109,7 +111,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static /*@only@*/ char * permsFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * permsFormat(HE_t he, rpmTagType type, hPTR_t data,
   		char * formatPrefix, int padding, /*@unused@*/ int element)
   	/*@modifies formatPrefix @*/
   	/*@requires maxRead(data) >= 0 @*/
  @@ -134,6 +136,7 @@
   
   /**
    * Format file flags for display.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix
  @@ -141,7 +144,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static /*@only@*/ char * fflagsFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * fflagsFormat(HE_t he, rpmTagType type, hPTR_t data,
   		char * formatPrefix, int padding, /*@unused@*/ int element)
   	/*@modifies formatPrefix @*/
   	/*@requires maxRead(data) >= 0 @*/
  @@ -184,6 +187,7 @@
   /**
    * Wrap a pubkey in ascii armor for display.
    * @todo Permit selectable display formats (i.e. binary).
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	(unused)
  @@ -191,7 +195,7 @@
    * @param element	no. bytes of binary data
    * @return		formatted string
    */
  -static /*@only@*/ char * armorFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * armorFormat(HE_t he, rpmTagType type, hPTR_t data,
   		/*@unused@*/ char * formatPrefix, /*@unused@*/ int padding,
   		int element)
   	/*@*/
  @@ -244,6 +248,7 @@
   /**
    * Encode binary data in base64 for display.
    * @todo Permit selectable display formats (i.e. binary).
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	(unused)
  @@ -251,7 +256,7 @@
    * @param element
    * @return		formatted string
    */
  -static /*@only@*/ char * base64Format(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * base64Format(HE_t he, rpmTagType type, hPTR_t data,
   		/*@unused@*/ char * formatPrefix, int padding, int element)
   	/*@*/
   {
  @@ -347,6 +352,7 @@
   
   /**
    * Wrap tag data in simple header xml markup.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix
  @@ -354,7 +360,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static /*@only@*/ char * xmlFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * xmlFormat(HE_t he, rpmTagType type, hPTR_t data,
   		char * formatPrefix, int padding,
   		/*@unused@*/ int element)
   	/*@modifies formatPrefix @*/
  @@ -385,7 +391,7 @@
       {	int cpl = b64encode_chars_per_line;
   	b64encode_chars_per_line = 0;
   /*@-formatconst@*/
  -	s = base64Format(type, data, formatPrefix, padding, element);
  +	s = base64Format(he, type, data, formatPrefix, padding, element);
   /*@=formatconst@*/
   	b64encode_chars_per_line = cpl;
   	xtag = "base64";
  @@ -510,6 +516,7 @@
   
   /**
    * Wrap tag data in simple header yaml markup.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix
  @@ -517,7 +524,7 @@
    * @param element	element index (or -1 for non-array).
    * @return		formatted string
    */
  -static /*@only@*/ char * yamlFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * yamlFormat(HE_t he, rpmTagType type, hPTR_t data,
   		char * formatPrefix, int padding,
   		int element)
   	/*@modifies formatPrefix @*/
  @@ -582,7 +589,7 @@
       {	int cpl = b64encode_chars_per_line;
   	b64encode_chars_per_line = 0;
   /*@-formatconst@*/
  -	s = base64Format(type, data, formatPrefix, padding, element);
  +	s = base64Format(he, type, data, formatPrefix, padding, element);
   	element = -element;	/* XXX skip "    " indent. */
   /*@=formatconst@*/
   	b64encode_chars_per_line = cpl;
  @@ -666,6 +673,7 @@
   
   /**
    * Display signature fingerprint and time.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	(unused)
  @@ -673,7 +681,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static /*@only@*/ char * pgpsigFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * pgpsigFormat(HE_t he, rpmTagType type, hPTR_t data,
   		/*@unused@*/ char * formatPrefix, /*@unused@*/ int padding,
   		/*@unused@*/ int element)
   	/*@globals fileSystem, internalState @*/
  @@ -775,6 +783,7 @@
   
   /**
    * Format dependency flags for display.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix
  @@ -782,7 +791,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static /*@only@*/ char * depflagsFormat(rpmTagType type, hPTR_t data,
  +static /*@only@*/ char * depflagsFormat(HE_t he, rpmTagType type, hPTR_t data,
   		char * formatPrefix, int padding, /*@unused@*/ int element)
   	/*@modifies formatPrefix @*/
   	/*@requires maxRead(data) >= 0 @*/
  @@ -907,7 +916,7 @@
   	    item = xmalloc(strlen(names.argv[j]) + strlen(versions.argv[j]) + 20);
   	    if (flags.i32p[j] & RPMSENSE_SENSEMASK) {
   		buf[0] = '%', buf[1] = '\0';
  -		flagsStr = depflagsFormat(RPM_INT32_TYPE, &flags, buf, 0, j);
  +		flagsStr = depflagsFormat(he, RPM_INT32_TYPE, &flags, buf, 0, j);
   		sprintf(item, "%s %s %s", names.argv[j], flagsStr, versions.argv[j]);
   		flagsStr = _free(flagsStr);
   	    } else
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.c
  ============================================================================
  $ cvs diff -u -r1.86 -r1.87 header.c
  --- rpm/rpmdb/header.c	17 Oct 2007 18:32:57 -0000	1.86
  +++ rpm/rpmdb/header.c	18 Oct 2007 14:08:48 -0000	1.87
  @@ -3271,7 +3271,7 @@
   	strarray.argv = he_p.argv;
   
   	if (tag->fmt)
  -	    val = tag->fmt(RPM_STRING_TYPE, (hPTR_t) strarray.argv[element], buf, tag->pad, (he->c > 1 ? element : -1));	/* NOCAST */
  +	    val = tag->fmt(he, RPM_STRING_TYPE, (hPTR_t) strarray.argv[element], buf, tag->pad, (he->c > 1 ? element : -1));	/* NOCAST */
   
   	if (val) {
   	    need = strlen(val);
  @@ -3288,7 +3288,7 @@
   
       case RPM_STRING_TYPE:
   	if (tag->fmt)
  -	    val = tag->fmt(RPM_STRING_TYPE, he_p.ptr, buf, tag->pad,  -1);
  +	    val = tag->fmt(he, RPM_STRING_TYPE, he_p.ptr, buf, tag->pad,  -1);
   
   	if (val) {
   	    need = strlen(val);
  @@ -3305,7 +3305,7 @@
       case RPM_INT64_TYPE:
   	llVal = he_p.i64p[element];
   	if (tag->fmt)
  -	    val = tag->fmt(RPM_INT64_TYPE, (hPTR_t) &llVal, buf, tag->pad, (he->c > 1 ? element : -1));	/* NOCAST */
  +	    val = tag->fmt(he, RPM_INT64_TYPE, (hPTR_t) &llVal, buf, tag->pad, (he->c > 1 ? element : -1));	/* NOCAST */
   	if (val) {
   	    need = strlen(val);
   	} else {
  @@ -3337,7 +3337,7 @@
   	}
   
   	if (tag->fmt)
  -	    val = tag->fmt(RPM_INT32_TYPE, (hPTR_t) &intVal, buf, tag->pad, (he->c > 1 ? element : -1)); /* NOCAST */
  +	    val = tag->fmt(he, RPM_INT32_TYPE, (hPTR_t) &intVal, buf, tag->pad, (he->c > 1 ? element : -1)); /* NOCAST */
   
   	if (val) {
   	    need = strlen(val);
  @@ -3356,7 +3356,7 @@
       case RPM_BIN_TYPE:
   	/* XXX HACK ALERT: element field abused as no. bytes of binary data. */
   	if (tag->fmt)
  -	    val = tag->fmt(RPM_BIN_TYPE, he_p.ptr, buf, tag->pad, he->c);
  +	    val = tag->fmt(he, RPM_BIN_TYPE, he_p.ptr, buf, tag->pad, he->c);
   
   	if (val) {
   	    need = strlen(val);
  @@ -3759,6 +3759,7 @@
   
   /**
    * Return octal formatted data.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	sprintf format string
  @@ -3766,7 +3767,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static char * octalFormat(rpmTagType type, hPTR_t data, 
  +static char * octalFormat(HE_t he, rpmTagType type, hPTR_t data, 
   		char * formatPrefix, int padding, /*@unused@*/int element)
   	/*@modifies formatPrefix @*/
   {
  @@ -3792,6 +3793,7 @@
   
   /**
    * Return hex formatted data.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	sprintf format string
  @@ -3799,7 +3801,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static char * hexFormat(rpmTagType type, hPTR_t data, 
  +static char * hexFormat(HE_t he, rpmTagType type, hPTR_t data, 
   		char * formatPrefix, int padding, /*@unused@*/int element)
   	/*@modifies formatPrefix @*/
   {
  @@ -3825,6 +3827,7 @@
   
   /**
    * Return strftime formatted data.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	sprintf format string
  @@ -3833,7 +3836,7 @@
    * @param strftimeFormat strftime(3) format
    * @return		formatted string
    */
  -static char * realDateFormat(rpmTagType type, hPTR_t data, 
  +static char * realDateFormat(HE_t he, rpmTagType type, hPTR_t data, 
   		char * formatPrefix, int padding, /*@unused@*/int element,
   		const char * strftimeFormat)
   	/*@modifies formatPrefix @*/
  @@ -3866,6 +3869,7 @@
   
   /**
    * Return date formatted data.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	sprintf format string
  @@ -3873,16 +3877,17 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static char * dateFormat(rpmTagType type, hPTR_t data, 
  +static char * dateFormat(HE_t he, rpmTagType type, hPTR_t data, 
   		         char * formatPrefix, int padding, int element)
   	/*@modifies formatPrefix @*/
   {
  -    return realDateFormat(type, data, formatPrefix, padding, element,
  +    return realDateFormat(he, type, data, formatPrefix, padding, element,
   			_("%c"));
   }
   
   /**
    * Return day formatted data.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	sprintf format string
  @@ -3890,16 +3895,17 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static char * dayFormat(rpmTagType type, hPTR_t data, 
  +static char * dayFormat(HE_t he, rpmTagType type, hPTR_t data, 
   		         char * formatPrefix, int padding, int element)
   	/*@modifies formatPrefix @*/
   {
  -    return realDateFormat(type, data, formatPrefix, padding, element, 
  +    return realDateFormat(he, type, data, formatPrefix, padding, element, 
   			  _("%a %b %d %Y"));
   }
   
   /**
    * Return shell escape formatted data.
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix	sprintf format string
  @@ -3907,7 +3913,7 @@
    * @param element	(unused)
    * @return		formatted string
    */
  -static char * shescapeFormat(rpmTagType type, hPTR_t data, 
  +static char * shescapeFormat(HE_t he, rpmTagType type, hPTR_t data, 
   		char * formatPrefix, int padding, /*@unused@*/int element)
   	/*@modifies formatPrefix @*/
   {
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.h
  ============================================================================
  $ cvs diff -u -r1.41 -r1.42 header.h
  --- rpm/rpmdb/header.h	17 Oct 2007 20:04:53 -0000	1.41
  +++ rpm/rpmdb/header.h	18 Oct 2007 14:08:48 -0000	1.42
  @@ -247,6 +247,7 @@
    * This will only ever be passed RPM_INT32_TYPE or RPM_STRING_TYPE to
    * help keep things simple.
    *
  + * @param he		tag container
    * @param type		tag type
    * @param data		tag value
    * @param formatPrefix
  @@ -254,7 +255,7 @@
    * @param element	RPM_BIN_TYPE: no. bytes of data
    * @return		formatted string
    */
  -typedef /*only@*/ char * (*headerTagFormatFunction)(rpmTagType type,
  +typedef /*only@*/ char * (*headerTagFormatFunction)(HE_t he, rpmTagType type,
   				rpmTagData *  data, char * formatPrefix,
   				int padding, int element)
   	/*@requires maxSet(data) >= 0 @*/;
  @@ .
Received on Thu Oct 18 16:08:49 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.