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

C++ print_attributes函数代码示例

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

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



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

示例1: handlefunction

int handlefunction(astree node, FILE* outfile){
    astree type = node->first;
    astree ident = node->first->first;
    astree param = node->first->next->first;
    bitset_t newattrs = bitlookup(type->symbol); 
    node->attrs = newattrs;
    cstring funcname = peek_stringtable(ident->lexinfo);

    sym_noderef lookup = search_sym_table(ident,gident_tbl);
    if (lookup != NULL){
        if (lookup->attributes & ATTR_PROTOTYPE){
            //found previous func declaration, it's a prototype
            if (lookup->attributes == ((newattrs | ATTR_PROTOTYPE))){
                if(paramcheck(param,lookup->nextparam,funcname)){
                    return 1;
                }
            } else {
                print_attributes(stdout,(ATTR_PROTOTYPE + ATTR_BOOL));
                eprintf("\n");
                print_attributes(stdout,(newattrs|ATTR_PROTOTYPE));
                eprintf("\n");
                //func declaration does not match prototype's type
                eprintf(
            "prototype's type does not match function declaration %s\n",
                        funcname);
            }
        } else {
            //found previous func declaration, it's not a prototype
            eprintf(
            "redeclaring function %s at line %d\n",
            peek_stringtable(ident->lexinfo),ident->linenr-1);
            eprintf(
            "(previously declared at line %d)\n",lookup->linenr-1);
            return 1;
        }
    } else {
        ident->attrs = ATTR_FUNCTION | bitlookup(type->symbol);
        sym_noderef temp = intern_sym_table(ident,gident_tbl,outfile);
        push_block(gblock_stk);
        for(;param != NULL; param = param->next){
            param->first->attrs = bitlookup(param->symbol) | ATTR_PARAM;
            param->first->blocknr = gblock_stk->top->blocknr;
            temp->nextparam = 
            intern_sym_table(param->first,gident_tbl,outfile);
            temp = temp->nextparam;
        }
        pop_idents(gident_tbl,gblock_stk->top->blocknr);
        pop_block(gblock_stk);
    }
    return 0;
}
开发者ID:mtnash,项目名称:oc,代码行数:51,代码来源:astree.c


示例2: trace

  // This method is called while executing the raw bytecodes, so none of
  // the adjustments that BytecodeStream performs applies.
  void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2) {
    MutexLocker ml(BytecodeTrace_lock);
    ResourceMark rm;
    if (_current_method != method()) {
      // Note 1: This code will not work as expected with true MT/MP.
      //         Need an explicit lock or a different solution.
      tty->cr();
      tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
      method->print_name(tty);
      tty->cr();
      _current_method = method();
    }
    Bytecodes::Code code;
    if (is_wide()) {
      // bcp wasn't advanced if previous bytecode was _wide.
      code = Bytecodes::cast(*(bcp+1));
    } else {
      code = Bytecodes::cast(*bcp);
    }
    int bci = bcp - method->code_base();
    tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
    if (Verbose) {
      tty->print("%8d  %4d  " INTPTR_FORMAT " " INTPTR_FORMAT " %s", 
	   BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
    } else {
      tty->print("%8d  %4d  %s", 
	   BytecodeCounter::counter_value(), bci, Bytecodes::name(code));
    }
    _next_pc = is_wide() ? bcp+2 : bcp+1;
    print_attributes(code, bci);
    // Set is_wide for the next one, since the caller of this doesn't skip
    // the next bytecode.
    _is_wide = (code == Bytecodes::_wide);
  }
开发者ID:subxiang,项目名称:jdk-source-code,代码行数:36,代码来源:bytecodeTracer.cpp


示例3: print_element_node

        inline OutIt print_element_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
        {
            assert(node->type() == node_element);

            // Print element name and attributes, if any
            if (!(flags & print_no_indenting)) {
                //out = fill_chars(out, indent, Ch('\t'));
                out = fill_chars(out, indent, Ch(' '));
                out = fill_chars(out, indent, Ch(' '));
            }
            *out = Ch('<'), ++out;
            out = copy_chars(node->name(), node->name() + node->name_size(), out);
            out = print_attributes(out, node);
            
            // If node is childless
            if (node->value_size() == 0 && !node->first_node())
            {
                // Print childless node tag ending
                *out = Ch('/'), ++out;
                *out = Ch('>'), ++out;
            }
            else
            {
                // Print normal node tag ending
                *out = Ch('>'), ++out;

                // Test if node contains a single data node only (and no other nodes)
                xml_node<Ch> *child = node->first_node();
                if (!child)
                {
                    // If node has no children, only print its value without indenting
                    out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out);
                }
                else if (child->next_sibling() == 0 && child->type() == node_data)
                {
                    // If node has a sole data child, only print its value without indenting
                    out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out);
                }
                else
                {
                    // Print all children with full indenting
                    if (!(flags & print_no_indenting))
                        *out = Ch('\n'), ++out;
                    out = print_children(out, node, flags, indent + 1);
                    if (!(flags & print_no_indenting)) {
                        //out = fill_chars(out, indent, Ch('\t'));
                        out = fill_chars(out, indent, Ch(' '));
                        out = fill_chars(out, indent, Ch(' '));
                    }
                }

                // Print node end
                *out = Ch('<'), ++out;
                *out = Ch('/'), ++out;
                out = copy_chars(node->name(), node->name() + node->name_size(), out);
                *out = Ch('>'), ++out;
            }
            return out;
        }
