• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PRINT_MSG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PRINT_MSG函数的典型用法代码示例。如果您正苦于以下问题:C++ PRINT_MSG函数的具体用法?C++ PRINT_MSG怎么用?C++ PRINT_MSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PRINT_MSG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: botfs_open

/**
 * Oeffnet eine Datei
 * \param filename	Dateiname
 * \param *file		Zeiger auf Datei-Deskriptor
 * \param mode		Modus, in dem die Datei geoeffnet wird
 * \param *buffer	Puffer fuer mindestens BOTFS_BLOCK_SIZE Byte
 * \return			0, falls kein Fehler
 */
int8_t botfs_open(const char * filename, botfs_file_descr_t * file, uint8_t mode, void * buffer) {
	botfs_acquire_lock_low(&botfs_mutex);
	/* Datei suchen */
	botfs_file_t * ptr = search_file(filename, buffer);
	if (ptr == NULL) {
		botfs_release_lock_low(&botfs_mutex);
		PRINT_MSG("botfs_open(): file not found");
		return -1;
	}

	/* Datei-Deskriptor laden und updaten */
	*file = ptr->descr;
	file->mode = mode;
	file->pos = file->start + BOTFS_HEADER_SIZE;

	/* Datei-Header laden */
	if (botfs_read_low(file->start, buffer) != 0) {
		botfs_release_lock_low(&botfs_mutex);
		PRINT_MSG("botfs_open(): read_low()-error");
		return -2;
	}

	/* benutzte Bloecke lt. Header in den Datei-Deskriptor uebernehmen */
	botfs_file_header_t * ptr_head = buffer;
	file->used = ptr_head->used_blocks;
//	PRINT_MSG("botfs_open(): start=0x%x end=0x%x", file->used.start, file->used.end);

	int8_t tmp = 0;
	if (mode == BOTFS_MODE_W) {
		PRINT_MSG("botfs_open(): Datei wird geleert...");
		tmp = clear_file(file, buffer);
	}
	botfs_release_lock_low(&botfs_mutex);
	return tmp;
}
开发者ID:lenchen-88,项目名称:ct-bot,代码行数:43,代码来源:botfs.c


示例2: botfs_unlink

/**
 * Entfernt eine Datei
 * \param *filename	Dateiname
 * \param *buffer	Puffer fuer mindestens BOTFS_BLOCK_SIZE Byte
 * \return			0, falls kein Fehler
 */
int8_t botfs_unlink(const char * filename, void * buffer) {
	botfs_acquire_lock_low(&botfs_mutex);
	/* Datei suchen */
	botfs_file_t * ptr = search_file(filename, buffer);
	if (ptr == NULL) {
		botfs_release_lock_low(&botfs_mutex);
		PRINT_MSG("botfs_unlink(): Datei nicht vorhanden");
		return -1;
	}

	/* Root-Dir Eintrag loeschen */
	ptr->name[0] = 0;
	ptr->name[1] = 0;
	botfs_seek(&botfs_vol_data.rootdir, -1, SEEK_CUR); // Dateizeiger stand auf naechstem Dir-Block => -1
	if (botfs_write(&botfs_vol_data.rootdir, buffer) != 0) {
		botfs_release_lock_low(&botfs_mutex);
		PRINT_MSG("botfs_unlink(): Fehler beim Schreiben des Root-Blocks");
		return -2;
	}
	const uint16_t start = ptr->descr.start;
	const uint16_t end = ptr->descr.end;

	/* Freelist aktualisieren */
	int8_t res = add_to_freelist(start, end, buffer);

	botfs_release_lock_low(&botfs_mutex);

	PRINT_MSG("botfs_unlink(): Datei \"%s\" wurde geloescht", filename);
	return res;
}
开发者ID:lenchen-88,项目名称:ct-bot,代码行数:36,代码来源:botfs.c


示例3: botfs_init

/**
 * Initialisiert ein Volume
 * \param *image	Dateiname des Images
 * \param *buffer	Puffer fuer mindestens BOTFS_BLOCK_SIZE Byte
 * \param create	Soll das Volume erzeugt werden, falls es nicht existiert?
 * \return			0, falls kein Fehler
 */
