RPM Community Forums

Mailing List Message of <rpm-cvs>

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

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 20 Oct 2007 - 17:10:37 CEST
Message-Id: <20071020151037.3A74F34845A@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:   20-Oct-2007 17:10:37
  Branch: HEAD                             Handle: 2007102016103601

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

  Log:
    - jbj: eliminate rpmec data type.

  Summary:
    Revision    Changes     Path
    1.1741      +1  -0      rpm/CHANGES
    1.101       +17 -11     rpm/rpmdb/header.c
    1.50        +0  -1      rpm/rpmdb/header.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1740 -r1.1741 CHANGES
  --- rpm/CHANGES	20 Oct 2007 14:39:43 -0000	1.1740
  +++ rpm/CHANGES	20 Oct 2007 15:10:36 -0000	1.1741
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: eliminate rpmec data type.
       - jbj: merge rpmec into HE_t.
       - jbj: not yet for binary search retrieve using tagValue.
       - jbj: unbork --yaml.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.c
  ============================================================================
  $ cvs diff -u -r1.100 -r1.101 header.c
  --- rpm/rpmdb/header.c	20 Oct 2007 14:39:43 -0000	1.100
  +++ rpm/rpmdb/header.c	20 Oct 2007 15:10:37 -0000	1.101
  @@ -30,7 +30,6 @@
   /*@access entryInfo @*/
   /*@access indexEntry @*/
   
  -/*@access rpmec @*/
   /*@access sprintfTag @*/
   /*@access sprintfToken @*/
   /*@access HV_t @*/
  @@ -2591,7 +2590,10 @@
       headerSprintfExtension exts;
   /*@observer@*/ /*@null@*/
       const char * errmsg;
  -    rpmec ec;
  +    HE_t ec;			/*!< Extension data cache. */
  +    int nec;			/*!< No. of extension cache items. */
  +    HE_t tc;			/*!< Tag data cache. */
  +    int ntc;			/*!< No. of tag cache items. */
       sprintfToken format;
   /*@relnull@*/
       HeaderIterator hi;
  @@ -3429,7 +3431,7 @@
   		/*@out@*/ hTYP_t typeptr,
   		/*@out@*/ hRET_t * data,
   		/*@out@*/ hCNT_t countptr,
  -		rpmec ec)
  +		HE_t ec)
   	/*@modifies *typeptr, *data, *countptr, ec @*/
   {
       if (!ec->avail) {
  @@ -3837,21 +3839,24 @@
    * @param exts		headerSprintf extensions
    * @return		new extension cache
    */
  -static /*@only@*/ rpmec
  -rpmecNew(const headerSprintfExtension exts)
  +static /*@only@*/ HE_t
  +rpmecNew(const headerSprintfExtension exts, /*@null@*/ int * necp)
   	/*@*/
   {
       headerSprintfExtension ext;
  -    rpmec ec;
  -    int extNum;
  +    HE_t ec;
  +    int extNum = 0;
   
  +    if (exts != NULL)
       for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
   	ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1), extNum++)
       {
   	;
       }
   
  -    ec = xcalloc(extNum, sizeof(*ec));
  +    ec = xcalloc(extNum+1, sizeof(*ec));
  +    if (*necp)
  +	necp = extNum;
       return ec;
   }
   
  @@ -3861,8 +3866,8 @@
    * @param ec		extension cache
    * @return		NULL always
    */
  -static /*@null@*/ rpmec
  -rpmecFree(const headerSprintfExtension exts, /*@only@*/ rpmec ec)
  +static /*@null@*/ HE_t
  +rpmecFree(const headerSprintfExtension exts, /*@only@*/ HE_t ec)
   	/*@modifies ec @*/
   {
       headerSprintfExtension ext;
  @@ -3919,7 +3924,7 @@
       if (parseFormat(hsa, hsa->fmt, &hsa->format, &hsa->numTokens, NULL, PARSER_BEGIN))
   	goto exit;
   
  -    hsa->ec = rpmecNew(hsa->exts);
  +    hsa->ec = rpmecNew(hsa->exts, &hsa->nec);
       hsa->val = xstrdup("");
   
       tag =
  @@ -3971,6 +3976,7 @@
   	hsa->val = xrealloc(hsa->val, hsa->vallen+1);	
   
       hsa->ec = rpmecFree(hsa->exts, hsa->ec);
  +    hsa->nec = 0;
       hsa->format = freeFormat(hsa->format, hsa->numTokens);
   
   exit:
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.h
  ============================================================================
  $ cvs diff -u -r1.49 -r1.50 header.h
  --- rpm/rpmdb/header.h	20 Oct 2007 14:39:43 -0000	1.49
  +++ rpm/rpmdb/header.h	20 Oct 2007 15:10:37 -0000	1.50
  @@ -187,7 +187,6 @@
   typedef struct _HE_s HE_s;
   #endif
   typedef HE_s * HE_t;		/* tag container. */
  -typedef /*@abstract@*/ HE_s * rpmec;		/* Extension Cache entry. */
   /*@=typeuse =fielduse@*/
   
   /** \ingroup header
  @@ .
Received on Sat Oct 20 17:10:37 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.