开发者ID:OxfordSKA,项目名称:OSKAR,代码行数:59,代码来源:rapidxml_print.hpp


示例4: old_main

int		old_main (int argc, char** argv)
{
	IDeckLinkIterator*		deckLinkIterator;
	IDeckLink*				deckLink;
	int						numDevices = 0;
	HRESULT					result;
	
	// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
	deckLinkIterator = CreateDeckLinkIteratorInstance();
	if (deckLinkIterator == NULL)
	{
		fprintf(stderr, "A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.\n");
		return 1;
	}
	
	// Enumerate all cards in this system
	while (deckLinkIterator->Next(&deckLink) == S_OK)
	{
		char *		deviceNameString = NULL;
		
		// Increment the total number of DeckLink cards found
		numDevices++;
		if (numDevices > 1)
			printf("\n\n");
		
		// *** Print the model name of the DeckLink card
		result = deckLink->GetModelName((const char **) &deviceNameString);
		if (result == S_OK)
		{
			printf("=============== %s ===============\n\n", deviceNameString);
			free(deviceNameString);
		}

		print_attributes(deckLink);
		
		// ** List the video output display modes supported by the card
		print_output_modes(deckLink);
		
		// ** List the video input display modes supported by the card
		print_input_modes(deckLink);
		
		// ** List the input and output capabilities of the card
		print_capabilities(deckLink);
		
		// Release the IDeckLink instance when we've finished with it to prevent leaks
		deckLink->Release();
	}
	
	deckLinkIterator->Release();

	// If no DeckLink cards were found in the system, inform the user
	if (numDevices == 0)
		printf("No Blackmagic Design devices were found.\n");
	printf("\n");
	
	return 0;
}
开发者ID:G4GUO,项目名称:datvexpress_gui,代码行数:57,代码来源:dldiscover.cpp


示例5: print_unit

void print_unit(unit *unit) {
  printf("type %d, state %s, vector (%f, %f, %f)\n", 
      unit->type, 
      ((state *)unit->state->value)->name, 
      x(unit->position), 
      y(unit->position),
      z(unit->position));
  printf("\t");
  print_attributes(unit->attributes);
  printf("\t");
  print_weapons(unit->weapons);
}
开发者ID:steved,项目名称:skirmish,代码行数:12,代码来源:print.c


示例6: CreateDeckLinkIteratorInstance

