src/server/twitmanager.c
int puttwit( struct twitmanager * restrict tm, 
		const char * restrict string, 
		size_t string_len ){
	int status = 0; // must initialize to zero

	// Validate the paramaters
	if ( tm == NULL || string == NULL || len == 0 ){	
		errno = EINVAL;
		return ( -1 );
	}

	// Acquire ownership of the twit manager
	acquire_twitmanager( tm );

	// This twit must be put in all twit pools so as 
	// the hearers will get it
	status = broadcast_twit( tm, string, string_len );

	// A twit was stored so increase count by one
	if ( status != -1 ){
		++tm->tm_twitcount;
	}

	// Release ownership of the twit manager
	release_twitmanager( tm );

	return ( status );
}
// Put the given twits so as all hearers will get it
Put the given twits so as all hearers will get it
Put the given twits so as all hearers will get it
int puttwit( struct twitmanager * restrict tm, 
		const char * restrict string, 
		size_t string_len ){
	int status = 0; 
	if ( tm == NULL || string == NULL || len == 0 ){	
		errno = EINVAL;
		return ( -1 );
	}
	acquire_twitmanager( tm );
	status = broadcast_twit( tm, string, string_len );
	if ( status != -1 ){
		++tm->tm_twitcount;
	}
	release_twitmanager( tm );
	return ( status );
}
int puttwit ( struct twitmanager * restrict tm , const char * restrict string , size_t string_len ) { int status = 0 ; if ( tm == NULL || string == NULL || len == 0 ) { errno = EINVAL ; return ( -1 ) ; } acquire_twitmanager ( tm ) ; status = broadcast_twit ( tm , string , string_len ) ; if ( status != -1 ) { ++ tm -> tm_twitcount ; } release_twitmanager ( tm ) ; return ( status ) ; }
Put the given twits so as all hearers will get it
Put the given twits so as all hearers will get it
// must initialize to zero // Validate the paramaters // Acquire ownership of the twit manager // This twit must be put in all twit pools so as  // the hearers will get it // A twit was stored so increase count by one // Release ownership of the twit manager