int8_t botfs_init(char * image, void * buffer, uint8_t create) {
	init_state = 0;
	/* Volume laden */
	PRINT_MSG("botfs_init_low(\"%s\")...", image);
	if (botfs_init_low(image, buffer, create) != 0) {
		PRINT_MSG("botfs_init(): botfs_init_low() schlug fehl");
		return -1;
	}

	/* Header einlesen */
	if (botfs_read_low(BOTFS_HEADER_POS, buffer) != 0) {
		PRINT_MSG("botfs_init(): botfs_read_low(BOTFS_HEADER_POS) schlug fehl");
		return -2;
	}

	/* Root-Dir- und Freelist-Adresse speichern */
	botfs_volume_t * volume = buffer;
	botfs_vol_data = volume->data.ctrldata;
	init_state = 1;

	if (botfs_check_volume_low(image, buffer) != 0) {
		PRINT_MSG("botfs_init(): Volume fehlerhaft");
		init_state = 0;
		return -3;
	}

	PRINT_MSG("botfs_init() erfolgreich");
	return 0;
}
开发者ID:lenchen-88,项目名称:ct-bot,代码行数:36,代码来源:botfs.c


示例4: main

int main (int argc, char **argv)
{
  uint_t err = 0;
  if (argc < 2) {
    err = 2;
    PRINT_ERR("not enough arguments\n");
    PRINT_MSG("read a wave file as a mono vector\n");
    PRINT_MSG("usage: %s <source_path> [samplerate] [win_size] [hop_size]\n", argv[0]);
    return err;
  }
  uint_t samplerate = 0;
  if ( argc >= 3 ) samplerate = atoi(argv[2]);
  uint_t win_size = 1024; // window size
  if ( argc >= 4 ) win_size = atoi(argv[3]);
  uint_t hop_size = win_size / 4;
  if ( argc >= 5 ) hop_size = atoi(argv[4]);
  uint_t n_frames = 0, read = 0;

  char_t *source_path = argv[1];
  aubio_source_t * source = new_aubio_source(source_path, samplerate, hop_size);
  if (!source) { err = 1; goto beach; }

  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(source);

  // create some vectors
  fvec_t * in = new_fvec (hop_size); // input audio buffer
  fvec_t * out = new_fvec (1); // output position

  // create tempo object
  aubio_tempo_t * o = new_aubio_tempo("default", win_size, hop_size, samplerate);

  do {
    // put some fresh data in input vector
    aubio_source_do(source, in, &read);
    // execute tempo
    aubio_tempo_do(o,in,out);
    // do something with the beats
    if (out->data[0] != 0) {
      PRINT_MSG("beat at %.3fms, %.3fs, frame %d, %.2fbpm with confidence %.2f\n",
          aubio_tempo_get_last_ms(o), aubio_tempo_get_last_s(o),
          aubio_tempo_get_last(o), aubio_tempo_get_bpm(o), aubio_tempo_get_confidence(o));
    }
    n_frames += read;
  } while ( read == hop_size );

  PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n",
      n_frames * 1. / samplerate,
      n_frames, samplerate,
      n_frames / hop_size, source_path);

  // clean up memory
  del_aubio_tempo(o);
  del_fvec(in);
  del_fvec(out);
  del_aubio_source(source);
beach:
  aubio_cleanup();

  return err;
}
开发者ID:XunjunYin,项目名称:aubio,代码行数:60,代码来源:test-tempo.c


示例5: remove_old_socket

static ret_t
remove_old_socket (const char *path)
{
	int         re;
	struct stat info;

	/* It might not exist
	 */
	re = cherokee_stat (path, &info);
	if (re != 0) {
		return ret_ok;
	}

	/* If exist, it must be a socket
	 */
	if (! S_ISSOCK(info.st_mode)) {
		PRINT_MSG ("ERROR: Something happens; '%s' isn't a socket.\n", path);
		return ret_error;
	}

	/* Remove it
	 */
	re = unlink (path);
	if (re != 0) {
		PRINT_MSG ("ERROR: Couldn't remove unix socket '%s'.\n", path);
		return ret_error;
	}

	return ret_ok;
}
开发者ID:nuxleus,项目名称:cherokee-webserver,代码行数:30,代码来源:main_admin.c