vector<ofVideoDevice> ofxBlackmagicGrabber::listDevices() {
	IDeckLinkIterator*		deckLinkIterator;
	IDeckLink*				deckLink;
	int						numDevices = 0;
	HRESULT					result;
	
	vector<ofVideoDevice> devices;

	// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
	deckLinkIterator = CreateDeckLinkIteratorInstance();
	if (deckLinkIterator == NULL){
		ofLogError(LOG_NAME) <<  "A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.";
	}

	// Enumerate all cards in this system
	while (deckLinkIterator->Next(&deckLink) == S_OK){
		CFStringRef deviceNameString;

		// Increment the total number of DeckLink cards found
		numDevices++;
		if (numDevices > 1)
			printf("\n\n");

		// *** Print the model name of the DeckLink card
		result = deckLink->GetModelName(&deviceNameString);
		if (result == S_OK)
		{
			printf("=============== %s ===============\n\n", deviceNameString);
//			free(deviceNameString);
		}

		print_attributes(deckLink);

		// ** List the video output display modes supported by the card
		print_output_modes(deckLink);

		// ** List the input and output capabilities of the card
		print_capabilities(deckLink);

		// Release the IDeckLink instance when we've finished with it to prevent leaks
		deckLink->Release();
	}

	deckLinkIterator->Release();

	// If no DeckLink cards were found in the system, inform the user
	if (numDevices == 0)
		ofLogError(LOG_NAME) <<  "No Blackmagic Design devices were found.";

	return devices;
}
开发者ID:kylemcdonald,项目名称:ofxBlackmagicGrabber,代码行数:51,代码来源:ofxBlackmagicGrabber.cpp


示例7: print_model

/***********************************************************************//**
 * @brief Print model information
 ***************************************************************************/
std::string GModelSky::print_model(void) const
{
    // Initialise result string
    std::string result;

    // Determine number of parameters per type
    int n_spatial  = (m_spatial  != NULL) ? m_spatial->size()  : 0;
    int n_spectral = (m_spectral != NULL) ? m_spectral->size() : 0;
    int n_temporal = (m_temporal != NULL) ? m_temporal->size() : 0;

    // Append attributes
    result.append(print_attributes());

    // Append model type
    result.append("\n"+parformat("Model type"));
    if (n_spatial > 0) {
        result.append("\""+spatial()->type()+"\"");
        if (n_spectral > 0 || n_temporal > 0) {
            result.append(" * ");
        }
    }
    if (n_spectral > 0) {
        result.append("\""+spectral()->type()+"\"");
        if (n_temporal > 0) {
            result.append(" * ");
        }
    }
    if (n_temporal > 0) {
        result.append("\""+temporal()->type()+"\"");
    }

    // Append parameters
    result.append("\n"+parformat("Number of parameters")+str(size()));
    result.append("\n"+parformat("Number of spatial par's")+str(n_spatial));
    for (int i = 0; i < n_spatial; ++i) {
        result.append("\n"+(*spatial())[i].print());
    }
    result.append("\n"+parformat("Number of spectral par's")+str(n_spectral));
    for (int i = 0; i < n_spectral; ++i) {
        result.append("\n"+(*spectral())[i].print());
    }
    result.append("\n"+parformat("Number of temporal par's")+str(n_temporal));
    for (int i = 0; i < n_temporal; ++i) {
        result.append("\n"+(*temporal())[i].print());
    }

    // Return result
    return result;
}
开发者ID:rbuehler,项目名称:gammalib,代码行数:52,代码来源:GModelSky.cpp


示例8: C_FindObjectsInit

CK_RV
C_FindObjectsInit(CK_SESSION_HANDLE hSession,
		  CK_ATTRIBUTE_PTR pTemplate,
		  CK_ULONG ulCount)
{
    struct session_state *state;

    st_logf("FindObjectsInit\n");

    INIT_CONTEXT();

    VERIFY_SESSION_HANDLE(hSession, &state);

    if (state->find.next_object != -1) {
	application_error("application didn't do C_FindObjectsFinal\n");
	find_object_final(state);
    }
    if (ulCount) {
	CK_ULONG i;

	print_attributes(pTemplate, ulCount);

	state->find.attributes =
	    calloc(1, ulCount * sizeof(state->find.attributes[0]));
	if (state->find.attributes == NULL)
	    return CKR_DEVICE_MEMORY;
	for (i = 0; i < ulCount; i++) {
	    state->find.attributes[i].pValue =
		malloc(pTemplate[i].ulValueLen);
	    if (state->find.attributes[i].pValue == NULL) {
		find_object_final(state);
		return CKR_DEVICE_MEMORY;
	    }
	    memcpy(state->find.attributes[i].pValue,
		   pTemplate[i].pValue, pTemplate[i].ulValueLen);
	    state->find.attributes[i].type = pTemplate[i].type;
	    state->find.attributes[i].ulValueLen = pTemplate[i].ulValueLen;
	}
	state->find.num_attributes = ulCount;
	state->find.next_object = 0;
    } else {
	st_logf("find all objects\n");
	state->find.attributes = NULL;
	state->find.num_attributes = 0;
	state->find.next_object = 0;
    }

    return CKR_OK;
}
开发者ID:heimdal,项目名称:heimdal,代码行数:49,代码来源:softp11.c


