|  | @@ -2679,6 +2679,30 @@ tor_sscanf(const char *buf, const char *pattern, ...)
 | 
	
		
			
				|  |  |    return r;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +/** Append the string produced by tor_asprintf(<b>pattern</b>, <b>...</b>)
 | 
	
		
			
				|  |  | + * to <b>sl</b>. */
 | 
	
		
			
				|  |  | +void
 | 
	
		
			
				|  |  | +smartlist_asprintf_add(struct smartlist_t *sl, const char *pattern, ...)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +  va_list ap;
 | 
	
		
			
				|  |  | +  va_start(ap, pattern);
 | 
	
		
			
				|  |  | +  smartlist_vasprintf_add(sl, pattern, ap);
 | 
	
		
			
				|  |  | +  va_end(ap);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/** va_list-based backend of smartlist_asprintf_add. */
 | 
	
		
			
				|  |  | +void
 | 
	
		
			
				|  |  | +smartlist_vasprintf_add(struct smartlist_t *sl, const char *pattern,
 | 
	
		
			
				|  |  | +                        va_list args)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +  char *str = NULL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  tor_vasprintf(&str, pattern, args);
 | 
	
		
			
				|  |  | +  tor_assert(str != NULL);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  smartlist_add(sl, str);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  /** Return a new list containing the filenames in the directory <b>dirname</b>.
 | 
	
		
			
				|  |  |   * Return NULL on error or if <b>dirname</b> is not a directory.
 | 
	
		
			
				|  |  |   */
 |