示例6: sizeof

// --------------------------------------------------------------------------
//  From class CMMFCodec.
//  The function sets codec configuration.
//  value used for aConfigType must be KUidMmfCodecAudioSettings
//  (defined in include\mmf\plugins\mmfCodecImplementationUIDs.hrh)
//
// --------------------------------------------------------------------------
//
void CAriAmrNbEncMmfCodec::ConfigureL( TUid /* aConfigType */,
                                                const TDesC8& aParam )
    {
    PRINT_ENTRY;
    if ( !iConfigured )
        {
        TInt encMode = 0;
        TInt dtx = 0;
        TInt offset = 0;

        Mem::Copy( &encMode,  aParam.Ptr() + offset,  sizeof( TInt ) );
        offset += sizeof(TInt);

        Mem::Copy( &dtx,  aParam.Ptr() + offset,  sizeof( TInt ) );
        offset += sizeof(TInt);

        iParam.iMode = ( TInt16 )encMode;
        iParam.iDtx = ( TInt16 )dtx;

        PRINT_MSG( LEVEL_HIGH, ( "Mode: %d", iParam.iMode ) );
        PRINT_MSG( LEVEL_HIGH, ( "DTX: %d", iParam.iDtx ) );

        User::LeaveIfError( iCodec->Reset( &iParam ) );

        iConfigured = ETrue;
        }
    PRINT_EXIT;
    }
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:36,代码来源:ariamrnbencmmfcodec.cpp


示例7: PRINT_MSG

// --------------------------------------------------------------------------
//  Second phase of the two-phased constructor.
//  Creates an instance of encoder
// --------------------------------------------------------------------------
//
void CAriAacLCEncMmfCodec::ConstructL()
    {
    PRINT_ENTRY;
    iCodec = CAriAacLCEncWrapper::NewL();

    iInternalInputBuffer = ( TUint8* ) User::AllocZL( KMinBytesInput );
    iInternalOutputBuffer = ( TUint8* ) User::AllocZL( KMinDstLen );

    PRINT_MSG( LEVEL_HIGH, ( "Default NumberOfChannels: %d",
                                                iParam.iNumberOfChannels ) );
    PRINT_MSG( LEVEL_HIGH, ( "Default OutputBitRate: %d",
                                                iParam.iOutputBitRate ) );
    PRINT_MSG( LEVEL_HIGH, ( "Default OutputFormat: %d",
                                                iParam.iOutputFormat ) );

    PRINT_MSG( LEVEL_HIGH, ( "Default SamplingFrequency: %d",
                                                iParam.iSamplingFrequency ) );

    //Reset encoder with default parameters
    User::LeaveIfError( iCodec->Reset( &iParam ) );

    iSrclenToProcess = sizeof( TInt16 ) * KNoOfSamples *
                                                    iParam.iNumberOfChannels;
    PRINT_EXIT;
    }
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:30,代码来源:ariaaclcencmmfcodec.cpp


示例8: botfs_init_low

/**
 * Laedt das Volume
 * \param *image	Dateiname des Images
 * \param *buffer	Puffer fuer mindestens BOTFS_BLOCK_SIZE Byte
 * \param create	Soll das Volume erzeugt werden, falls es nicht existiert?
 * \return			0, falls kein Fehler
 */