示例9: print_element

static void
print_element (scew_element *element, unsigned int indent)
{
  XML_Char const *contents = NULL;
  scew_list *list = NULL;

  if (element == NULL)
    {
      return;
    }

  /* Prints the starting element tag with its attributes. */
  print_indent (indent);
  scew_printf (_XT("<%s"), scew_element_name (element));
  print_attributes (element);
  scew_printf (_XT(">"));

  contents = scew_element_contents (element);

  if (contents == NULL)
    {
      scew_printf (_XT("\n"));
    }

  /**
   * Call print_element function again for each child of the current
   * element.
   */
  list = scew_element_children (element);
  while (list != NULL)
    {
      scew_element *child = scew_list_data (list);
      print_element (child, indent + 1);
      list = scew_list_next (list);
    }

  /* Prints element's content. */
  if (contents != NULL)
    {
      scew_printf (_XT("%s"), contents);
    }
  else
    {
      print_indent (indent);
    }

  /* Prints the closing element tag. */
  scew_printf (_XT("</%s>\n"), scew_element_name (element));
}
开发者ID:aconchillo,项目名称:scew,代码行数:49,代码来源:scew_print.c


示例10: setw

ostream &auth_attr_addr::print(ostream &os, uint32 level, const uint32 indent, const char *name ) const {
	os << setw(level*indent) << "";

	if ( name )
	  os << name <<  " = ";

	os << "[" << ie_name << ": xtype = "<<(int)x_type<<", subtype = "<<(int)sub_type<<", attribute_body : { \n";
	os << setw((level+1)*indent) << "";

	print_attributes(os);
	
	os <<"\n"<<setw(level*indent) << "";	 
	os << "}]";

	return os;	
}
开发者ID:allanborgespontes,项目名称:ReVir-UFPe,代码行数:16,代码来源:auth_attr_addr.cpp


示例11: print_ClassFile

void print_ClassFile(ClassFile* class_file_ptr){
    printf("\n\nMagic: %.8x\n\n", class_file_ptr->magic);
	printf("Minor Version: %.4x\n", class_file_ptr->minor_version);
	printf("Major Version: %.4x\n\n", class_file_ptr->major_version);
    
    printConstantPoolTable(class_file_ptr->constant_pool_count, class_file_ptr->constant_pool);

    print_interface(class_file_ptr->interfaces, class_file_ptr->interfaces_count, class_file_ptr->constant_pool);

    printField(class_file_ptr->constant_pool, class_file_ptr->fields, class_file_ptr->fields_count);

    print_Methods(class_file_ptr, class_file_ptr->constant_pool);

    print_attributes(class_file_ptr->attributes, class_file_ptr->attributes_count, class_file_ptr->constant_pool);

    
}
开发者ID:maxmfernan,项目名称:SoftwareBasico,代码行数:17,代码来源:LoadClass_ui.c


示例12: dump_inst

void dump_inst(const xed_inst_t* p) {
    unsigned int j;
    printf("%s ", xed_iclass_enum_t2str(xed_inst_iclass(p)));
    printf("%s ", xed_iform_enum_t2str(xed_inst_iform_enum(p)));
    printf("%s ", xed_category_enum_t2str(xed_inst_category(p)));
    printf("%s ", xed_extension_enum_t2str(xed_inst_extension(p)));
    printf("%s ", xed_isa_set_enum_t2str(xed_inst_isa_set(p)));
    print_attributes(p);
    printf("%2u ", xed_inst_noperands(p));
    printf("\n");
    for(j=0;j<xed_inst_noperands(p);j++) {
        printf("\t%u ", j);
        dump_operand(xed_inst_operand(p,j));
        printf("\n");
    }

}
开发者ID:Vectorlee,项目名称:binary_reverse_lib,代码行数:17,代码来源:xed-tables.c


