~ubuntu-branches/ubuntu/lucid/slrn/lucid

« back to all changes in this revision

Viewing changes to src/ranges.c

  • Committer: Bazaar Package Importer
  • Author(s): Jörg Sommer
  • Date: 2008-08-18 23:32:54 UTC
  • mfrom: (1.1.6 upstream) (4.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20080818233254-vi692cugon4nda4j
Tags: 0.9.9-1
* New upstream release
  + A solution to workaround the problem of overlong lines in the
    header, especially the References line, was added in version
    pre127. (closes: #472006)

* Remove the patch gnutls-support.dpatch, because it's applied to the
  upstream source in pre123.

* Adapted the watch to the the new location on space.mit.edu, former
  sourceforge.net.

* Added the DM-Upload-Allowed field in the control file.

* Upload sponsored by Norbert Tretkowski

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 Copyright (c) 2003-2006 Thomas Schultz <tststs@gmx.de>
6
6
 
7
7
 partly based on code by John E. Davis:
8
 
 Copyright (c) 1994, 1999 John E. Davis <davis@space.mit.edu>
 
8
 Copyright (c) 1994, 1999, 2007-2008 John E. Davis <jed@jedsoft.org>
9
9
 
10
10
 This program is free software; you can redistribute it and/or modify it
11
11
 under the terms of the GNU General Public License as published by the Free
72
72
 * If max is non-zero, no numbers larger than max are written.
73
73
 * Returns 0 on success, -1 otherwise.
74
74
 */
75
 
int slrn_ranges_to_newsrc_file (Slrn_Range_Type *r, int max, FILE* fp) /*{{{*/
 
75
int slrn_ranges_to_newsrc_file (Slrn_Range_Type *r, NNTP_Artnum_Type max, FILE* fp) /*{{{*/
76
76
{
77
77
   while ((r != NULL) && ((max<=0) || (r->min <= max)))
78
78
     {
79
 
        int minmax = r->max;
 
79
        NNTP_Artnum_Type minmax = r->max;
80
80
        if ((max>0) && (minmax > max))
81
81
          minmax = max;
82
82
        
83
83
        if (r->min != minmax)
84
84
          {
85
 
             if (fprintf (fp, "%d-%d", r->min, minmax) < 0)
 
85
             if (fprintf (fp, NNTP_FMT_ARTRANGE, r->min, minmax) < 0)
86
86
               return -1;
87
87
          }
88
 
        else if (fprintf (fp, "%d", r->min) < 0)
 
88
        else if (fprintf (fp, NNTP_FMT_ARTNUM, r->min) < 0)
89
89
          return -1;
90
90
        
91
91
        r = r->next;
101
101
 * returns a pointer in case the first element of the list changes.
102
102
 * (r==NULL) is allowed; in this case, a new list is created
103
103
 */
104
 
Slrn_Range_Type *slrn_ranges_add (Slrn_Range_Type *r, int min, int max) /*{{{*/
 
104
Slrn_Range_Type *slrn_ranges_add (Slrn_Range_Type *r, NNTP_Artnum_Type min, NNTP_Artnum_Type max) /*{{{*/
105
105
{
106
106
   Slrn_Range_Type *head = r;
107
107
   
182
182
 * Note: does not allocate a new list, but changes r; the function still
183
183
 * returns a pointer in case the first element of the list gets deleted.
184
184
 */
185
 
Slrn_Range_Type *slrn_ranges_remove (Slrn_Range_Type *r, int min, int max) /*{{{*/
 
185
Slrn_Range_Type *slrn_ranges_remove (Slrn_Range_Type *r, NNTP_Artnum_Type min,  NNTP_Artnum_Type max) /*{{{*/
186
186
{
187
187
   Slrn_Range_Type *head = r;
188
188
   
323
323
/*}}}*/
324
324
 
325
325
/* Checks if n is in r; returns 1 if true, 0 if false. */
326
 
int slrn_ranges_is_member (Slrn_Range_Type *r, int n) /*{{{*/
 
326
int slrn_ranges_is_member (Slrn_Range_Type *r, NNTP_Artnum_Type n) /*{{{*/
327
327
{
328
328
   while (r != NULL)
329
329
     {