Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / m_remsg.c,v
1 head    1.8;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.8
9 date    92.12.15.00.20.22;      author jromine; state Exp;
10 branches;
11 next    1.7;
12
13 1.7
14 date    92.02.11.21.32.04;      author jromine; state Exp;
15 branches;
16 next    1.6;
17
18 1.6
19 date    92.02.03.16.35.19;      author jromine; state Exp;
20 branches;
21 next    1.5;
22
23 1.5
24 date    92.01.31.21.55.24;      author jromine; state Exp;
25 branches;
26 next    1.4;
27
28 1.4
29 date    90.04.05.15.32.29;      author sources; state Exp;
30 branches;
31 next    1.3;
32
33 1.3
34 date    90.04.05.14.50.04;      author sources; state Exp;
35 branches;
36 next    1.2;
37
38 1.2
39 date    90.03.20.15.58.30;      author sources; state Exp;
40 branches;
41 next    1.1;
42
43 1.1
44 date    90.03.20.15.58.13;      author sources; state Exp;
45 branches;
46 next    ;
47
48
49 desc
50 @@
51
52
53 1.8
54 log
55 @endif sugar
56 @
57 text
58 @/* m_remsg.c - realloc a msgs structure */
59 #ifndef lint
60 static char ident[] = "@@(#)$Id: m_remsg.c,v 1.7 1992/02/11 21:32:04 jromine Exp jromine $";
61 #endif  /* lint */
62
63 #include "../h/mh.h"
64 #include <stdio.h>
65
66
67 struct msgs *m_remsg (mp, lo, hi)
68 register struct msgs *mp;
69 int     lo,
70         hi;
71 {
72     int     msgnum;
73 #ifdef  MTR
74     register int   *sp,
75                    *pp;
76 #endif  /* MTR */
77
78     if (lo == 0 && (lo = mp -> lowmsg) == 0)
79         lo = 1;
80     if (hi < mp -> hghmsg)
81         hi = mp -> hghmsg + (MAXFOLDER - mp -> nummsg);
82     if (hi <= mp -> hghmsg)
83         hi = mp -> hghmsg + MAXFOLDER;
84     if (lo == mp -> lowmsg && hi == mp -> hghmsg)
85         return mp;
86
87 #ifndef MTR
88     mp = (struct msgs  *) realloc ((char *) mp, MHSIZE (mp, lo, hi));
89     if (mp == NULL)
90         adios (NULLCP, "unable to re-allocate folder storage");
91 #else   /* MTR */
92     if ((sp = (int *) calloc ((unsigned) 1, MHSIZEX (mp, lo, hi))) == NULL)
93         adios (NULLCP, "unable to re-allocate messages storage");
94
95     pp = sp - lo;
96     if (pp < (int *)0)
97         adios (NULLCP, "m_remsg() botch -- you lose big[1]");
98     for (msgnum = mp -> lowmsg; msgnum <= mp -> hghmsg; msgnum++)
99         pp[msgnum] = mp -> msgstats[msgnum];
100     free ((char *) mp -> msgbase);
101     mp -> msgstats = sp;
102 #endif  /* MTR */
103     mp -> lowoff = lo;
104     mp -> hghoff = hi;
105 #ifdef  MTR
106     mp -> msgstats = (mp -> msgbase = mp -> msgstats) - mp -> lowoff;
107     if (mp -> msgstats < (int *)0)
108         adios (NULLCP, "m_remsg() botch -- you lose big[2]");
109 #endif  /* MTR */
110     for (msgnum = mp -> lowmsg - 1; msgnum >= lo; msgnum--)
111         mp -> msgstats[msgnum] = 0;
112     for (msgnum = mp -> hghmsg + 1; msgnum <= hi; msgnum++)
113         mp -> msgstats[msgnum] = 0;
114
115     return mp;
116 }
117 @
118
119
120 1.7
121 log
122 @put sequences in an "int"
123 @
124 text
125 @d3 2
126 a4 2
127 static char ident[] = "@@(#)$Id: m_remsg.c,v 1.6 1992/02/03 16:35:19 jromine Exp jromine $";
128 #endif  lint
129 d19 1
130 a19 1
131 #endif  MTR
132 d34 1
133 a34 1
134 #else   MTR
135 d45 1
136 a45 1
137 #endif  MTR
138 d52 1
139 a52 1
140 #endif  MTR
141 @
142
143
144 1.6
145 log
146 @fix
147 @
148 text
149 @d3 1
150 a3 1
151 static char ident[] = "@@(#)$Id: m_remsg.c,v 1.5 1992/01/31 21:55:24 jromine Exp jromine $";
152 d17 1
153 a17 1
154     register short *sp,
155 d35 1
156 a35 1
157     if ((sp = (short *) calloc ((unsigned) 1, MHSIZEX (mp, lo, hi))) == NULL)
158 d39 1
159 a39 1
160     if (pp < (short *)0)
161 d50 1
162 a50 1
163     if (mp -> msgstats < (short *)0)
164 @
165
166
167 1.5
168 log
169 @kerberos
170 @
171 text
172 @d3 1
173 a3 1
174 static char ident[] = "@@(#)$Id: m_remsg.c,v 1.4 1990/04/05 15:32:29 sources Exp jromine $";
175 d31 1
176 a31 1
177     mp = (struct msgs  *) realloc ((char *) mp, MSIZE (mp, lo, hi));
178 d35 1
179 a35 1
180     if ((sp = (short *) calloc ((unsigned) 1, MSIZEX (mp, lo, hi))) == NULL)
181 @
182
183
184 1.4
185 log
186 @add ID
187 @
188 text
189 @d3 1
190 a3 1
191 static char ident[] = "@@(#)$Id:$";
192 d54 1
193 a54 1
194         mp -> msgstats[msgnum] = NULL;
195 d56 1
196 a56 1
197         mp -> msgstats[msgnum] = NULL;
198 @
199
200
201 1.3
202 log
203 @add ID
204 @
205 text
206 @d3 1
207 a3 1
208 static char ident[] = "$Id:";
209 @
210
211
212 1.2
213 log
214 @cast (short *)0
215 @
216 text
217 @d2 3
218 @
219
220
221 1.1
222 log
223 @Initial revision
224 @
225 text
226 @d36 1
227 a36 1
228     if (pp < 0)
229 d47 1
230 a47 1
231     if (mp -> msgstats < 0)
232 @