示例13: trace

  void trace(methodOop method, address bcp, uintptr_t tos, uintptr_t tos2) {
#ifndef PRODUCT
    MutexLocker ml(BytecodeTrace_lock);
    if (_current_method != method) {
      // Note 1: This code will not work as expected with true MT/MP.
      //         Need an explicit lock or a different solution.
      ResourceMark rm;
      tty->cr();
      tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
      method->print_name(tty);
      tty->cr();
      _current_method = method;
    }
    if (Verbose) {
      const char* format;
      switch (Bytecodes::length_at(bcp)) {
        case  1: format = "%x  %02x         "    ; break;
        case  2: format = "%x  %02x %02x      "  ; break;
        case  3: format = "%x  %02x %02x %02x   "; break;
        default: format = "%x  %02x %02x %02x .."; break;
      }
      tty->print(format, bcp, *bcp, *(bcp+1), *(bcp+2));
    }
    Bytecodes::Code code;
    if (_previous_bytecode == Bytecodes::_wide) {
      code = Bytecodes::cast(*(bcp+1));
    } else {
      code = Bytecodes::cast(*bcp);
    }
    int bci = bcp - method->code_base();
    const char* format = _previous_bytecode == Bytecodes::_wide ? Bytecodes::wide_format(code) : Bytecodes::format(code);
    tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
    if (Verbose) {
      tty->print("%8d  %4d  0x%016lx 0x%016lx %s", 
	   BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
    } else {
      tty->print("%8d  %4d  %s", 
	   BytecodeCounter::counter_value(), bci, Bytecodes::name(code));
    }
    print_attributes(bcp, bci, format);
    tty->cr();
    _previous_bytecode = code;
#endif
  }
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:44,代码来源:bytecodeTracer.cpp


示例14: trace

 // Used for methodOop::print_codes().  The input bcp comes from
 // BytecodeStream, which will skip wide bytecodes.
 void trace(methodHandle method, address bcp, outputStream* st) {
   _current_method = method();
   ResourceMark rm;
   Bytecodes::Code code = Bytecodes::code_at(bcp);
   // Set is_wide
   _is_wide = (code == Bytecodes::_wide);
   if (is_wide()) {
     code = Bytecodes::code_at(bcp+1);
   }
   int bci = bcp - method->code_base();
   // Print bytecode index and name
   if (is_wide()) {
     st->print("%d %s_w", bci, Bytecodes::name(code));
   } else {
     st->print("%d %s", bci, Bytecodes::name(code));
   }
   _next_pc = is_wide() ? bcp+2 : bcp+1;
   print_attributes(code, bci, st);
   bytecode_epilog(bci, st);
 }
开发者ID:tetratec,项目名称:Runescape-Launcher,代码行数:22,代码来源:bytecodeTracer.cpp


示例15: print_declaration_node

        inline OutIt print_declaration_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
        {
            // Print declaration start
            if (!(flags & print_no_indenting))
                out = fill_chars(out, indent, Ch('\t'));
            *out = Ch('<'), ++out;
            *out = Ch('?'), ++out;
            *out = Ch('x'), ++out;
            *out = Ch('m'), ++out;
            *out = Ch('l'), ++out;

            // Print attributes
            out = print_attributes(out, node, flags);

            // Print declaration end
            *out = Ch('?'), ++out;
            *out = Ch('>'), ++out;

            return out;
        }
开发者ID:gjianw217,项目名称:DLPRobot,代码行数:20,代码来源:rapidxml_print.hpp


示例16: main

int main (void) {
   printf ("Number of bits in a bitset = %lu\n",
           CHAR_BIT * sizeof (bitset_t));
   for (bitset_t set = 0xF; set < 1L << 32; set <<= 4) {
      printf ("bitset 0x%016lX =", set);
      print_attributes (set);
      printf ("\n");
   }
   
    printf("\nmy own\n");
    
    bitset_t temp1 = 1 << ATTR_INDEX_INT;
    temp1 |= 1 << ATTR_INDEX_CONST;
    
    bitset_t temp2 = 1 << ATTR_INDEX_CHAR;
    temp2 |= 1 << ATTR_INDEX_CONST;
    
   
   
    return EXIT_SUCCESS;
}
开发者ID:edishuman,项目名称:asg5,代码行数:21,代码来源:attributes.copy.c


示例17: trace

 // This method is called while executing the raw bytecodes, so none of
 // the adjustments that BytecodeStream performs applies.
 void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
   ResourceMark rm;
   if (_current_method != method()) {
     // Note 1: This code will not work as expected with true MT/MP.
     //         Need an explicit lock or a different solution.
     // It is possible for this block to be skipped, if a garbage
     // _current_method pointer happens to have the same bits as
     // the incoming method.  We could lose a line of trace output.
     // This is acceptable in a debug-only feature.
     st->cr();
     st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id());
     method->print_name(st);
     st->cr();
     _current_method = method();
   }
   Bytecodes::Code code;
   if (is_wide()) {
     // bcp wasn't advanced if previous bytecode was _wide.
     code = Bytecodes::code_at(method(), bcp+1);
   } else {
     code = Bytecodes::code_at(method(), bcp);
   }
   _code = code;
    int bci = bcp - method->code_base();
   st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id());
   if (Verbose) {
     st->print("%8d  %4d  " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
          BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
   } else {
     st->print("%8d  %4d  %s",
          BytecodeCounter::counter_value(), bci, Bytecodes::name(code));
   }
   _next_pc = is_wide() ? bcp+2 : bcp+1;
   print_attributes(bci);
   // Set is_wide for the next one, since the caller of this doesn't skip
   // the next bytecode.
   _is_wide = (code == Bytecodes::_wide);
   _code = Bytecodes::_illegal;
 }
