mirror of
				git://erdgeist.org/opentracker
				synced 2025-11-04 03:43:23 +08:00 
			
		
		
		
	Simplify includes
This commit is contained in:
		
							parent
							
								
									89f291566b
								
							
						
					
					
						commit
						b0e4ebbbf2
					
				@ -5,9 +5,11 @@
 | 
				
			|||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <pthread.h>
 | 
					#include <pthread.h>
 | 
				
			||||||
 | 
					#include <sys/uio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Libowfat */
 | 
					/* Libowfat */
 | 
				
			||||||
#include "byte.h"
 | 
					#include "byte.h"
 | 
				
			||||||
 | 
					#include "io.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Opentracker */
 | 
					/* Opentracker */
 | 
				
			||||||
#include "trackerlogic.h"
 | 
					#include "trackerlogic.h"
 | 
				
			||||||
 | 
				
			|||||||
@ -4,8 +4,6 @@
 | 
				
			|||||||
#ifndef __OT_CLEAN_H__
 | 
					#ifndef __OT_CLEAN_H__
 | 
				
			||||||
#define __OT_CLEAN_H__
 | 
					#define __OT_CLEAN_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "trackerlogic.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void clean_init( void );
 | 
					void clean_init( void );
 | 
				
			||||||
void clean_deinit( void );
 | 
					void clean_deinit( void );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -4,8 +4,6 @@
 | 
				
			|||||||
#ifndef __OT_IOVEC_H__
 | 
					#ifndef __OT_IOVEC_H__
 | 
				
			||||||
#define __OT_IOVEC_H__
 | 
					#define __OT_IOVEC_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <sys/uio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void  *iovec_increase( int *iovec_entries, struct iovec **iovector, size_t new_alloc );
 | 
					void  *iovec_increase( int *iovec_entries, struct iovec **iovector, size_t new_alloc );
 | 
				
			||||||
void   iovec_fixlast( int *iovec_entries, struct iovec **iovector, void *last_ptr );
 | 
					void   iovec_fixlast( int *iovec_entries, struct iovec **iovector, void *last_ptr );
 | 
				
			||||||
void   iovec_free( int *iovec_entries, struct iovec **iovector );
 | 
					void   iovec_free( int *iovec_entries, struct iovec **iovector );
 | 
				
			||||||
 | 
				
			|||||||
@ -6,9 +6,11 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <sys/mman.h>
 | 
					#include <sys/mman.h>
 | 
				
			||||||
 | 
					#include <sys/uio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Libowfat */
 | 
					/* Libowfat */
 | 
				
			||||||
#include "byte.h"
 | 
					#include "byte.h"
 | 
				
			||||||
 | 
					#include "io.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Opentracker */
 | 
					/* Opentracker */
 | 
				
			||||||
#include "trackerlogic.h"
 | 
					#include "trackerlogic.h"
 | 
				
			||||||
 | 
				
			|||||||
@ -4,6 +4,7 @@
 | 
				
			|||||||
/* System */
 | 
					/* System */
 | 
				
			||||||
#include <sys/types.h>
 | 
					#include <sys/types.h>
 | 
				
			||||||
#include <sys/mman.h>
 | 
					#include <sys/mman.h>
 | 
				
			||||||
 | 
					#include <sys/uio.h>
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <pthread.h>
 | 
					#include <pthread.h>
 | 
				
			||||||
@ -11,11 +12,14 @@
 | 
				
			|||||||
/* Libowfat */
 | 
					/* Libowfat */
 | 
				
			||||||
#include "scan.h"
 | 
					#include "scan.h"
 | 
				
			||||||
#include "byte.h"
 | 
					#include "byte.h"
 | 
				
			||||||
 | 
					#include "io.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Opentracker */
 | 
					/* Opentracker */
 | 
				
			||||||
#include "trackerlogic.h"
 | 
					#include "trackerlogic.h"
 | 
				
			||||||
#include "ot_mutex.h"
 | 
					#include "ot_mutex.h"
 | 
				
			||||||
#include "ot_sync.h"
 | 
					#include "ot_sync.h"
 | 
				
			||||||
 | 
					#include "ot_stats.h"
 | 
				
			||||||
 | 
					#include "ot_iovec.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef WANT_TRACKER_SYNC
 | 
					#ifdef WANT_TRACKER_SYNC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -25,9 +29,9 @@
 | 
				
			|||||||
   format: d4:syncd[..]ee
 | 
					   format: d4:syncd[..]ee
 | 
				
			||||||
   [..]:   ( 20:01234567890abcdefghij16:XXXXYYYY )+
 | 
					   [..]:   ( 20:01234567890abcdefghij16:XXXXYYYY )+
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
int add_changeset_to_tracker( ot_byte *data, size_t len ) {
 | 
					int add_changeset_to_tracker( uint8_t *data, size_t len ) {
 | 
				
			||||||
  ot_hash    *hash;
 | 
					  ot_hash    *hash;
 | 
				
			||||||
  ot_byte    *end = data + len;
 | 
					  uint8_t    *end = data + len;
 | 
				
			||||||
  unsigned long      peer_count;
 | 
					  unsigned long      peer_count;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* We do know, that the string is \n terminated, so it cant
 | 
					  /* We do know, that the string is \n terminated, so it cant
 | 
				
			||||||
@ -135,6 +139,7 @@ static void * sync_worker( void * args) {
 | 
				
			|||||||
    ot_tasktype tasktype = TASK_SYNC_OUT;
 | 
					    ot_tasktype tasktype = TASK_SYNC_OUT;
 | 
				
			||||||
    ot_taskid   taskid   = mutex_workqueue_poptask( &tasktype );
 | 
					    ot_taskid   taskid   = mutex_workqueue_poptask( &tasktype );
 | 
				
			||||||
    sync_make( &iovec_entries, &iovector );
 | 
					    sync_make( &iovec_entries, &iovector );
 | 
				
			||||||
 | 
					    stats_issue_event( EVENT_SYNC_OUT, 1, iovec_length( &iovec_entries, &iovector) );
 | 
				
			||||||
    if( mutex_workqueue_pushresult( taskid, iovec_entries, iovector ) )
 | 
					    if( mutex_workqueue_pushresult( taskid, iovec_entries, iovector ) )
 | 
				
			||||||
      iovec_free( &iovec_entries, &iovector );
 | 
					      iovec_free( &iovec_entries, &iovector );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -4,8 +4,6 @@
 | 
				
			|||||||
#ifndef __OT_VECTOR_H__
 | 
					#ifndef __OT_VECTOR_H__
 | 
				
			||||||
#define __OT_VECTOR_H__
 | 
					#define __OT_VECTOR_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "trackerlogic.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* These defines control vectors behaviour */
 | 
					/* These defines control vectors behaviour */
 | 
				
			||||||
#define OT_VECTOR_MIN_MEMBERS   4
 | 
					#define OT_VECTOR_MIN_MEMBERS   4
 | 
				
			||||||
#define OT_VECTOR_GROW_RATIO    8
 | 
					#define OT_VECTOR_GROW_RATIO    8
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user