Example #1
0
static int cmd_sym_load_add(int clear, char **arg)
{
	FILE *in;
	char * path;

	if (clear && prompt_abort(MODIFY_SYMS))
		return 0;

	path = expand_tilde(*arg);
	if (!path)
		return -1;

	in = fopen(path, "rb");
	free(path);
	if (!in) {
		printc_err("sym: %s: %s\n", *arg, last_error());
		return -1;
	}

	if (clear) {
		stab_clear();
		unmark_modified(MODIFY_SYMS);
	} else {
		mark_modified(MODIFY_SYMS);
	}

	if (binfile_syms(in) < 0) {
		fclose(in);
		return -1;
	}

	fclose(in);

	return 0;
}
Example #2
0
  /**
   * Modify the char attribute assigning
   * the new given char value to attributes
   * reference.
   *
   * @param attr Pointer to character string to change.
   * @param max_size The maximum capacity of the destinition array.
   * @param val New stringto set.
   * @param size The length of the new string.
   * @throw std::logic_error.
   */
  void modify(char *attr, int max_size, const char *val, int size)
  {
    if (max_size < size) {
      throw std::logic_error("not enough character size");
    }
    mark_modified();
#ifdef WIN32
    strcpy_s(attr, max_size, val);
#else
    strcpy(attr, val);
#endif
  }
Example #3
0
 /**
  * Modify a varchar_base attribute assigning
  * the new given value to attributes reference.
  *
  * @param attr Refernce to varchar_base to change.
  * @param val New value for varchar_base.
  */
 void modify(varchar_base &attr, const varchar_base &val)
 {
   mark_modified();
   attr = val;
 }
Example #4
0
 /**
  * Modify a varchar_base attribute assigning
  * the new given value to attributes reference.
  *
  * @param attr Refernce to varchar_base to change.
  * @param val New value for varchar_base.
  */
 void modify(varchar_base &attr, const std::string &val)
 {
   mark_modified();
   attr = val;
 }
Example #5
0
 void modify(oos::object_ref<T> &attr, const oos::object_ptr<T> &val)
 {
   mark_modified();
   attr = val;
 }
Example #6
0
 void modify(T &attr, const T &val)
 {
   mark_modified();
   attr = val;
 }