开发者ID:4T-Shirt,项目名称:OpenJDK-Research,代码行数:41,代码来源:bytecodeTracer.cpp


示例18: print_session

static void print_session(sdp_printer_t *p, sdp_session_t const *sdp)
{
  p->pr_ok = 1;

  if (p->pr_ok && sdp->sdp_version)
    print_version(p, sdp->sdp_version);
  if (p->pr_ok && sdp->sdp_origin)
    print_origin(p, sdp->sdp_origin);
  if (p->pr_ok && sdp->sdp_subject)
    print_subject(p, sdp->sdp_subject);
  if (p->pr_ok && sdp->sdp_information)
    print_information(p, sdp->sdp_information);
  if (p->pr_ok && sdp->sdp_uri)
    print_uri(p, sdp->sdp_uri);
  if (p->pr_ok && sdp->sdp_emails)
    print_emails(p, sdp->sdp_emails);
  if (p->pr_ok && sdp->sdp_phones)
    print_phones(p, sdp->sdp_phones);
  if (p->pr_ok && sdp->sdp_connection)
    print_connection(p, sdp->sdp_connection);
  if (p->pr_ok && sdp->sdp_bandwidths)
    print_bandwidths(p, sdp->sdp_bandwidths);
  if (p->pr_ok)
    print_time(p, sdp->sdp_time);
  if (p->pr_ok && sdp->sdp_time) {
    if (p->pr_ok && sdp->sdp_time->t_repeat)
      print_repeat(p, sdp->sdp_time->t_repeat);
    if (p->pr_ok && sdp->sdp_time->t_zone)
      print_zone(p, sdp->sdp_time->t_zone);
  }
  if (p->pr_ok && sdp->sdp_key)
    print_key(p, sdp->sdp_key);
  if (p->pr_ok && sdp->sdp_charset)
    print_charset(p, sdp->sdp_charset);
  if (p->pr_ok && sdp->sdp_attributes)
    print_attributes(p, sdp->sdp_attributes);
  if (p->pr_ok && sdp->sdp_media)
    print_media(p, sdp, sdp->sdp_media);
}
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:39,代码来源:sdp_print.c


示例19: print_media