int8_t botfs_init_low(char * image, void * buffer, uint8_t create) {
	(void) buffer; // kein warning
#ifdef DEBUG_BOTFS_LOGFILE
	botfs_acquire_lock_low(&log_mutex);
	botfs_log_fd = fopen(BOTFS_DEBUG_LOGFILE, "wb");
	botfs_release_lock_low(&log_mutex);
#endif // DEBUG_BOTFS_LOGFILE

	botfs_acquire_lock_low(&file_mutex);
	image_file = fopen(image, "r+b");
	botfs_release_lock_low(&file_mutex);
	if (image_file == NULL) {
		PRINT_MSG("botfs_init_low(): Image-Datei \"%s\" konnte nicht geoeffnet werden", image);
		if (create != 1) {
			return -1;
		}
		PRINT_MSG("botfs_init_low(): Lege neues Images \"%s\" an...", image);
		if (botfs_create_volume(image, BOTFS_DEFAULT_VOL_NAME, BOTFS_DEFAULT_VOL_SIZE) != 0) {
			PRINT_MSG("botfs_init_low(): botfs_create_volume(\"%s\") schlug fehl", image);
			return -2;
		}
		botfs_acquire_lock_low(&file_mutex);
		image_file = fopen(image, "r+b");
		botfs_release_lock_low(&file_mutex);
		if (image_file == NULL) {
			PRINT_MSG("botfs_init_low(): angelegte Image-Datei \"%s\" konnte nicht geoeffnet werden", image);
			return -3;
		}
	}

	PRINT_MSG("botfs_init_low() erfolgreich");
	return 0;
}
开发者ID:lenchen-88,项目名称:ct-bot,代码行数:40,代码来源:botfs-low_pc.c


示例9: check_worker_version

static ret_t
check_worker_version (const char *this_exec)
{
	FILE *f;
	char  tmp[256];
	char *line, *p;
	int   re;

	snprintf (tmp, sizeof(tmp), "%s -i", cherokee_worker);
	f = popen (tmp, "r");
	if (f == NULL) {
		PRINT_MSG ("(critical) Cannot execute '%s'\n", tmp);
		goto error;
	}

	while (! feof(f)) {
		/* Skip line until it found the version entry
		 */
		line = fgets (tmp, sizeof(tmp), f);
		if (line == NULL)
			continue;

		line = strstr (line, "Version: ");
		if (line == NULL)
			continue;

		/* Compare both version strings
		 */
		line += 9;
		re = strncmp (line, PACKAGE_VERSION, strlen(PACKAGE_VERSION));
		if (re == 0) {
			pclose(f);
			return ret_ok;
		}

		/* Remove the new line character and report the error
		 */
		p = line;
		while (*p++ != '\n');
		*p = '\0';

		PRINT_MSG_S ("ERROR: Broken installation detected\n");
		PRINT_MSG   ("  Cherokee        (%s) %s\n", this_exec, PACKAGE_VERSION);
		PRINT_MSG   ("  Cherokee-worker (%s) %s\n", cherokee_worker, line);
		PRINT_MSG_S ("\n");
		PRINT_MSG_S ("This issue is usually caused by a secondary Cherokee installation in your $PATH.\n");
		PRINT_MSG_S ("The following command might help to find where the installations were performed:\n\n");
		PRINT_MSG_S ("find `echo $PATH | sed 's/:/ /g'` -name 'cherokee*' -exec dirname \"{}\" \\; | uniq\n");
		PRINT_MSG_S ("\n");

		goto error;
	}

	PRINT_MSG ("(critical) Couldn't find the version string: '%s -i'\n", cherokee_worker);
error:
	if (f != NULL) {
		pclose(f);
	}
	return ret_error;
}
开发者ID:adriano-io,项目名称:webserver,代码行数:60,代码来源:main.c


示例10: sem_new

static int
sem_new (void)
{
	int         i;
	int         re;
	int         sem;
	union semun ctrl;

	/* Create */
	sem = semget (getpid(), SEM_LAUNCH_TOTAL, IPC_CREAT | SEM_R | SEM_A);
	if (sem < 0) {
		PRINT_MSG ("Could not create semaphore: %s\n", strerror(errno));
		return -1;
	}

	/* Initialize */
	for (i=0; i < SEM_LAUNCH_TOTAL; i++) {
		ctrl.val = 0;
		re = semctl (sem, i, SETVAL, ctrl);
		if (re < 0) {
			goto error;
		}
	}

	return sem;

error:
	PRINT_MSG ("Could not initialize semaphore: %s\n", strerror(errno));
	return -1;
}
开发者ID:adriano-io,项目名称:webserver,代码行数:30,代码来源:main.c


示例11: main

