本文整理汇总了C++中read_info函数的典型用法代码示例。如果您正苦于以下问题:C++ read_info函数的具体用法?C++ read_info怎么用?C++ read_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了read_info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: music_info_init
/*----------------------------------------------------------------------------*/
void music_info_init(void)
{
#ifdef USB_SD_DECODE_DEFAULT_REP_OFF
play_mode=REPEAT_OFF;
#else
play_mode = read_info(MEM_PLAY_MODE);
if (play_mode > REPEAT_RANDOM)
{
play_mode = REPEAT_ALL;
}
#endif
if (given_device == 0) //设备启动时,given_device为0;
{
given_device = read_info(MEM_ACTIVE_DEV);
if ((given_device != 0x01) && (given_device != 0x02))
{
given_device = 0x01;
given_file_number = 1;
}
}
eq_mode = read_info(MEM_EQ_MODE);
if (eq_mode > CLASSIC)
{
eq_mode = NORMAL;
}
}
开发者ID:goshafreelock,项目名称:sc-cd-pro,代码行数:28,代码来源:mp3mode.c
示例2: request_usr
int request_usr(simple_person ** arr, int * size, int id,char * conect, tOPC opc)
{
char opOK=0,qty_people=0;
int full_size;
clsvbuff buff;
initConnection(TYPE_MSG_Q);
buff.opc=opc;
buff.id_client=id;
write_info(&buff);
read_info(&opOK,sizeof(char),buff.id_client);
if(opOK==NOTOK)
{
return NOTOK;
}
read_info((char*)&qty_people,sizeof(char),buff.id_client);
*size=qty_people;
full_size=sizeof(simple_person) * (*size);
if(full_size>0)
{
*arr=malloc(full_size);
if(*arr==NULL)
return NOTOK;
read_info((char*) (*arr),full_size,buff.id_client);
}
return OK;
}
开发者ID:lkania,项目名称:finder,代码行数:31,代码来源:c_queue.c
示例3: read_radio_freq
u16 read_radio_freq(u8 ch)
{
xd_u16 freq_reg=0;
freq_reg = read_info(ch+1);
freq_reg=freq_reg<<8;
freq_reg |= read_info(ch);
return freq_reg;
}
开发者ID:goshafreelock,项目名称:sc-cd-pro,代码行数:10,代码来源:fm_receive_api.c
示例4: read_radio_freq
u16 read_radio_freq(u8 ch)
{
xd_u16 freq_reg=0;
ch=ch<<1;
freq_reg = read_info(MEM_FM_CHANNL +ch+1);
freq_reg=freq_reg<<8;
freq_reg |= read_info(MEM_FM_CHANNL +ch);
return freq_reg;
}
开发者ID:go2net,项目名称:kt-rec-pro,代码行数:11,代码来源:radio_api.c
示例5: restore_music_point
/*----------------------------------------------------------------------------*/
void restore_music_point(void)
{
u8 i;
for (i = 0;i<10;i++)
{
((u8 *)(&(disk_mus_point[0].id0)))[i] = read_info(MEM_SD_PLAYPOINT_ID0+i);
}
for (i = 0;i<10;i++)
{
((u8 *)(&(disk_mus_point[1].id0)))[i] = read_info(MEM_USB_PLAYPOINT_ID0+i);
}
}
开发者ID:BGCX261,项目名称:zhengao-dsa-pro-svn-to-git,代码行数:14,代码来源:music.c
示例6: print_list_rest
void
print_list_rest (FILE * in)
{
char stringBuf[1024];
GList *ac = NULL;
GList *list = read_info (in);
list = g_list_sort (list, CompareAccountByUsername);
printf (" USER REASON PERIOD LEVEL TIME LEFT(s)\n");
for (ac = g_list_first (list); ac != NULL; ac = g_list_next (ac))
{
Account *_ac = (Account *) ac->data;
if (_ac->info.field_restrict != NO_PERIOD)
{
//printf( " %-16s %-6s %-6s %c %-4d\n",
printf (" %-16s %-6s %-6s %c %d\n", _ac->id, //name
read_restrict_reason (_ac), //reason
read_restrict_reriod (_ac), //period
get_restrict_level (_ac->restricted), //level
get_time_to_end (_ac) //time left
);
}
free (_ac->id);
free (_ac);
}
g_list_free (list);
}
开发者ID:cloudlinuxadmin,项目名称:mysql-governor,代码行数:29,代码来源:dbctl_list.c
示例7: main
int main()
{
char service_name[256];
printf("Input service name you want to connect:\n");
fgets(service_name, sizeof(service_name), stdin);
if (service_name[strlen(service_name) - 1] == '\n')
service_name[strlen(service_name) - 1] = '\0';
if (!connect_to_service(service_name)) {
fprintf(stderr, "connect_to_service failed\n");
exit(EXIT_FAILURE);
}
if (!read_info()) {
fprintf(stderr, "read_info failed\n");
exit(EXIT_FAILURE);
}
if (socketfd != -1) {
close(socketfd);
}
exit(EXIT_SUCCESS);
}
开发者ID:demon90s,项目名称:LearnLinux,代码行数:25,代码来源:connect_sys_service.c
示例8: main
int
main(int argc, char *argv[])
{
char *p;
size_t len;
Subrange *r;
int (*fn)(Rune **r0, Rune **r1, Rune **r2, Rune **r3);
p = strrchr(argv[0], '/');
p = p? p+1 : argv[0];
switch (*p) {
case 'c' : fn = fn_c; break;
case 'i' : fn = fn_i; break;
case 'd' : fn = fn_d; break;
case 'a' : fn = fn_a; break;
default:
fprintf(stderr,"Uknown program name!\n");
exit(1);
}
if (*p != 'd') {
if (argc < 2) {
fprintf(stderr,"%c: need text argument\n", *p);
exit(1);
}
argtorune(argv[1]);
}
read_info(0); /* don't reverse ranges */
do_changes(fn);
list_changes();
exit(0);
}
开发者ID:knusbaum,项目名称:Wily,代码行数:31,代码来源:c.c
示例9: get_connections_complete
static void get_connections_complete(int sk, void *buf, size_t len)
{
struct mgmt_rp_get_connections *rp = buf;
struct controller_info *info;
uint16_t index;
int i;
if (len < sizeof(*rp)) {
error("Too small get_connections complete event");
return;
}
if (len < (sizeof(*rp) + (rp->conn_count * sizeof(bdaddr_t)))) {
error("Too small get_connections complete event");
return;
}
index = btohs(bt_get_unaligned(&rp->index));
if (index > max_index) {
error("Unexpected index %u in get_connections complete",
index);
return;
}
info = &controllers[index];
for (i = 0; i < rp->conn_count; i++) {
bdaddr_t *bdaddr = g_memdup(&rp->conn[i], sizeof(bdaddr_t));
info->connections = g_slist_append(info->connections, bdaddr);
}
read_info(sk, index);
}
开发者ID:heinervdm,项目名称:bluez,代码行数:34,代码来源:mgmtops.c
示例10: music_info_init
/*----------------------------------------------------------------------------*/
void music_info_init(void)
{
#ifdef NO_REM_LAST_DEV
given_device = NO_DEVICE;
#else
given_device = read_info(MEM_ACTIVE_DEV);
#endif
if (given_device == DEVICE_SDMMC0)
{
Set_Curr_Func(SYS_MP3DECODE_SD);
given_file_method = PLAY_FIRST_FILE;
given_device = DEVICE_SDMMC0;
put_msg_lifo(MSG_MUSIC_SELECT_NEW_DEVICE);
}
else if (given_device == DEVICE_UDISK)
{
Set_Curr_Func(SYS_MP3DECODE_USB);
given_file_method = PLAY_FIRST_FILE;
given_device = DEVICE_UDISK;
put_msg_lifo(MSG_MUSIC_SELECT_NEW_DEVICE);
}
else
{
Set_Curr_Func(SYS_MP3DECODE_USB);
given_file_method = PLAY_FIRST_FILE;
given_device = DEVICE_UDISK;
put_msg_lifo(MSG_MUSIC_SELECT_NEW_DEVICE);
}
}
开发者ID:BGCX261,项目名称:zhengao-dsa-pro-svn-to-git,代码行数:31,代码来源:music.c
示例11: open_index
int IndexFile::open_index(Asset *asset)
{
// use buffer if being built
this->asset = asset;
int result = 0;
if(asset->index_status == INDEX_BUILDING)
{
// use buffer
result = 0;
}
else
if(!(result = open_file()))
{
// opened existing file
if(read_info())
{
result = 1;
close_index();
}
else
{
asset->index_status = INDEX_READY;
}
}
else
{
result = 1;
}
return result;
}
开发者ID:beequ7et,项目名称:cinelerra-cv,代码行数:32,代码来源:indexfile.C
示例12: GNUNET_PSEUDONYM_add
/**
* Add a pseudonym to the set of known pseudonyms.
* For all pseudonym advertisements that we discover
* FS should automatically call this function.
*
* @param cfg overall configuration
* @param id the pseudonym identifier
* @param meta metadata for the pseudonym
*/
void
GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
const struct GNUNET_HashCode * id,
const struct GNUNET_CONTAINER_MetaData *meta)
{
char *name;
int32_t ranking;
struct GNUNET_CONTAINER_MetaData *old;
char *fn;
struct stat sbuf;
ranking = 0;
fn = get_data_filename (cfg, PS_METADATA_DIR, id);
GNUNET_assert (fn != NULL);
if ((0 == STAT (fn, &sbuf)) &&
(GNUNET_OK == read_info (cfg, id, &old, &ranking, &name)))
{
GNUNET_CONTAINER_meta_data_merge (old, meta);
write_pseudonym_info (cfg, id, old, ranking, name);
GNUNET_CONTAINER_meta_data_destroy (old);
GNUNET_free_non_null (name);
}
else
{
write_pseudonym_info (cfg, id, meta, ranking, NULL);
}
GNUNET_free (fn);
internal_notify (id, meta, ranking);
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:39,代码来源:pseudonym.c
示例13: do_info
int
do_info(const char *const *argv)
{
const char *thisarg;
struct partinfo *pi, ps;
struct dpkg_ar *part;
if (!*argv)
badusage(_("--%s requires one or more part file arguments"),
cipaction->olong);
while ((thisarg= *argv++)) {
part = dpkg_ar_open(thisarg);
if (!part)
ohshite(_("cannot open archive part file '%.250s'"), thisarg);
pi = read_info(part, &ps);
dpkg_ar_close(part);
if (pi) {
print_info(pi);
} else {
printf(_("file '%s' is not an archive part\n"), thisarg);
}
m_output(stdout, _("<standard output>"));
}
return 0;
}
开发者ID:CharizTeam,项目名称:dpkg,代码行数:27,代码来源:info.c
示例14: lock
bool Channel::read_tile_or_closest_ancestor(TileIndex ti, TileIndex &ret_index, Tile &ret) const {
Locker lock(*this); // Lock self and hold lock until exiting this method
ChannelInfo info;
bool success = read_info(info);
if (!success) {
if (verbosity) log_f("read_tile_or_closest_ancestor: can't read info");
return false;
}
TileIndex root = info.nonnegative_root_tile_index;
if (ti.is_ancestor_of(root)) {
ret_index = root;
} else {
if (ti != root && !root.is_ancestor_of(ti)) {
// Tile isn't under root
return false;
}
assert(tile_exists(root));
ret_index = root;
while (ret_index != ti) {
TileIndex child = ti.start_time() < ret_index.left_child().end_time() ? ret_index.left_child() : ret_index.right_child();
if (!tile_exists(child)) break;
ret_index = child;
}
}
// ret_index now holds closest ancestor to ti (or ti itself if it exists)
assert(read_tile(ret_index, ret));
return true;
}
开发者ID:TannerTaphorn,项目名称:datastore,代码行数:31,代码来源:Channel.cpp
示例15: sys_info_init
/*----------------------------------------------------------------------------*/
static void sys_info_init(void)
{
//u8 vol_tmp;
#if 1
sys_main_vol = read_info(MEM_SYS_VOL);
if ((sys_main_vol > MAX_MAIN_VOL) || (sys_main_vol == 0)) //每次开机时,不要超过最大音量的一半,以免开机音量过大
{
sys_main_vol = 20;
}
#endif
dac_init(sys_main_vol);
delay_10ms(50); //等待,检测USB,SD在线状态
//init_rec_name();
//restore_music_point();
#if 0
#if RTC_ENABLE
if (work_mode != RTC_MODE)
#endif
{
device_check();
#if USB_DEVICE_ENABLE
if (pc_connect)
work_mode = USB_DEVICE_MODE;
else if (udisk_connect || sdmmc_connect)
work_mode = MUSIC_MODE;
#else
// if (udisk_connect || sdmmc_connect)
// work_mode = MUSIC_MODE;
#endif
}
#endif
}
开发者ID:go2net,项目名称:kt-rec-pro,代码行数:36,代码来源:main.c
示例16: enter_fm_rev
/*----------------------------------------------------------------------------*/
void enter_fm_rev(void)
{
u8 i;
all_channl = read_info(MEM_ALL_CHANNL);
if (all_channl > MAX_CHANNL)
{
all_channl = MAX_CHANNL;
}
for (i = 0;i<all_channl;i++)
{
fre_point[i] = read_info(MEM_CHANNL+i);
#ifdef UART_ENABLE_FM
printf(" ----FM read station from ROM %4u \r\n",(u16)(fre_point[i]+MIN_FRE));
#endif
}
fre_channl = read_info(MEM_FRE_CHANNL);//MEM_FRE
if (fre_channl > all_channl)
{
fre_channl = 1;
}
else if (!fre_channl)
{
fre_channl = 1;
}
frequency = read_info(MEM_FRE)+MIN_FRE;
if ( frequency > MAX_FRE)
{
frequency = MIN_FRE;
}
else if (frequency < MIN_FRE)
{
frequency = MIN_FRE;
}
#if defined(K738_LHD_LTB1_V001)||defined(K740_LHD_916_V001)
frequency = 880;
#endif
#if defined(CUSTOM_RADIO_FREQ_875)
frequency = 875;
#endif
}
开发者ID:goshafreelock,项目名称:project-common-pro,代码行数:47,代码来源:fm_receive.c
示例17: mustgetpartinfo
void mustgetpartinfo(const char *filename, struct partinfo *ri) {
FILE *part;
part= fopen(filename,"r");
if (!part) ohshite(_("cannot open archive part file `%.250s'"),filename);
if (!read_info(part,filename,ri))
ohshite(_("file `%.250s' is not an archive part"),filename);
fclose(part);
}
开发者ID:nisc-code,项目名称:dpkg,代码行数:9,代码来源:info.c
示例18: close
/** Try to open project /name/. Returns 0 if sucsessful, an error code
* otherwise */
int
Project::open ( const char *name )
{
if ( ! validate( name ) )
return E_INVALID;
close();
chdir( name );
if ( ! acquire_lock( &_lockfd, ".lock" ) )
return E_LOCKED;
int version;
char *creation_date;
char *created_by;
if ( ! read_info( &version, &creation_date, &created_by ) )
return E_INVALID;
if ( strncmp( created_by, APP_TITLE, strlen( APP_TITLE ) ) )
return E_INVALID;
if ( version != PROJECT_VERSION )
return E_VERSION;
_is_opening = true;
if ( ! Loggable::replay( "snapshot" ) )
return E_INVALID;
if ( creation_date )
{
strcpy( _created_on, creation_date );
free( creation_date );
}
else
*_created_on = 0;
getcwd( _path, sizeof( _path ) );
set_name( _path );
_is_open = true;
_is_opening = false;
// tle->load_timeline_settings();
// timeline->zoom_fit();
// Loggable::clear_dirty();
MESSAGE( "Loaded project \"%s\"", name );
return 0;
}
开发者ID:0mk,项目名称:non,代码行数:59,代码来源:Project.C
示例19: read_info
void read_info(typename Ptree::BOOST_NESTED_TEMPLATE for_char<Ch>::basic_istream &stream, Ptree &pt,
const Ptree &default_ptree)
{
try {
read_info(stream, pt);
} catch(file_parser_error &) {
pt = default_ptree;
}
}
开发者ID:Masstronaut,项目名称:phantom-cpp,代码行数:9,代码来源:info_parser.hpp
示例20: read_info
void read_info(std::basic_istream<Ch> &stream, Ptree &pt,
const Ptree &default_ptree)
{
try {
read_info(stream, pt);
} catch(file_parser_error &) {
pt = default_ptree;
}
}
开发者ID:alistairwalsh,项目名称:LSL-gazzlab-branch,代码行数:9,代码来源:info_parser.hpp
注:本文中的read_info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论