//.........这里部分代码省略.........
  for (;m ; m = m->m_next) {
    switch (m->m_type) {
    case sdp_media_audio:       media = "audio"; break;
    case sdp_media_video:       media = "video"; break;
    case sdp_media_application: media = "application"; break;
    case sdp_media_data:        media = "data"; break;
    case sdp_media_control:     media = "control"; break;
    case sdp_media_message:     media = "message"; break;
    case sdp_media_image  :     media = "image"; break;
    default:                    media = m->m_type_name;
    }

    switch (m->m_proto) {
    case sdp_proto_tcp:   proto = "tcp"; break;
    case sdp_proto_udp:   proto = "udp"; break;
    case sdp_proto_rtp:   proto = "RTP/AVP"; break;
    case sdp_proto_srtp:  proto = "RTP/SAVP"; break;
    case sdp_proto_udptl: proto = "udptl"; break;
    case sdp_proto_msrp:  proto = "TCP/MSRP"; break;
    case sdp_proto_msrps:  proto = "TCP/TLS/MSRP"; break;
    case sdp_proto_tls:   proto = "tls"; break;
    default:              proto = m->m_proto_name; break;
    }

    if (m->m_number_of_ports <= 1)
      sdp_printf(p, "m=%s %u %s", media, m->m_port, proto);
    else
      sdp_printf(p, "m=%s %u/%u %s",
		 media, m->m_port, m->m_number_of_ports, proto);

    if (m->m_rtpmaps) {
      for (rm = m->m_rtpmaps; rm; rm = rm->rm_next) {
	if (rm->rm_any)
	  sdp_printf(p, " *");
	else
	  sdp_printf(p, " %u", (unsigned)rm->rm_pt);
      }
    }
    else if (m->m_format) {
      sdp_list_t *l = m->m_format;
      for (; l; l = l->l_next)
	sdp_printf(p, " %s", l->l_text);
    }
    else {
      sdp_printf(p, " 19");      /* SDP syntax requires at least one format.
				    19 is used by nobody, right?. */
    }


    sdp_printf(p, CRLF);

    if (m->m_information)
      print_information(p, m->m_information);
    if (m->m_connections)
#ifdef nomore
    if (m->m_connections != sdp->sdp_connection)
#endif
      print_connection_list(p, m->m_connections);
    if (m->m_bandwidths)
      print_bandwidths(p, m->m_bandwidths);
    if (m->m_key)
      print_key(p, m->m_key);

    for (rm = m->m_rtpmaps; rm; rm = rm->rm_next) {
      if (!rm->rm_predef || p->pr_all_rtpmaps)
	sdp_printf(p, "a=rtpmap:%u %s/%lu%s%s" CRLF,
		   rm->rm_pt, rm->rm_encoding, rm->rm_rate,
		   rm->rm_params ? "/" : "",
		   rm->rm_params ? rm->rm_params : "");
      if (rm->rm_fmtp)
	sdp_printf(p, "a=fmtp:%u %s" CRLF,
		   rm->rm_pt, rm->rm_fmtp);
    }

    if (!p->pr_mode_manual && !m->m_rejected &&
	(m->m_mode != (unsigned int)session_mode || p->pr_mode_always)) {
      switch (m->m_mode) {
      case sdp_inactive:
	sdp_printf(p, "a=inactive" CRLF);
	break;
      case sdp_sendonly:
	sdp_printf(p, "a=sendonly" CRLF);
	break;
      case sdp_recvonly:
	sdp_printf(p, "a=recvonly" CRLF);
	break;
      case sdp_sendrecv:
	sdp_printf(p, "a=sendrecv" CRLF);
	break;
      default:
	break;
      }
    }

    if (p->pr_mode_manual)
      print_attributes(p, m->m_attributes);
    else
      print_attributes_without_mode(p, m->m_attributes);
  }
}
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:101,代码来源:sdp_print.c


示例20: print_attributes