int main (int argc, char **argv)
{
  sint_t err = 0;

  if (argc < 3) {
    err = 2;
    PRINT_ERR("not enough arguments\n");
    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
    return err;
  }

  char_t *source_path = argv[1];
  char_t *sink_path = argv[2];

  uint_t samplerate = 0;
  uint_t hop_size = 256;
  if ( argc >= 4 ) samplerate = atoi(argv[3]);
  if ( argc >= 5 ) hop_size = atoi(argv[4]);
  if ( argc >= 6 ) {
    err = 2;
    PRINT_ERR("too many arguments\n");
    return err;
  }

  fvec_t *vec = new_fvec(hop_size);
  if (!vec) { err = 1; goto beach_fvec; }

  aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size);
  if (!i) { err = 1; goto beach_source; }

  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);

  aubio_sink_t *o = new_aubio_sink(sink_path, samplerate);
  if (!o) { err = 1; goto beach_sink; }

  uint_t n_frames = 0, read = 0;

  do {
    aubio_source_do(i, vec, &read);
    aubio_sink_do(o, vec, read);
    n_frames += read;
  } while ( read == hop_size );

  PRINT_MSG("read %d frames at %dHz (%d blocks) from %s written to %s\n",
      n_frames, samplerate, n_frames / hop_size,
      source_path, sink_path);

  del_aubio_sink(o);
beach_sink:
  del_aubio_source(i);
beach_source:
  del_fvec(vec);
beach_fvec:
  return err;
}
开发者ID:famulus,项目名称:aubio,代码行数:55,代码来源:test-sink.c


示例12: main

int main (int argc, char **argv)
{
  uint_t err = 0;
  if (argc < 2) {
    err = 2;
    PRINT_ERR("not enough arguments\n");
    PRINT_MSG("read a wave file as a mono vector\n");
    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
    PRINT_MSG("examples:\n");
    PRINT_MSG(" - read file.wav at original samplerate\n");
    PRINT_MSG("       %s file.wav\n", argv[0]);
    PRINT_MSG(" - read file.wav at 32000Hz\n");
    PRINT_MSG("       %s file.aif 32000\n", argv[0]);
    PRINT_MSG(" - read file.wav at original samplerate with 4096 blocks\n");
    PRINT_MSG("       %s file.wav 0 4096 \n", argv[0]);
    return err;
  }

#if __APPLE__
  uint_t samplerate = 0;
  uint_t hop_size = 256;
  uint_t n_frames = 0, read = 0;
  if ( argc == 3 ) samplerate = atoi(argv[2]);
  if ( argc == 4 ) hop_size = atoi(argv[3]);

  char_t *source_path = argv[1];


  aubio_source_apple_audio_t * s =
    new_aubio_source_apple_audio(source_path, samplerate, hop_size);
  if (!s) { err = 1; goto beach; }
  fvec_t *vec = new_fvec(hop_size);

  if (samplerate == 0 ) samplerate = aubio_source_apple_audio_get_samplerate(s);

  do {
    aubio_source_apple_audio_do(s, vec, &read);
    fvec_print (vec);
    n_frames += read;
  } while ( read == hop_size );

  PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate,
    n_frames / hop_size, source_path);

  del_fvec (vec);
  del_aubio_source_apple_audio (s);
beach:
#else
  err = 3;
  PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
#endif /* __APPLE__ */
  return 0;
}
开发者ID:iKala,项目名称:aubio,代码行数:53,代码来源:test-source_apple_audio.c


示例13: sem_chmod

