这篇教程C++ strn0cpy函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中strn0cpy函数的典型用法代码示例。如果您正苦于以下问题:C++ strn0cpy函数的具体用法?C++ strn0cpy怎么用?C++ strn0cpy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了strn0cpy函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: strn0cpyvoid Client::SetTitleSuffix(const char *Suffix){ strn0cpy(m_pp.suffix, Suffix, sizeof(m_pp.suffix)); EQApplicationPacket *outapp = new EQApplicationPacket(OP_SetTitleReply, sizeof(SetTitleReply_Struct)); SetTitleReply_Struct *strs = (SetTitleReply_Struct *)outapp->pBuffer; strs->is_suffix = 1; strn0cpy(strs->title, Suffix, sizeof(strs->title)); strs->entity_id = GetID(); entity_list.QueueClients(this, outapp, false); safe_delete(outapp);}
开发者ID:Vaion,项目名称:Server,代码行数:18,
示例2: strn0cpybool cPluginPictures::SetupParse(const char *Name, const char *Value){ // Parse your own setup parameters and store their values. if (!strcasecmp(Name, "PictureDirectory")) strn0cpy(PictureDirectory, Value, sizeof(PictureDirectory)); else if (!strcasecmp(Name, "SlideShowDelay")) SlideShowDelay = atoi(Value); else return false; return true;}
开发者ID:backtrack2016,项目名称:tdt,代码行数:9,
示例3: NPCHorse::Horse(Client *_owner, uint16 spell_id, const glm::vec4& position) : NPC(GetHorseType(spell_id), nullptr, position, FlyMode3){ //give the horse its proper name. strn0cpy(name, _owner->GetCleanName(), 55); strcat(name,"`s_Mount00"); owner = _owner;}
开发者ID:jcon321,项目名称:Server,代码行数:9,
示例4: MakeLowerStringbool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { BootingUp = false; const char* zn = MakeLowerString(database.GetZoneName(iZoneID)); char* longname; if (iZoneID) zlog(WORLD__ZONE,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, iStaticZone ? " (Static)" : ""); zoneID = iZoneID; instanceID = iInstanceID; if(iZoneID!=0) oldZoneID = iZoneID; if (zoneID == 0) { client_list.CLERemoveZSRef(this); pNumPlayers = 0; LSSleepUpdate(GetPrevZoneID()); } staticzone = iStaticZone; if (zn) { strn0cpy(zone_name, zn, sizeof(zone_name)); if( database.GetZoneLongName( (char*)zone_name, &longname, NULL, NULL, NULL, NULL, NULL, NULL ) ) { strn0cpy(long_name, longname, sizeof(long_name)); safe_delete_array( longname ); } else strcpy(long_name, ""); } else { strcpy(zone_name, ""); strcpy(long_name, ""); } client_list.ZoneBootup(this); ls_zboot.Start(); return true;}
开发者ID:Vaion,项目名称:Server,代码行数:44,
示例5: GroupIDConsumerRaid::Raid(Client* nLeader): GroupIDConsumer(){ memset(members ,0, (sizeof(RaidMember)*MAX_RAID_MEMBERS)); leader = nLeader; memset(leadername, 0, 64); strn0cpy(leadername, nLeader->GetName(), 64); locked = false; LootType = 4;}
开发者ID:Derision,项目名称:Server,代码行数:10,
示例6: ServerPacketvoid LauncherLink::StopZone(const char *short_name) { ServerPacket* pack = new ServerPacket(ServerOP_LauncherZoneRequest, sizeof(LauncherZoneRequest)); LauncherZoneRequest* s = (LauncherZoneRequest *) pack->pBuffer; strn0cpy(s->short_name, short_name, 32); s->command = ZR_Stop; SendPacket(pack); delete pack;}
开发者ID:Leere,项目名称:Server,代码行数:10,
示例7: returnbool BaseGuildManager::GetGuildURL(uint32 GuildID, char *URLBuffer) const{ std::map<uint32, GuildInfo *>::const_iterator res; res = m_guilds.find(GuildID); if(res == m_guilds.end()) return(false); strn0cpy(URLBuffer, res->second->url.c_str(), 512); return(true);}
开发者ID:Corysia,项目名称:Server,代码行数:10,
示例8: EQApplicationPacketvoid Raid::SendGroupUpdate(Client *to){ if(!to) return; EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate,sizeof(GroupUpdate2_Struct)); GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer; gu->action = groupActUpdate; int index = 0; uint32 grp = GetGroup(to->GetName()); if(grp > 11) { safe_delete(outapp); return; } for(int x = 0; x < MAX_RAID_MEMBERS; x++) { if(members[x].GroupNumber == grp && strlen(members[x].membername) > 0) { if(members[x].IsGroupLeader){ strn0cpy(gu->leadersname, members[x].membername, 64); if(strcmp(to->GetName(), members[x].membername) != 0){ strn0cpy(gu->membername[index], members[x].membername, 64); index++; } } else{ if(strcmp(to->GetName(), members[x].membername) != 0){ strn0cpy(gu->membername[index], members[x].membername, 64); index++; } } } } if(strlen(gu->leadersname) < 1){ strn0cpy(gu->leadersname, to->GetName(), 64); } strn0cpy(gu->yourname, to->GetName(), 64); memcpy(&gu->leader_aas, &group_aa[grp], sizeof(GroupLeadershipAA_Struct)); to->FastQueuePacket(&outapp);}
开发者ID:surlyone,项目名称:Server,代码行数:42,
示例9: ServerPacketvoid WorldServer::SendStatus(const char *short_name, uint32 start_count, bool running) { ServerPacket* pack = new ServerPacket(ServerOP_LauncherZoneStatus, sizeof(LauncherZoneStatus)); LauncherZoneStatus* it =(LauncherZoneStatus*) pack->pBuffer; strn0cpy(it->short_name, short_name, 32); it->start_count = start_count; it->running = running?1:0; SendPacket(pack); safe_delete(pack);}
开发者ID:RicardoCampos,项目名称:Server,代码行数:11,
示例10: strn0cpyEncounter::Encounter(const char* enc_name) :Mob ( nullptr, nullptr, 0, 0, 0, INVISIBLE_MAN, 0, BT_NoTarget, 0, 0, 0, 0, 0, glm::vec4(0,0,0,0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EQEmu::TintProfile(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ){ encounter_name[0] = 0; strn0cpy(encounter_name, enc_name, 64); remove_me = false;}
开发者ID:Exovane,项目名称:Server,代码行数:11,
示例11: printfvoid Raid::SetRaidLeader(const char *wasLead, const char *name){ char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; MYSQL_RES *result; if (!database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET israidleader=0 WHERE name='%s'", wasLead),errbuf,&result)){ printf("Set Raid Leader error: %s/n", errbuf); } else mysql_free_result(result); safe_delete_array(query); query = 0; if (!database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET israidleader=1 WHERE name='%s'", name),errbuf,&result)){ printf("Set Raid Leader error: %s/n", errbuf); } else mysql_free_result(result); safe_delete_array(query); strn0cpy(leadername, name, 64); Client *c = entity_list.GetClientByName(name); if(c) SetLeader(c); LearnMembers(); VerifyRaid(); SendMakeLeaderPacket(name); ServerPacket *pack = new ServerPacket(ServerOP_RaidLeader, sizeof(ServerRaidGeneralAction_Struct)); ServerRaidGeneralAction_Struct *rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; rga->rid = GetID(); strn0cpy(rga->playername, name, 64); rga->zoneid = zone->GetZoneID(); rga->instance_id = zone->GetInstanceID(); worldserver.SendPacket(pack); safe_delete(pack);}
开发者ID:Derision,项目名称:Server,代码行数:41,
示例12: Reallocvoid cComponents::SetComponent(int Index, uchar Stream, uchar Type, const char *Language, const char *Description){ Realloc(Index); tComponent *p = &components[Index]; p->stream = Stream; p->type = Type; strn0cpy(p->language, Language, sizeof(p->language)); char *q = strchr(p->language, ','); if (q) *q = 0; // strips rest of "normalized" language codes p->description = strcpyrealloc(p->description, !isempty(Description) ? Description : NULL);}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:12,
示例13: Clearvoid cMenuBrowseFiles::Set(void){ Clear(); if (!*m_CurrentDir) m_CurrentDir = m_ConfigLastDir; int RootDirLen = strlen(xc.media_root_dir); if (strncmp(m_CurrentDir, xc.media_root_dir, RootDirLen)) { LOGMSG("Not allowing browsing to %s (root is %s)", *m_CurrentDir, xc.media_root_dir); m_CurrentDir = xc.media_root_dir; } if (m_CurrentDir[0] != '/') {#if defined(APIVERSNUM) && (APIVERSNUM < 20102) m_CurrentDir = VideoDirectory;#else m_CurrentDir = cVideoDirectory::Name();#endif } // find deepest accessible directory from path while (!ScanDir(m_CurrentDir) && strlen(m_CurrentDir) > 1) { m_CurrentDir = ParentDir(m_CurrentDir); } // add link to parent folder int CurrentDirLen = strlen(m_CurrentDir); if (CurrentDirLen > 1 && CurrentDirLen > RootDirLen) Add(new cFileListItem("..",true)); Sort(); SetCurrent(Get(Count()>1 && CurrentDirLen>1 ? 1 : 0)); // select last selected item cString lastParent = ParentDir(m_ConfigLastDir); if (!strncmp(m_CurrentDir, lastParent, CurrentDirLen)) { cString item = LastDir(m_ConfigLastDir); if (*item) { for (cFileListItem *it = (cFileListItem*)First(); it; it = (cFileListItem*)Next(it)) if (!strcmp(it->Name(), item)) SetCurrent(it); } } strn0cpy(m_ConfigLastDir, m_CurrentDir, sizeof(xc.browse_files_dir)); StoreConfig(); SetHelpButtons(); Display();}
开发者ID:flensrocker,项目名称:vdr-plugin-xineliboutput,代码行数:53,
示例14: strn0cpyvoid Object::SetModelName(const char* modelname){ strn0cpy(m_data.object_name, modelname, sizeof(m_data.object_name)); // 32 is the max for chars in object_name, this should be safe EQApplicationPacket* app = new EQApplicationPacket(); EQApplicationPacket* app2 = new EQApplicationPacket(); this->CreateDeSpawnPacket(app); this->CreateSpawnPacket(app2); entity_list.QueueClients(0, app); entity_list.QueueClients(0, app2); safe_delete(app); safe_delete(app2);}
开发者ID:quido,项目名称:Server,代码行数:12,
示例15: ServerPacketvoid ZoneGuildManager::SendGuildMemberUpdateToWorld(const char *MemberName, uint32 GuildID, uint16 ZoneID, uint32 LastSeen){ ServerPacket* pack = new ServerPacket(ServerOP_GuildMemberUpdate, sizeof(ServerGuildMemberUpdate_Struct)); ServerGuildMemberUpdate_Struct *sgmus = (ServerGuildMemberUpdate_Struct*)pack->pBuffer; sgmus->GuildID = GuildID; strn0cpy(sgmus->MemberName, MemberName, sizeof(sgmus->MemberName)); sgmus->ZoneID = ZoneID; sgmus->LastSeen = LastSeen; worldserver.SendPacket(pack); safe_delete(pack);}
开发者ID:RicardoCampos,项目名称:Server,代码行数:13,
示例16: idClientListEntry::ClientListEntry(uint32 in_id, ZoneServer* iZS, ServerClientList_Struct* scl, int8 iOnline): id(in_id){ ClearVars(true); pIP = 0; pLSID = scl->LSAccountID; strn0cpy(plsname, scl->name, sizeof(plsname)); strn0cpy(plskey, scl->lskey, sizeof(plskey)); pworldadmin = 0; paccountid = scl->AccountID; strn0cpy(paccountname, scl->AccountName, sizeof(paccountname)); padmin = scl->Admin; pinstance = 0; if (iOnline >= CLE_Status_Zoning) Update(iZS, scl, iOnline); else SetOnline(iOnline);}
开发者ID:Leere,项目名称:Server,代码行数:22,
示例17: ServerPacketvoid Raid::SendRaidMOTDToWorld(){ if (motd.empty()) return; size_t size = motd.size() + 1; ServerPacket *pack = new ServerPacket(ServerOP_RaidMOTD, sizeof(ServerRaidMOTD_Struct) + size); ServerRaidMOTD_Struct *smotd = (ServerRaidMOTD_Struct *)pack->pBuffer; smotd->rid = GetID(); strn0cpy(smotd->motd, motd.c_str(), size); worldserver.SendPacket(pack); safe_delete(pack);}
开发者ID:surlyone,项目名称:Server,代码行数:13,
示例18: servermsinitvoid servermsinit(const char *master, const char *sdesc, bool listen) { const char *mid = strstr(master, "/"); if (!mid) mid = master; strcpy_s(masterpath, mid); strn0cpy(masterbase, master, mid-master+1); strcpy_s(serverdesc, sdesc); if (listen) { ENetAddress address = { ENET_HOST_ANY, CUBE_SERVINFO_PORT }; pongsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM, &address); if (pongsock == ENET_SOCKET_NULL) sys::fatal("could not create server info socket/n"); }}
开发者ID:r-lyeh-forks,项目名称:mini.q,代码行数:13,
示例19: whilebool cPluginDvdswitch::ProcessArgs(int argc, char *argv[]){ static struct option long_options[] = { { "debug", required_argument, NULL, 'D' }, { "readscript", required_argument, NULL, 'r' }, { "writescript", required_argument, NULL, 'w' }, { "imagedir", required_argument, NULL, 'i' }, { NULL } }; int c = 0; optind = 1; //default for getopt while((c = getopt_long(argc, argv, "D:r:w:i:", long_options, NULL)) != -1) { switch(c) { case 'D': DebugLog.SetLogFile(optarg); break; case 'r': strn0cpy(DVDSwitchSetup.DVDReadScript, optarg, MaxFileName); break; case 'w': strn0cpy(DVDSwitchSetup.DVDWriteScript, optarg, MaxFileName); break; case 'i': strn0cpy(DVDSwitchSetup.ImageDir, optarg, MaxFileName); DVDSwitchSetup.ImageDirPerParam = true; break; default: esyslog("DVDSwitch: unknown Parameter: %c", c); break; } } return true;}
开发者ID:suborb,项目名称:reelvdr,代码行数:38,
示例20: outvoid out(const char *s, ...) { SDL_LockMutex(mutex); vasprintfsd(sf, s, s); s = sf.c_str(); int n = 0; while (strlen(s)>WORDWRAP) { // cut strings to fit on screen fixedstring t; strn0cpy(t.c_str(), s, WORDWRAP+1); line(t.c_str(), n++!=0); s += WORDWRAP; } line(s, n!=0); SDL_UnlockMutex(mutex);}
开发者ID:bsegovia,项目名称:mini.q,代码行数:14,
示例21: msprintfchar* cSearchTimerThread::SummaryExtended(cSearchExt* searchExt, cTimer* Timer, const cEvent* pEvent){ bool UseVPS = searchExt->useVPS && pEvent->Vps() && Setup.UseVps; time_t eStart; if (!UseVPS) eStart = pEvent->StartTime(); else eStart = pEvent->Vps(); time_t eStop; if (!UseVPS) eStop = pEvent->EndTime(); else eStop = pEvent->Vps() + pEvent->Duration(); // make sure that eStart and eStop represent a full minute eStart = (eStart / 60) * 60; eStop = (eStop / 60) * 60; time_t start = eStart - (UseVPS?0:(searchExt->MarginStart * 60)); time_t stop = eStop + (UseVPS?0:(searchExt->MarginStop * 60)); char* addSummaryFooter = NULL; msprintf(&addSummaryFooter, "<channel>%d - %s</channel><searchtimer>%s</searchtimer><start>%ld</start><stop>%ld</stop><s-id>%d</s-id><eventid>%ld</eventid>", Timer->Channel()->Number(), CHANNELNAME(Timer->Channel()), searchExt->search, start, stop, searchExt->ID, (long) pEvent->EventID()); const char* aux = Timer->Aux(); // remove epgsearch entries char* tmpaux = NULL; if (!isempty(aux)) { tmpaux = strdup(aux); const char* begin = strstr(aux, "<epgsearch>"); const char* end = strstr(aux, "</epgsearch>"); if (begin && end) { if (begin == aux) strcpy(tmpaux, ""); else strn0cpy(tmpaux, aux, begin-aux+1); strcat(tmpaux, end + strlen("</epgsearch>")); } } char* tmpSummary = NULL; msprintf(&tmpSummary, "<epgsearch>%s</epgsearch>%s", addSummaryFooter, tmpaux?tmpaux:""); free(addSummaryFooter); if (tmpaux) free(tmpaux); return tmpSummary;}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:50,
示例22: assertvoid Mob::AddTrap(Aura *aura, AuraRecord &record){ // this is called only when it's safe assert(aura != nullptr); strn0cpy(trap_mgr.auras[trap_mgr.count].name, aura->GetCleanName(), 64); trap_mgr.auras[trap_mgr.count].spawn_id = aura->GetID(); trap_mgr.auras[trap_mgr.count].aura = aura; if (record.icon == -1) trap_mgr.auras[trap_mgr.count].icon = spells[record.spell_id].new_icon; else trap_mgr.auras[trap_mgr.count].icon = record.icon; // doesn't send to client trap_mgr.count++;}
开发者ID:SecretsOTheP,项目名称:Server,代码行数:14,
示例23: strn0cpySpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, float dist, float maxx, float minx, float maxy, float miny, int delay_in, int despawn_in, uint32 despawn_timer_in, int min_delay_in ) { id = in_id; strn0cpy( name_, name, 120); group_spawn_limit = in_group_spawn_limit; roambox[0]=maxx; roambox[1]=minx; roambox[2]=maxy; roambox[3]=miny; roamdist=dist; min_delay=min_delay_in; delay=delay_in; despawn=despawn_in; despawn_timer=despawn_timer_in;}
开发者ID:quido,项目名称:Server,代码行数:14,
示例24: close_timerDoors::Doors(const Door* door): close_timer(5000){ db_id = door->db_id; door_id = door->door_id; strn0cpy(zone_name,door->zone_name,32); strn0cpy(door_name,door->door_name,32); pos_x = door->pos_x; pos_y = door->pos_y; pos_z = door->pos_z; heading = door->heading; incline = door->incline; opentype = door->opentype; guild_id = door->guild_id; lockpick = door->lockpick; keyitem = door->keyitem; nokeyring = door->nokeyring; trigger_door = door->trigger_door; trigger_type = door->trigger_type; triggered=false; door_param = door->door_param; size = door->size; invert_state = door->invert_state; SetOpenState(false); close_timer.Disable(); strn0cpy(dest_zone,door->dest_zone,32); dest_instance_id = door->dest_instance_id; dest_x = door->dest_x; dest_y = door->dest_y; dest_z = door->dest_z; dest_heading = door->dest_heading; is_ldon_door = door->is_ldon_door; client_version_mask = door->client_version_mask;}
开发者ID:badcaptain,项目名称:Server,代码行数:37,
示例25: whilebool cSetup::ParseLanguages(const char *Value, int *Values){ int n = 0; while (Value && *Value && n < I18nLanguages()->Size()) { char buffer[4]; strn0cpy(buffer, Value, sizeof(buffer)); int i = I18nLanguageIndex(buffer); if (i >= 0) Values[n++] = i; if ((Value = strchr(Value, ' ')) != NULL) Value++; } Values[n] = -1; return true;}
开发者ID:RaZiegler,项目名称:vdr-yavdr,代码行数:15,
示例26: ifvoid cSkinCursesDisplayReplay::SetMode(bool Play, bool Forward, int Speed){ if (Setup.ShowReplayMode) { const char *Mode; if (Speed == -1) Mode = Play ? " > " : " || "; else if (Play) Mode = Forward ? " X>> " : " <<X "; else Mode = Forward ? " X|> " : " <|X "; char buf[16]; strn0cpy(buf, Mode, sizeof(buf)); char *p = strchr(buf, 'X'); if (p) *p = Speed > 0 ? '1' + Speed - 1 : ' '; SetJump(buf); }}
开发者ID:flensrocker,项目名称:vdr,代码行数:15,
示例27: StartHandlerstatic void XMLCALL StartHandler(void *data, const char *el, const char **attr){ XmlNode node; strn0cpy(node.nodename, el, sizeof(node.nodename)); node.depth = depth; nodestack.push(node); if (!strncmp(el, "item", 4)) { cItem *tmpitem = new cItem; item = tmpitem; item->Clear(); } depth++;}
开发者ID:suborb,项目名称:reelvdr,代码行数:15,
注:本文中的strn0cpy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ strna函数代码示例 C++ strmode函数代码示例 |