static void BrowWriteUnformattedSet(Tcl_Interp *interp,struct Instance *i) { CONST struct set_t *s; unsigned long len,c; char value[80]; s = SetAtomList(i); switch(SetKind(s)) { case empty_set: break; case integer_set: case string_set: len = Cardinality(s); for(c=1;c<=len;c++) { if (SetKind(s)==integer_set) { sprintf(value,"%u", FetchIntMember(s,c)); Tcl_AppendResult(interp,value," ",(char *)NULL); } else { Tcl_AppendResult(interp,"'",SCP(FetchStrMember(s,c)),"' ", (char *)NULL); } } return; default: return; } }
VHTTPConnectionListener::VHTTPConnectionListener (VHTTPServer *inServer, IRequestLogger* inRequestLogger) : XBOX::VTask (NULL, 0, XBOX::eTaskStylePreemptive, NULL) , fCertificatesFolderPath() , fServerListener (NULL) , fWorkerPool (NULL) , fSelectIOPool (NULL) , fRequestLogger (inRequestLogger) , fListeningIP (DEFAULT_LISTENING_ADDRESS) // 0: All IP addresses , fPort (DEFAULT_LISTENING_PORT) , fSSLPort (DEFAULT_LISTENING_SSL_PORT) , fSSLEnabled (false) , fSSLMandatory (false) , fConnectionHandlerFactory (NULL) , fHTTPServer (NULL) , fUsageCounter (1) , fSocketDescriptor (-1) , fSSLSocketDescriptor (-1) , fReuseAddressSocketOption (true) , fAbortTask (false) { fHTTPServer = XBOX::RetainRefCountable (inServer); XBOX::VString taskName; if (testAssert (NULL != fHTTPServer)) fHTTPServer->LocalizeString (CVSTR ("SNET_CONNECTION_LISTENER"), taskName); SetName (taskName); SetKind (kServerNetTaskKind); SetKindData (kSNET_ConnectionListenerTaskKindData); const short SHARED_WORKER_COUNT = 0; const short SHARED_WORKER_MAX_COUNT = 0; const short SHARED_WORKER_MAX_BUSYNESS = 0; const short EXCLUSIVE_WORKER_COUNT = 5; const short EXCLUSIVE_WORKER_MAX_COUNT = kMAX_sWORD; fWorkerPool = new VWorkerPool ( SHARED_WORKER_COUNT, SHARED_WORKER_MAX_COUNT, SHARED_WORKER_MAX_BUSYNESS, EXCLUSIVE_WORKER_COUNT, EXCLUSIVE_WORKER_MAX_COUNT); fSelectIOPool = new VTCPSelectIOPool(); }
void TagEntry::Create(const wxString& fileName, const wxString& name, int lineNumber, const wxString& pattern, const wxString& kind, std::map<wxString, wxString>& extFields) { m_isCommentForamtted = false; m_flags = 0; m_isClangTag = false; SetName(name); SetLine(lineNumber); SetKind(kind.IsEmpty() ? wxT("<unknown>") : kind); SetPattern(pattern); SetFile(fileName); SetId(-1); m_extFields = extFields; wxString path; // Check if we can get full name (including path) path = GetExtField(wxT("class")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("struct")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("namespace")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("interface")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("enum")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("union")); wxString tmpname = path.AfterLast(wxT(':')); if(!path.IsEmpty()) { if(!tmpname.StartsWith(wxT("__anon"))) { UpdatePath(path); } else { // anonymouse union, remove the anonymous part from its name path = path.BeforeLast(wxT(':')); path = path.BeforeLast(wxT(':')); UpdatePath(path); } } } } } } } if(!path.IsEmpty()) { SetScope(path); } else { SetScope(wxT("<global>")); } // If there is no path, path is set to name if(GetPath().IsEmpty()) SetPath(GetName()); // Get the parent name StringTokenizer tok(GetPath(), wxT("::")); wxString parent; (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count() - 2]; SetParent(parent); }
void TagEntry::Create(const wxString &fileName, const wxString &name, int lineNumber, const wxString &pattern, const wxString &kind, std::map<wxString, wxString>& extFields) { SetPosition( wxNOT_FOUND ); SetName( name ); SetLine( lineNumber ); SetKind( kind.IsEmpty() ? wxT("<unknown>") : kind ); SetPattern( pattern ); SetFile( fileName ); SetId(-1); SetParentId(-1); m_extFields = extFields; wxString path; // Check if we can get full name (including path) path = GetExtField(wxT("class")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("struct")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("namespace")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("interface")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("enum")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("union")); if(!path.IsEmpty()) { UpdatePath( path ) ; } } } } } } if(!path.IsEmpty()) { SetScope(path); } else { SetScope(wxT("<global>")); } // If there is no path, path is set to name if( GetPath().IsEmpty() ) SetPath( GetName() ); // Get the parent name StringTokenizer tok(GetPath(), wxT("::")); wxString parent; (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count()-2]; SetParent(parent); }
static struct gl_list_t *FindArrayChildrenPath(struct gl_list_t *list, CONST struct set_t *sptr, enum find_errors *errval) { struct gl_list_t *result; CONST struct Instance *i,*child; struct InstanceName rec; struct TypeDescription *desc; unsigned long c1,len1,c2,len2,pos; PAN *p, *p2; struct Name *n, *n2; symchar *senum; long sint; switch(SetKind(sptr)){ case empty_set: return gl_create(0); case string_set: SetInstanceNameType(rec,StrArrayIndex); len2 = Cardinality(sptr); len1 = gl_length(list); result = gl_create(len1*len2); for (c1=1; c1<=len1; c1++){ p = (PAN *)gl_fetch(list,c1); i = p->i; if (InstanceKind(i)==ARRAY_ENUM_INST){ if (NextToExpand(i)!=1){ for (c2=1; c2<=len2; c2++){ senum = FetchStrMember(sptr,c2); SetInstanceNameStrIndex(rec,senum); if ((pos = ChildSearch(i,&rec))==0){ DestroyPANList(&result); desc = InstanceTypeDesc(i); if ( GetArrayBaseIsRelation(desc) || GetArrayBaseIsLogRel(desc)){ *errval = unmade_instance; } else { *errval = impossible_instance; } return NULL; } else { child = InstanceChild(i,pos); if (child!=NULL){ n = CreateEnumElementName(senum); n2 = CopyAppendNameNode(p->n, n); DestroyName(n); p2 = CreatePAN(child, n2); gl_append_ptr(result,(VOIDPTR)p2); } else { DestroyPANList(&result); *errval = unmade_instance; return NULL; } } } } else { DestroyPANList(&result); *errval = unmade_instance; return NULL; } } else { DestroyPANList(&result); *errval = impossible_instance; return NULL; } } return result; case integer_set: SetInstanceNameType(rec,IntArrayIndex); len2 = Cardinality(sptr); len1 = gl_length(list); result = gl_create(len1*len2); for (c1=1; c1<=len1; c1++){ p = (PAN *)gl_fetch(list,c1); i = p->i; if (InstanceKind(i)==ARRAY_INT_INST){ if (NextToExpand(i)!=1){ for (c2=1; c2<=len2; c2++){ sint = FetchIntMember(sptr,c2); SetInstanceNameIntIndex(rec,sint); if ((pos = ChildSearch(i,&rec))==0){ DestroyPANList(&result); desc = InstanceTypeDesc(i); if (GetArrayBaseIsRelation(desc) || GetArrayBaseIsLogRel(desc)) { *errval = unmade_instance; } else { *errval = impossible_instance; } return NULL; } else { child = InstanceChild(i,pos); if (child!=NULL){ n = CreateIntegerElementName(sint); n2 = CopyAppendNameNode(p->n, n); DestroyName(n); p2 = CreatePAN(child, n2); gl_append_ptr(result,(VOIDPTR)p2); } else{ DestroyPANList(&result); *errval = unmade_instance; return NULL; } } } } else { DestroyPANList(&result); *errval = unmade_instance; return NULL; } } else { DestroyPANList(&result); *errval = impossible_instance; return NULL; } } return result; } /*NOTREACHED*/ return NULL; }