static int
sem_chmod (int sem, char *worker_uid)
{
	int              i;
	int              re;
	struct semid_ds  buf;
	union  semun     semopts;
	struct passwd   *passwd;
	int              uid     = 0;

	/* Read the UID
	 */
	uid = (int)strtol (worker_uid, (char **)NULL, 10);
	if (uid == 0) {
		passwd = getpwnam (worker_uid);
		if (passwd != NULL) {
			uid = passwd->pw_uid;
		}
	}

	if (uid == 0) {
		PRINT_MSG ("(warning) Couldn't get UID for user '%s'\n", worker_uid);
		return -1;
	}

	/* Initialize the memory
	 */
	memset (&buf,     0, sizeof(struct semid_ds));
	memset (&semopts, 0, sizeof(union  semun));

	semopts.buf = &buf;

	/* Set the permissions
	 */
	for (i=0; i<SEM_LAUNCH_TOTAL; i++) {
		re = semctl (sem, i, IPC_STAT, semopts);
		if (re != -0) {
			PRINT_MSG ("(warning) Couldn't IPC_STAT: errno=%d\n", errno);
			return -1;
		}

		buf.sem_perm.uid = uid;
		re = semctl (spawn_shared_sems, i, IPC_SET, semopts);
		if (re != 0) {
			PRINT_MSG ("(warning) Couldn't IPC_SET: uid=%d errno=%d\n", uid, errno);
			return -1;
		}
	}

	return 0;
}
开发者ID:adriano-io,项目名称:webserver,代码行数:51,代码来源:main.c


示例14: PRINT_MSG

// --------------------------------------------------------------------------
//  Second phase of the two-phased constructor.
//  Creates an instance of encoder
// --------------------------------------------------------------------------
//
void CAriAmrNbEncMmfCodec::ConstructL()
    {
    PRINT_ENTRY;
    iCodec = CAriAmrNbEncWrapper::NewL();

    iInternalInputBuffer = ( TUint8* ) User::AllocZL( KMinBytesInput );
    iInternalOutputBuffer = ( TUint8* ) User::AllocZL( KMinDstLen );

    PRINT_MSG( LEVEL_HIGH, ( "Default mode: %d", iParam.iMode ) );
    PRINT_MSG( LEVEL_HIGH, ( "Default DTX: %d", iParam.iDtx ) );
    //Reset encoder with default parameters
    User::LeaveIfError( iCodec->Reset( &iParam ) );
    PRINT_EXIT;
    }
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:19,代码来源:ariamrnbencmmfcodec.cpp


示例15: zarlinkCaculateDevObj

int zarlinkCaculateDevObj(RTKDevType dev_type)
{
	int fxs_dev;
	int fxo_dev;
	int fxsfxo_dev;
	int fxsfxs_dev=0;
	int total_dev;

	if (DEV_FXS==dev_type) //display once
		PRINT_MSG("Total %d lines. %d fxs and %d fxo from Global configuration\n",
			ZARLINK_SLIC_CH_NUM, ZARLINK_FXS_LINE_NUM, ZARLINK_FXO_LINE_NUM);

	/* Use minimum number of device	to caculate possible combination */
	fxsfxo_dev = MIN(ZARLINK_FXS_LINE_NUM, ZARLINK_FXO_LINE_NUM);/* FXS+FXO dev */
#if defined (CONFIG_RTK_VOIP_SLIC_ZARLINK_880_SERIES)
	fxsfxs_dev = (ZARLINK_FXS_LINE_NUM - fxsfxo_dev) >> 1;	 	 /* FXS+FXS dev */ 
#endif
	fxs_dev = ZARLINK_FXS_LINE_NUM - fxsfxo_dev - 2*fxsfxs_dev;  /* FXS device  */
	fxo_dev	= ZARLINK_FXO_LINE_NUM - fxsfxo_dev; 				 /* FXO device  */

	total_dev = fxs_dev+fxsfxs_dev+fxo_dev+fxsfxo_dev;

	if (DEV_FXS==dev_type) //display once
		PRINT_MSG("Total %d devices\tFXS:%d, FXS+FXS:%d, FXS+FXO:%d, FXO:%d\n",
			total_dev, fxs_dev, fxsfxs_dev, fxsfxo_dev, fxo_dev );

	if (ZARLINK_SLIC_DEV_NUM < total_dev) {
		PRINT_R("error : %s() Not enough space for chObj\n",__FUNCTION__);
		return FAILED;
	}

	switch (dev_type) {
		case DEV_FXS:
			return fxs_dev;			
			break;
		case DEV_FXO:
			return fxo_dev;			
			break;
		case DEV_FXSFXS:
			return fxsfxs_dev;			
			break;
		case DEV_FXSFXO:
			return fxsfxo_dev;			
			break;
		default:
			return 0;
			break;
	}
	return 0;
}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:50,代码来源:zarlinkCommonInit.c


