list_len(...)
This commit is contained in:
		
							parent
							
								
									78ba452469
								
							
						
					
					
						commit
						8979ccb48b
					
				
							
								
								
									
										13
									
								
								dunst.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								dunst.c
									
									
									
									
									
								
							| @ -57,6 +57,7 @@ static int message_h; | ||||
| /* list functions */ | ||||
| msg_queue_t *append(msg_queue_t *queue, char *msg); | ||||
| msg_queue_t *pop(msg_queue_t *queue); | ||||
| int list_len(msg_queue_t *list); | ||||
| 
 | ||||
| 
 | ||||
| /* misc funtions */ | ||||
| @ -102,6 +103,18 @@ pop(msg_queue_t *queue) { | ||||
|     return new_head; | ||||
| } | ||||
| 
 | ||||
| int list_len(msg_queue_t *list) { | ||||
|     int count = 0; | ||||
|     msg_queue_t *i; | ||||
|     if(list == NULL) { | ||||
|         return 0; | ||||
|     } | ||||
|     for(i = list; i != NULL; i = i->next) { | ||||
|         count++; | ||||
|     } | ||||
|     return count; | ||||
| } | ||||
| 
 | ||||
| void | ||||
| drawmsg(const char *msg) { | ||||
|     int width, x, y; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Sascha Kruse
						Sascha Kruse