Changeset 6025 for branches/eam_rel9_b1/psLib/src/sys/psString.c
- Timestamp:
- Jan 16, 2006, 11:23:21 PM (21 years ago)
- File:
-
- 1 edited
-
branches/eam_rel9_b1/psLib/src/sys/psString.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_b1/psLib/src/sys/psString.c
r5569 r6025 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $15 * @date $Date: 200 5-11-22 19:11:07$14 * @version $Revision: 1.21.6.1 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-01-17 09:23:21 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 59 59 } 60 60 61 // XXX EAM : since 'dest' is on the memory system, this probably should be: 62 // ssize_t psStringAppend(psString *dest, const char *format, ...) 61 63 ssize_t psStringAppend(char **dest, const char *format, ...) 62 64 { … … 157 159 return length; 158 160 } 161 162 /*** psLine not yet released ***/ 163 # if (0) 164 static void psLineFree (psLine *line) 165 { 166 167 if (line == NULL) 168 return; 169 170 psFree (line->line); 171 return; 172 } 173 174 // allocate a psLine structrue 175 psLine *psLineAlloc (int Nline) 176 { 177 178 psLine *line; 179 line = psAlloc (sizeof(psLine)); 180 psMemSetDeallocator(line, (psFreeFunc) psLineFree); 181 182 line->Nline = 0; 183 line->NLINE = Nline; 184 line->line = psAlloc (Nline); 185 return (line); 186 } 187 188 bool psLineInit (psLine *line) 189 { 190 if (line == NULL) 191 return (false); 192 line->Nline = 0; 193 return (true); 194 } 195 196 bool psLineAdd (psLine *line, char *format, ...) 197 { 198 199 int Nchar; 200 va_list ap; 201 202 if (line == NULL) 203 return (false); 204 205 int nMax = line->NLINE - line->Nline; 206 207 va_start (ap, format); 208 Nchar = vsnprintf (&line->line[line->Nline], nMax, format, ap); 209 line->Nline += PS_MIN (nMax - 1, Nchar); 210 va_end (ap); 211 212 if (Nchar >= nMax) 213 return (false); 214 return (true); 215 } 216 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