示例16: mesh_validate_customdata

static bool mesh_validate_customdata(
        CustomData *data, CustomDataMask mask,
        const bool do_verbose, const bool do_fixes,
        bool *r_change)
{
	bool is_valid = true;
	bool has_fixes = false;
	int i = 0;

	PRINT_MSG("%s: Checking %d CD layers...\n", __func__, data->totlayer);

	while (i < data->totlayer) {
		CustomDataLayer *layer = &data->layers[i];
		bool ok = true;

		if (CustomData_layertype_is_singleton(layer->type)) {
			const int layer_tot = CustomData_number_of_layers(data, layer->type);
			if (layer_tot > 1) {
				PRINT_ERR("\tCustomDataLayer type %d is a singleton, found %d in Mesh structure\n",
				          layer->type, layer_tot);
				ok = false;
			}
		}

		if (mask != 0) {
			CustomDataMask layer_typemask = CD_TYPE_AS_MASK(layer->type);
			if ((layer_typemask & mask) == 0) {
				PRINT_ERR("\tCustomDataLayer type %d which isn't in the mask\n",
				          layer->type);
				ok = false;
			}
		}

		if (ok == false) {
			if (do_fixes) {
				CustomData_free_layer(data, layer->type, 0, i);
				has_fixes = true;
			}
		}

		if (ok)
			i++;
	}

	PRINT_MSG("%s: Finished (is_valid=%d)\n\n", __func__, (int)!has_fixes);

	*r_change = has_fixes;

	return is_valid;
}
开发者ID:wchargin,项目名称:blender,代码行数:50,代码来源:mesh_validate.c


示例17: free_blocks_status

/*
 * free_blocks_status () only shows the status
 * of the free blocks
 */
void free_blocks_status (char *block_ptr){
  int i, j;
  block_header_t *b;

  TLSF_t *ptr_TLSF;
  
  ptr_TLSF = (TLSF_t *) block_ptr; 
  if (!ptr_TLSF || ptr_TLSF -> magic_number != MAGIC_NUMBER) {
    PRINT_MSG 
      ("free_blocks_status() error: TLSF structure is not initialized\n");
    PRINT_MSG 
      ("Hint: Execute init_memory_pool() before calling free_blocks_status()");

    return;
  }

  PRINT_DBG_C ("\nTLSF structure address 0x");
  PRINT_DBG_H (ptr_TLSF);
  PRINT_DBG_C ("\nFREE BLOCKS\n\n");
  for (i = ptr_TLSF -> max_fl_index  - 1 - MIN_LOG2_SIZE; i >= 0; i--) {
    if (ptr_TLSF -> fl_array [i].bitmapSL > 0)
      for (j = ptr_TLSF -> max_sl_index - 1; j >= 0; j--) {
        if (ptr_TLSF -> fl_array [i].sl_array[j]) {
          b = ptr_TLSF -> fl_array [i].sl_array [j];
          PRINT_DBG_C ("[");
          PRINT_DBG_D (i + MIN_LOG2_SIZE);
          PRINT_DBG_C ("] ");
          PRINT_DBG_D (TLSF_WORDS2BYTES(1 << (i + MIN_LOG2_SIZE)));
	  PRINT_DBG_C (" bytes -> Free blocks: 0x");
	  PRINT_DBG_H (ptr_TLSF -> fl_array [i].bitmapSL);
          PRINT_DBG_C ("\n");
	  
          while (b) {
	    PRINT_DBG_C (">>>> First_Level [");
	    PRINT_DBG_D (i + MIN_LOG2_SIZE);
	    PRINT_DBG_C ("] Second Level [");
	    PRINT_DBG_D (j);
	    PRINT_DBG_C ("] -> ");
	    PRINT_DBG_D (TLSF_WORDS2BYTES((1 << (i + MIN_LOG2_SIZE)) + 
			  ( ((1 << (i + MIN_LOG2_SIZE)) / 
			     ptr_TLSF -> max_sl_index) * j)));

            PRINT_DBG_C (" bytes\n");
            print_block (b);
            b = b -> ptr.free_ptr.next;
          }
        }
      }
  }
}
开发者ID:akshar100,项目名称:SPaRK_x86,代码行数:54,代码来源:TLSF_debug_functions.c