void print_attributes (attribute_info *attributes, u2 attr_count, cp_info *pool) {
    u2 counter = 0;
    
    printf("\n*****Attributes*****\n\n");
    
    while (counter < attr_count) {
        switch (attributes[counter].tag) {
            case 0:
                printf("------------------------------------------------\n");
                printf("[%d] ConstantValue\n", counter);
                printf("\tAttribute name index: cp_info #%d\n",attributes[counter].attribute_name_index);
                printf("\tAttribute length: %d\n",attributes[counter].attribute_length);

                break;
            case 1:
                printf("------------------------------------------------\n");
                printf("[%d] Code\n", counter);
                printf("\tAttribute name index: cp_info #%d\n",attributes[counter].attribute_name_index);
                printf("\tAttribute length: %d\n",attributes[counter].attribute_length);
                printf("Info:\n");
                printf("\tMaximum stack depth:\t %d\n",attributes[counter].info.Code_attribute.max_stack);
                printf("\tMaximum local variable:\t %d\n",attributes[counter].info.Code_attribute.max_locals);
                printf("\tCode length:\t %d\n",attributes[counter].info.Code_attribute.code_length);
                //opcodes
                for(int i = 0; i < attributes[counter].info.Code_attribute.code_length; i++){
                    switch( attributes[counter].info.Code_attribute.code[i] ){
                        case op_nop: 
                        	printf("%s\n", opcodes_str_names[op_nop]);
                        	break;
                        case op_aconst_null: 
                        	printf("%s\n", opcodes_str_names[op_aconst_null]);
                        	break;
                        case op_iconst_m1: 
                        	printf("%s\n", opcodes_str_names[op_iconst_m1]);
                        	break;
                        case op_iconst_0: 
                        	printf("%s\n", opcodes_str_names[op_iconst_0]);
                        	break;
                        case op_iconst_1: 
                        	printf("%s\n", opcodes_str_names[op_iconst_1]);
                        	break;
                        case op_iconst_2: 
                        	printf("%s\n", opcodes_str_names[op_iconst_2]);
                        	break;
                        case op_iconst_3: 
                        	printf("%s\n", opcodes_str_names[op_iconst_3]);
                        	break;
                        case op_iconst_4: 
                        	printf("%s\n", opcodes_str_names[op_iconst_4]);
                        	break;
                        case op_iconst_5: 
                        	printf("%s\n", opcodes_str_names[op_iconst_5]);
                        	break;
                        case op_lconst_0: 
                        	printf("%s\n", opcodes_str_names[op_lconst_0]);
                        	break;
                        case op_lconst_1: 
                        	printf("%s\n", opcodes_str_names[op_lconst_1]);
                        	break;
                        case op_fconst_0: 
                        	printf("%s\n", opcodes_str_names[op_fconst_0]);
                        	break;
                        case op_fconst_1: 
                        	printf("%s\n", opcodes_str_names[op_fconst_1]);
                        	break;
                        case op_fconst_2: 
                        	printf("%s\n", opcodes_str_names[op_fconst_2]);
                        	break;
                        case op_dconst_0: 
                        	printf("%s\n", opcodes_str_names[op_dconst_0]);
                        	break;
                        case op_dconst_1: 
                        	printf("%s\n", opcodes_str_names[op_dconst_1]);
                        	break;
                        case op_bipush: 
                            i++;
                        	printf("%s\n", opcodes_str_names[op_bipush]);
                        	break;
                        case op_sipush: 
                            i+= 2;
                        	printf("%s\n", opcodes_str_names[op_sipush]);
                        	break;
                        case op_ldc: 
                            i++;
                        	printf("%s\n", opcodes_str_names[op_ldc]);
                        	break;
                        case op_ldc_w: 
                            i+=2;
                        	printf("%s\n", opcodes_str_names[op_ldc_w]);
                        	break;
                        case op_ldc2_w: 
                            i+=2;
                        	printf("%s\n", opcodes_str_names[op_ldc2_w]);
                        	break;
                        case op_iload: 
                            i++;
                        	printf("%s\n", opcodes_str_names[op_iload]);
                        	break;
                        case op_lload: 
                            i++;
//.........这里部分代码省略.........
开发者ID:maxmfernan,项目名称:SoftwareBasico,代码行数:101,代码来源:LoadClass_ui.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ print_backtrace函数代码示例发布时间:2022-05-30
下一篇:
C++ print_array函数代码示例发布时间: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