Beispiel #1
0
void create() {
    ::create();
    set_name("post");
    set_long("The old post was once used as a board.");
    set_id(({"post", "old post"}));
Beispiel #2
0
void create() {
    ::create();
    set_name("test ghost");
    set_id( ({ "test ghost" }) );
Beispiel #3
0
create() {
    ::create();
   set_name("knight");
   set_id( ({ "knight" }) );
Beispiel #4
0
void create() {
   ::create();
   set_name("lag");
   set_long("lag machine");
   set_id(({ "lag" }));
Beispiel #5
0
 Tag::Tag(const std::string & _name)
   : m_issystem(false)
   , m_isproperty(false)
 {
   set_name(_name);
 }
Beispiel #6
0
G1StringDedupThread::G1StringDedupThread() :
  ConcurrentGCThread() {
  set_name("G1 StrDedup");
  create_and_start();
}
SgAsmElfSection *
SgAsmElfSection::init_from_section_table(SgAsmElfSectionTableEntry *shdr, SgAsmElfStringSection *strsec, int id)
{
    ROSE_ASSERT(shdr);
    ROSE_ASSERT(strsec);
    ROSE_ASSERT(id>=0);

    /* Purpose */
    switch (shdr->get_sh_type()) {
      case SgAsmElfSectionTableEntry::SHT_PROGBITS:
        set_purpose(SP_PROGRAM);
        break;
      case SgAsmElfSectionTableEntry::SHT_STRTAB:
        set_purpose(SP_HEADER);
        break;
      case SgAsmElfSectionTableEntry::SHT_DYNSYM:
      case SgAsmElfSectionTableEntry::SHT_SYMTAB:
        set_purpose(SP_SYMTAB);
        break;
      default:
        set_purpose(SP_OTHER);
        break;
    }

    /* File mapping */
    set_offset(shdr->get_sh_offset());
    if (SgAsmElfSectionTableEntry::SHT_NULL==shdr->get_sh_type() ||
        SgAsmElfSectionTableEntry::SHT_NOBITS==shdr->get_sh_type()) {
        set_size(0);
    } else {
        set_size(shdr->get_sh_size());
    }
    set_file_alignment(shdr->get_sh_addralign());
    grab_content();

    /* Memory mapping */
    if (shdr->get_sh_addr() > 0) {
        set_mapped_preferred_rva(shdr->get_sh_addr());
        set_mapped_actual_va(0); /*will be assigned by Loader*/
        set_mapped_size(shdr->get_sh_size());
        set_mapped_rperm(true);
        set_mapped_wperm((shdr->get_sh_flags() & 0x01) == 0x01);
        set_mapped_xperm((shdr->get_sh_flags() & 0x04) == 0x04);
        set_mapped_alignment(shdr->get_sh_addralign());
    } else {
        set_mapped_preferred_rva(0);
        set_mapped_actual_va(0); /*will be assigned by Loader*/
        set_mapped_size(0);
        set_mapped_rperm(false);
        set_mapped_wperm(false);
        set_mapped_xperm(false);
        set_mapped_alignment(shdr->get_sh_addralign());
    }

    /* Name. This has to be near the end because possibly strsec==this, in which case we have to call set_size() to extend the
     * section to be large enough before we can try to look up the name. */
    set_id(id);
    set_name(new SgAsmStoredString(strsec->get_strtab(), shdr->get_sh_name()));

    /* Add section table entry to section */
    set_section_entry(shdr);
    shdr->set_parent(this);

    return this;
}
Beispiel #8
0
void create() 
{ 
    ::create();  
        set_name("old leather bracers");
        set_id( ({ "bracers", "leather bracers", "old leather bracers" }) );
Beispiel #9
0
void create() {
    ::create();
set_name("amulet");
set_short("%^RED%^A%^BOLD%^mulet %^RESET%^BOLD%^BLACK%^%^of the %^RESET%^RED%^N%^BOLD%^ether%^RESET%^RED%^ D%^BOLD%^emon%^RESET%^");
set_long("You gaze upon the amulet of the Nether Demon--a symbol worn by demons in reverence of their god.  It appears as an onyx ram's skull with a pentagram etched into the forehead.  The amulet has incredible powers and is a highly sacred artifact.");
set_id(({"holy symbol", "amulet", "amulet of the nether demon", "symbol"}));
Beispiel #10
0
static void handle_filename(void *data, Char *name)
{
    EDITINFO *einf = (EDITINFO *) data;

    if (name) {
	FILE *f;
	int i;
	int check_found = check_name(einf, name);

	if (!(f = fopen((char*)UstrtoFilename(name),"rb"))) {
	    message2(MP_CLICKREMARK, translate("Unable to open file "), name);
	    free(name);
	    failure=MP_True;
	    return;
	}
	i = test_file(f);
	set_wait_cursor(einf->win_id);
	switch (i) {
	case BINDOC:
	    message(MP_MESSAGE, translate("Loading ascii file."));
	    read_file(f,BINARYFILE);
	    unset_file();
	    load_editwindow(einf->info);
	    break;
	case OLDDOC:
	    i = edit_fnr;
	    edit_fnr = 0;
	    load_notation_filenames(f);
	    old_load_editwindow(einf->info,f);
	    edit_fnr = i;
	    if (!state_open) clear_file_ref();
	    break;
	case NEWDOC:
	    i = edit_fnr;
	    edit_fnr = 0;
	    read_file(f,DOCUMENTFILE);
	    unset_file();
	    load_editwindow(einf->info);
	    edit_fnr = i;
	    break;
	default: break;
	}
	fclose(f);
	cleanup_nodestack();
	cleanup_filestack();
	cleanup_stencilstack();
	einf->saved = MP_True;
	einf->auto_saved = MP_True;
	einf->view_mode = check_found;
	set_name(einf, name);
	set_output_name(einf);
	name = NULL;
	remove_wait_cursor();
	if (check_found)
	    message(MP_CLICKREMARK, translate("The document is already loaded.\n"
		    "This copy has been loaded in view mode\n"
		    "in order to ensure that only one\n"
		    "backup is made."));
	return;
    }
    free(name);
}
Beispiel #11
0
static void edit_property_handle(void *data, XPropertyEvent *event)
{
    EDITINFO *einfo = (EDITINFO*) data;
    if (event->window != einfo->win_id) return;
    if (event->atom==inputat && event->state==PropertyNewValue) {
	long n=0;
	long len=PROPBUFSIZE;
	Atom actt;
	int actf;
	unsigned long nit,baf=1;
	unsigned int redu;
	unsigned char *prp;
	unsigned char *totalbuf=malloc(1);
	int totsize=0;

	while (baf) {
	    unsigned char *h;
	    XGetWindowProperty(display, einfo->win_id, inputat, n/4, len, MP_True,
			       textat, &actt, &actf, &nit, &baf, &prp);
	    redu=nit;
	    h=realloc(totalbuf, totsize+nit+1);
	    if (h) {
	      memcpy(h+totsize, prp, nit);
	      totalbuf=h;
	      totsize=totsize+nit;
	    } else {
	      fprintf(stderr, "Out of memory on processing input.\n");
	    }
	    XFree(prp);
	    n=n+nit;
	}
	totalbuf[totsize]=0;
	if (!einfo->callback || !(*einfo->callback)(totalbuf,&totsize)) {
	  Char *conv;
	  conv = LocaletoUstr(totalbuf);
	  append_editwindow(einfo->info, conv, Ustrlen(conv));
	}
	free(totalbuf);
	if (!n) {
	    einfo->fini=MP_True;
	    einfo->pid=0;
	    einfo->strt=MP_False;
	    set_name(einfo, einfo->pathname);
	}
    } else if (event->atom==outtestat && event->state==PropertyNewValue) {
	einfo->strt=MP_True;
	if (einfo->buflen) {
	    XChangeProperty(display, einfo->win_id, outputat, textat, 8,
			    PropModeAppend, einfo->prcsbuf, (int)einfo->buflen);
	    XFlush(display);
	    free(einfo->prcsbuf);
	    einfo->prcsbuf=NULL;
	    einfo->buflen=0;
	}
    } else if (event->atom==outtestat && event->state==PropertyDelete) {
	einfo->strt=MP_False;
	einfo->fini=MP_True;
	einfo->pid=0;
	set_name(einfo, einfo->pathname);
    } else if (event->atom==procesidat && event->state==PropertyNewValue) {
	long n=0;
	long len=4096;
	Atom actt;
	int actf;
	unsigned long nit,baf=1;
	unsigned char *prp;
	while (baf) {
	    XGetWindowProperty(display, einfo->win_id, procesidat, n/4, len, MP_True,
			       textat, &actt, &actf, &nit, &baf, &prp);
	    if (prp) {
		einfo->pid=atoi((char*)prp);
		XFree(prp);
	    }
	    n=n+nit;
	}
    }
}
Beispiel #12
0
void edit_open(void)
{
    int x = INTERSPACE;
    int y = INTERSPACE;
    unsigned int w=4,h=4;
    int i;
    XSizeHints size_hints;
    EDITINFO *einf;

    state_window = NULL;
    if ( (einf = (EDITINFO *) malloc( sizeof(EDITINFO) )) == NULL)
	message(MP_ERROR, translate("Out of memory in edit."));
    else {
	if (!state_open)
	    if (!last_xpos && !last_ypos) {
		last_xpos = (display_width - last_width)/2;
		last_ypos = (display_height - last_height)/2;
	    }
	einf->xpos = last_xpos;
	einf->ypos = last_ypos;
	einf->width = last_width;
	einf->height = last_height;
	einf->saved = MP_True;
	einf->auto_saved = MP_True;
	einf->view_mode = MP_False;
	einf->empty = MP_True;
	einf->iconized  = MP_True;
	einf->shell = MP_False;
	einf->fini = MP_False;
	einf->strt = MP_False;
	einf->buflen=0;
	einf->pid=0;
	einf->prcsbuf=NULL;
	einf->win_id = XCreateWindow(display, root_window, einf->xpos,
				     einf->ypos, einf->width, einf->height,
				     BORDERWIDTH, CopyFromParent, InputOutput,
				     visual,
				     edit_mask, &edit_attr);
	if (state_open)
	    size_hints.flags = USPosition | USSize | PMinSize;
	else
	    size_hints.flags = PPosition | PSize | PMinSize;
	wm_hints.initial_state =
	    ((iconic || as_icon) ? IconicState : NormalState);
	size_hints.min_width =
	    size_hints.min_height = pos_y_with + SCROLLBARSIZE*3;
	XSetWMProperties(display, einf->win_id, NULL, NULL,
			 NULL, 0, &size_hints, &wm_hints, &class_hints);
	wm_hints.initial_state = NormalState;
	set_protocols(einf->win_id);

	i=0;
	einf->headername = NULL;
	einf->filename = NULL;
	einf->pathname = NULL;
	einf->outputname = NULL;
	if (set_name(einf, NULL) &&
	    add_window(einf->win_id, MAINEDITWINDOW,
		       root_window, (void *) einf, translate(helpname[EDITHELP]))) {
	    while (i<NR_BUTTON &&
		   button_make(i, einf->win_id, translate(editbutton[perm[i]]), &x, y, 1,
			       (void*) einf, helpname[edithelp[i]],
			       NULL, NULL, edit_handle_button,
			       edit_handle_button, edit_handle_button, NULL))
		i++,x+=BINTERSPACE;
	    w = sub_width(last_width);
	    h = sub_height(last_height);
	    if (i==NR_BUTTON) {
		einf->drawwin_id =
		    XCreateWindow(display, einf->win_id,
				  pos_x_with, pos_y_with, w-2, h-2, 1,
				  CopyFromParent, InputOutput,
				  visual,
				  edit_mask, &edit_attr);
		if (add_window(einf->drawwin_id, EDITWINDOW,
			       einf->win_id, NULL, translate(helpname[EDITSUBHELP])))
		    i++;
	    }
	    if (i==NR_BUTTON +1 &&
		(einf->scrollhor =
		 scrollbar_make(HORIZONTAL, einf->win_id, pos_x_with,
				pos_y_without, w, font_width(),
				edit_scrollto, (void*) einf)))
		i++;
	    if (i==NR_BUTTON+2 &&
		(einf->scrollver =
		 scrollbar_make(VERTICAL, einf->win_id, pos_x_without,
				pos_y_with, h, line_height(),
				edit_scrollto, (void*) einf)))
		i++;
	    
	}
	if (i<NR_BUTTON+3) {
	    free(einf->headername);
	    free(einf->pathname);
	    free(einf->filename);
	    XDestroyWindow(display, einf->win_id);
	    destroy_window(einf->win_id);
	} else {
	    is_opened = MP_True;
	    scrollbar_set(einf->scrollver, 0, 1);
	    scrollbar_set(einf->scrollhor, 0, 80);
	    move_selection = !as_icon;
	    einf->info = open_editwindow(&einf->drawwin_id, w-2, h-2);
	    move_selection = MP_False;
	    (void) window_changed(einf->info);
	    number_icon++;
	    number_open++;
	    edit_is_open = MP_True;
	    edit_iconized = (number_icon==number_open);
	    state_window = einf;
	    XMapSubwindows(display, einf->win_id);
	    XMapWindow(display, einf->win_id);
	}
    }
}
Beispiel #13
0
void create() {
    ::create();
   set_name("fulton");
   set_id( ({ "fulton" }) );
Beispiel #14
0
void create() {
    ::create();
  set_property("no trip", 1);
  set_name("falcon");
  set_id( ({"falcon","bird"}) );
Beispiel #15
0
void create() {
::create();
    set_name("city guard");
    set_short("%^RESET%^%^BLACK%^%^BOLD%^Zolenia%^RESET%^ city guard");
    set_long("Very slender yet muscular, this drow guards the city of Zolenia.  He is well equipped and ready to guard his city.");
    set_id(({"drow", "guard", "cityguard", "zolenia guard", "drow guard"}));
Beispiel #16
0
void create() {
    ::create();
    set_name("A Harp");
    set("id", ({"harp"}) );
Beispiel #17
0
static int notify(processor_t::idp_notify msgid, ...) { // Various messages:
  va_list va;
  va_start(va, msgid);

// A well behaving processor module should call invoke_callbacks()
// in his notify() function. If this function returns 0, then
// the processor module should process the notification itself
// Otherwise the code should be returned to the caller:

  int code = invoke_callbacks(HT_IDP, msgid, va);
  if ( code ) return code;


  switch(msgid)
  {
    case processor_t::init:
      inf.mf = 1;                                 // MSB first
    default:
      break;

    case processor_t::newfile:
      {

        segment_t *sptr = get_first_seg();
        if( sptr != NULL )
        {
          if( sptr->startEA - get_segm_base( sptr ) == 0 )
          {
            inf.beginEA = sptr->startEA + 0xC;
            inf.startIP = 0xC;

            for( int i = 0; i < qnumber(entries); i++ )
            {
              ea_t ea = sptr->startEA + entries[i].off;
              if( isEnabled(ea) )
              {
                doWord( ea, 2 );
// ig: set_op_type - внутренняя функция, ее нельзя использовать
//                set_op_type( ea, offflag(), 0 );
                set_offset( ea, 0, sptr->startEA );
                ea_t ea1 = sptr->startEA + get_word( ea );
                auto_make_proc( ea1 );
                set_name( ea, entries[i].name );
// ig: так получше будет?
                set_cmt( sptr->startEA+get_word(ea), entries[i].cmt, 1 );
              }
            }
          }

          set_segm_class( sptr, "CODE" );
        }

        segment_t s;
        ea_t bottom = toEA( inf.baseaddr, 0 );
        intmem       = s.startEA = freechunk( bottom, 256, 0xF );
        s.endEA      = s.startEA + 256;
        s.sel        = allocate_selector( s.startEA >> 4 );
        s.type       = SEG_IMEM;                    // internal memory
        add_segm_ex( &s, "INTMEM", NULL, ADDSEG_OR_DIE);

        const predefined_t *ptr;
        for( ptr = iregs; ptr->name != NULL; ptr++ )
        {
          ea_t ea = intmem + ptr->addr;
          ea_t oldea = get_name_ea( BADADDR, ptr->name );
          if( oldea != ea )
          {
            if( oldea != BADADDR )    set_name( oldea, NULL );
            do_unknown( ea, DOUNK_EXPAND );
            set_name( ea, ptr->name );
          }
          if( ptr->cmt != NULL )      set_cmt( ea, ptr->cmt, 1 );
        }
      }
      break;

    case processor_t::oldfile:
      sel_t sel;
      if( atos( "INTMEM", &sel) ) intmem = specialSeg(sel);
      break;

    case processor_t::newseg:
      {                 // default DS is equal to CS
        segment_t *sptr = va_arg(va, segment_t *);
        sptr->defsr[rVds-ph.regFirstSreg] = sptr->sel;
      }
  }
  va_end(va);

  return(1);
}
Beispiel #18
0
void create() {
    object money;
    ::create();
    set_name("slug");
    set_id( ({ "slug", "baby" }) );
Beispiel #19
0
/** Rename something.
 * \verbatim
 * This implements @name.
 * \endverbatim
 * \param player the enactor.
 * \param name current name of object to rename.
 * \param newname_ new name for object.
 */
void
do_name(dbref player, const char *name, char *newname_)
{
  dbref thing;
  char oldname[BUFFER_LEN];
  char *newname = NULL;
  char *alias = NULL;
  PE_REGS *pe_regs;

  if ((thing = match_controlled(player, name)) == NOTHING)
    return;

  /* check for bad name */
  if ((*newname_ == '\0') || strchr(newname_, '[')) {
    notify(player, T("Give it what new name?"));
    return;
  }
  switch (Typeof(thing)) {
  case TYPE_PLAYER:
    switch (
      ok_object_name(newname_, player, thing, TYPE_PLAYER, &newname, &alias)) {
    case OPAE_INVALID:
    case OPAE_NULL:
      notify(player, T("You can't give a player that name or alias."));
      if (newname)
        mush_free(newname, "name.newname");
      if (alias)
        mush_free(alias, "name.newname");
      return;
    case OPAE_TOOMANY:
      notify(player, T("Too many aliases."));
      mush_free(newname, "name.newname");
      return;
    case OPAE_SUCCESS:
      break;
    }
    break;
  case TYPE_EXIT:
    if (ok_object_name(newname_, player, thing, TYPE_EXIT, &newname, &alias) !=
        OPAE_SUCCESS) {
      notify(player, T("That is not a reasonable name."));
      if (newname)
        mush_free(newname, "name.newname");
      if (alias)
        mush_free(alias, "name.newname");
      return;
    }
    break;
  case TYPE_THING:
  case TYPE_ROOM:
    if (!ok_name(newname_, 0)) {
      notify(player, T("That is not a reasonable name."));
      return;
    }
    newname = mush_strdup(trim_space_sep(newname_, ' '), "name.newname");
    break;
  default:
    /* Should never occur */
    notify(player, T("I don't see that here."));
    return;
  }

  /* Actually change it */
  mush_strncpy(oldname, Name(thing), BUFFER_LEN);

  if (IsPlayer(thing)) {
    do_log(LT_CONN, 0, 0, "Name change by %s(#%d) to %s", Name(thing), thing,
           newname);
    if (Suspect(thing) && strcmp(Name(thing), newname) != 0)
      flag_broadcast("WIZARD", 0,
                     T("Broadcast: Suspect %s changed name to %s."),
                     Name(thing), newname);
    reset_player_list(thing, newname, alias);
  }
  set_name(thing, newname);
  if (alias) {
    if (*alias == ALIAS_DELIMITER) {
      do_set_atr(thing, "ALIAS", NULL, player, 0);
    } else {
      /* New alias to set */
      do_set_atr(thing, "ALIAS", alias, player, 0);
    }
    mush_free(alias, "name.newname");
  }

  queue_event(player, "OBJECT`RENAME", "%s,%s,%s", unparse_objid(thing),
              newname, oldname);

  if (!AreQuiet(player, thing))
    notify(player, T("Name set."));
  pe_regs = pe_regs_create(PE_REGS_ARG, "do_name");
  pe_regs_setenv_nocopy(pe_regs, 0, oldname);
  pe_regs_setenv_nocopy(pe_regs, 1, newname);
  real_did_it(player, thing, NULL, NULL, "ONAME", NULL, "ANAME", NOTHING,
              pe_regs, NA_INTER_PRESENCE, AN_SYS);
  pe_regs_free(pe_regs);
  mush_free(newname, "name.newname");
}
Beispiel #20
0
void create() {
::create();
    set_name("rat");
    set_short("a burning rat");
    set_long("This rat is completely engulfed in flames, however, they don't seem to be affecting him.  Small embers flick from his body into the air.");
    set_id(({"rat", "burning rat"}));
Beispiel #21
0
void ChatClient::requestUserList() {
    auto userListRequest = std::make_unique<UserListRequest>();
    userListRequest->set_name(clientName_);

    sendAnyMessage(MessageBuilder::build(std::move(userListRequest)));
}
Beispiel #22
0
void create() 
{ 
    ::create();  
        set_name("plain tunic");
        set_id( ({ "tunic", "plain tunic" }) );
Beispiel #23
0
void create() {
  ::create();
  set_name("princess");
  set("id",({"princess","lord","cassiopia","monster"}));
Beispiel #24
0
void create() {
  ::create();
  set_name("atlantian ambrosia");
  set_id(({"atlantian ambrosia","ambrosia","bottle","vial"}));
Beispiel #25
0
void create() {
::create();
    set_name("dragon");
    set_short("%^RESET%^%^BOLD%^a %^RED%^bloodied %^BLACK%^escapee %^WHITE%^baby dragon%^RESET%^");
    set_long("The black baby dragon has many bloodied wounds and scars.  He is very powerful looking for his size.");
    set_id(({"dragon", "escapee", "escapee3", "bloodied dragon"}));
Beispiel #26
0
void create() {
  ::create();
  set_name("angler fish");
  set_id(({"angler fish","fish","angler","light"}));
Beispiel #27
0
ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {

	editor = p_editor;
	set_name(TTR("Signals"));

	VBoxContainer *vbc = this;

	tree = memnew(Tree);
	tree->set_columns(1);
	tree->set_select_mode(Tree::SELECT_ROW);
	tree->set_hide_root(true);
	vbc->add_child(tree);
	tree->set_v_size_flags(SIZE_EXPAND_FILL);
	tree->set_allow_rmb_select(true);

	connect_button = memnew(Button);
	connect_button->set_text(TTR("Connect"));
	HBoxContainer *hb = memnew(HBoxContainer);
	vbc->add_child(hb);
	hb->add_spacer();
	hb->add_child(connect_button);
	connect_button->connect("pressed", this, "_connect_pressed");

	connect_dialog = memnew(ConnectDialog);
	connect_dialog->set_as_toplevel(true);
	add_child(connect_dialog);

	disconnect_all_dialog = memnew(ConfirmationDialog);
	disconnect_all_dialog->set_as_toplevel(true);
	add_child(disconnect_all_dialog);
	disconnect_all_dialog->connect("confirmed", this, "_disconnect_all");
	disconnect_all_dialog->set_text(TTR("Are you sure you want to remove all connections from this signal?"));

	signal_menu = memnew(PopupMenu);
	add_child(signal_menu);
	signal_menu->connect("id_pressed", this, "_handle_signal_menu_option");
	signal_menu->add_item(TTR("Connect..."), CONNECT);
	signal_menu->add_item(TTR("Disconnect All"), DISCONNECT_ALL);

	slot_menu = memnew(PopupMenu);
	add_child(slot_menu);
	slot_menu->connect("id_pressed", this, "_handle_slot_menu_option");
	slot_menu->add_item(TTR("Edit..."), EDIT);
	slot_menu->add_item(TTR("Go To Method"), GO_TO_SCRIPT);
	slot_menu->add_item(TTR("Disconnect"), DISCONNECT);

	/*
	node_only->set_anchor( MARGIN_TOP, ANCHOR_END );
	node_only->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
	node_only->set_anchor( MARGIN_RIGHT, ANCHOR_END );

	node_only->set_begin( Point2( 20,51) );
	node_only->set_end( Point2( 10,44) );
	*/

	connect_dialog->connect("connected", this, "_make_or_edit_connection");
	tree->connect("item_selected", this, "_tree_item_selected");
	tree->connect("item_activated", this, "_tree_item_activated");
	tree->connect("item_rmb_selected", this, "_rmb_pressed");

	add_constant_override("separation", 3 * EDSCALE);
}
Beispiel #28
0
void create(){
   ::create();
   set_name("sword");
   set_short("An elven longsword");
   set_id(({"sword", "longsword", "elven longsword"}));
Beispiel #29
0
void create() {
    ::create();
    set_name("dmg formula");
    set_id(({ "damage formula", "formula" }));
Beispiel #30
0
void create() {
  ::create();
  set_name(MYID);
  set_id( ({MYID}) );