示例18: sort_queue

static gboolean
sort_queue (gpointer user_data)
{
  static gint     sorts = 0;
  static gpointer last_p = NULL;
  gpointer        p;
  gboolean        can_quit = FALSE;
  gint            sort_multiplier;
  gint            len;
  gint            i;

  sort_multiplier = GPOINTER_TO_INT (user_data);

  if (SORT_QUEUE_AFTER) {
    PRINT_MSG (("sorting async queue...")); 
    g_async_queue_sort (async_queue, sort_compare, NULL);

    sorts++;

    if (sorts >= sort_multiplier) {
      can_quit = TRUE;
    }
    
    g_async_queue_sort (async_queue, sort_compare, NULL);
    len = g_async_queue_length (async_queue);

    PRINT_MSG (("sorted queue (for %d/%d times, size:%d)...", sorts, MAX_SORTS, len)); 
  } else {
    can_quit = TRUE;
    len = g_async_queue_length (async_queue);
    DEBUG_MSG (("printing queue (size:%d)...", len)); 
  }

  for (i = 0, last_p = NULL; i < len; i++) {
    p = g_async_queue_pop (async_queue);
    DEBUG_MSG (("item %d ---> %d", i, GPOINTER_TO_INT (p))); 

    if (last_p) {
      g_assert (GPOINTER_TO_INT (last_p) <= GPOINTER_TO_INT (p));
    }

    last_p = p;
  }
  
  if (can_quit && QUIT_WHEN_DONE) {
    g_main_loop_quit (main_loop);
  }

  return !can_quit;
}
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:50,代码来源:asyncqueue-test.c


示例19: process_wait

static ret_t
process_wait (pid_t wpid)
{
	pid_t re;
	int   exitcode = 0;

	while (true) {
		re = waitpid (wpid, &exitcode, 0);
		if (re > 0)
			break;
		else if (errno == EINTR)
			if (graceful_restart)
				break;
			else
				continue;
		else if (errno == ECHILD) {
			return ret_ok;
		} else {
			return ret_error;
		}
	}

	if (WIFEXITED(exitcode)) {
		int re = WEXITSTATUS(exitcode);

		if (wpid == pid && re == EXIT_OK_ONCE) {
			clean_up();
			exit (EXIT_OK);

		} else if (wpid == pid && re == EXIT_ERROR_FATAL) {
			clean_up();
			exit (EXIT_ERROR);
		}

		/* Child terminated normally */
		PRINT_MSG ("PID %d: exited re=%d\n", wpid, re);
		if (re != 0 && wpid == pid) {
			worker_retcode = re;
			return ret_error;
		}
	}
	else if (WIFSIGNALED(exitcode)) {
		/* Child process terminated by a signal */
		PRINT_MSG ("PID %d: received a signal=%d\n", wpid, WTERMSIG(exitcode));
	}

	worker_retcode = 0;
	return ret_ok;
}
开发者ID:adriano-io,项目名称:webserver,代码行数:49,代码来源:main.c


示例20: check_pos

/**
 * Prueft eine Dateiposition auf Gueltigkeit
 * \param *file		Zeiger auf Datei-Deskriptor
 * \param pos		Zu ueberpruefende Position (in Bloecken)
 */
static int8_t check_pos(botfs_file_descr_t * file, uint16_t pos) {
	if (pos > file->start && pos <= file->end) {
		return 0;
	}
	PRINT_MSG("check_pos(): start=0x%x, end=0x%x, pos=0x%x", file->start, file->end, pos);
	return -1;
}
开发者ID:lenchen-88,项目名称:ct-bot,代码行数:12,代码来源:botfs.c



注:本文中的PRINT_MSG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PRINT_REG函数代码示例发布时间:2022-05-30
下一篇:
C++ PRINT_LOG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap