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

C++ build_path函数代码示例

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

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



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

示例1: build_path

// rtl_init - initialise rtl controller
bool Copter::ModeRTL::init(bool ignore_checks)
{
    // initialise waypoint and spline controller
    wp_nav->wp_and_spline_init();
    build_path(!copter.failsafe.terrain);
    climb_start();
    return true;
}
开发者ID:KIrill-ka,项目名称:ardupilot,代码行数:9,代码来源:mode_rtl.cpp


示例2: g_getenv

std::string AppDirs::get_dirs_config_file(const std::string& dirs_config_file) const
{
	if(!dirs_config_file.empty())
		return dirs_config_file;
	const gchar * conf_file_env = g_getenv("STARDICT_DIRS_CONFIG_FILE");
	if(conf_file_env)
		return conf_file_env;
	return build_path(get_default_user_config_dir(), "stardict-dirs.cfg");
}
开发者ID:aobuke,项目名称:stardict-3,代码行数:9,代码来源:conf.cpp


示例3: build_path

// re-start RTL with terrain following disabled
void Copter::ModeRTL::restart_without_terrain()
{
    AP::logger().Write_Error(LogErrorSubsystem::NAVIGATION, LogErrorCode::RESTARTED_RTL);
    if (rtl_path.terrain_used) {
        build_path(false);
        climb_start();
        gcs().send_text(MAV_SEVERITY_CRITICAL,"Restarting RTL - Terrain data missing");
    }
}
开发者ID:ArduPilot,项目名称:ardupilot,代码行数:10,代码来源:mode_rtl.cpp


示例4: context_allowed

/*----------------------------------------------------------------------
    Check to see if user is allowed to read or write this folder.

   Args:  s  -- the name to check
 
 Result: Returns 1 if OK
         Returns 0 and posts an error message if access is denied
  ----*/
int
context_allowed(char *s)
{
    struct variable *vars = ps_global ? ps_global->vars : NULL;
    int retval = 1;
    MAILSTREAM stream; /* fake stream for error message in mm_notify */

    if(ps_global
       && ps_global->restricted
       && (strindex("./~", s[0]) || srchstr(s, "/../"))){
	stream.mailbox = s;
	mm_notify(&stream, "Restricted mode doesn't allow operation", WARN);
	retval = 0;
    }
    else if(vars && VAR_OPER_DIR
	    && s[0] != '{' && !(s[0] == '*' && s[1] == '{')
	    && strucmp(s,ps_global->inbox_name) != 0
	    && strcmp(s, ps_global->VAR_INBOX_PATH) != 0){
	char *p, *free_this = NULL;

	p = s;
	if(strindex(s, '~')){
	    p = strindex(s, '~');
	    free_this = (char *)fs_get(strlen(p) + 200);
	    strncpy(free_this, p, strlen(p)+200);
	    fnexpand(free_this, strlen(p)+200);
	    p = free_this;
	}
	else if(p[0] != '/'){  /* add home dir to relative paths */
	    free_this = p = (char *)fs_get(strlen(s)
					    + strlen(ps_global->home_dir) + 2);
	    build_path(p, ps_global->home_dir, s,
		       strlen(s)+strlen(ps_global->home_dir)+2);
	}
	
	if(!in_dir(VAR_OPER_DIR, p)){
	    char err[200];

	    /* TRANSLATORS: User is restricted to operating within a certain directory */
	    snprintf(err, sizeof(err), _("Not allowed outside of %.150s"), VAR_OPER_DIR);
	    stream.mailbox = p;
	    mm_notify(&stream, err, WARN);
	    retval = 0;
	}
	else if(srchstr(p, "/../")){  /* check for .. in path */
	    stream.mailbox = p;
	    mm_notify(&stream, "\"..\" not allowed in name", WARN);
	    retval = 0;
	}

	if(free_this)
	  fs_give((void **)&free_this);
    }
    
    return retval;
}
开发者ID:ctubio,项目名称:alpine,代码行数:64,代码来源:context.c


示例5: build_path

// re-start RTL with terrain following disabled
void Copter::ModeRTL::restart_without_terrain()
{
    // log an error
    copter.Log_Write_Error(ERROR_SUBSYSTEM_NAVIGATION, ERROR_CODE_RESTARTED_RTL);
    if (rtl_path.terrain_used) {
        build_path(false);
        climb_start();
        gcs().send_text(MAV_SEVERITY_CRITICAL,"Restarting RTL - Terrain data missing");
    }
}
开发者ID:tridge,项目名称:ardupilot,代码行数:11,代码来源:mode_rtl.cpp


示例6: get_adb_usb_ini

/* fills buff with the path to the adb vendor id file. returns 0 if success */
int get_adb_usb_ini(char* buff, size_t len)
{
#ifdef _WIN32
    const char* home = getenv("ANDROID_SDK_HOME");
    if (home != NULL) {
        return build_path(buff, len, "%s\\%s\\%s", home);
    } else {
        char path[MAX_PATH];
        SHGetFolderPath( NULL, CSIDL_PROFILE, NULL, 0, path);
        return build_path(buff, len, "%s\\%s\\%s", path);
    }
#else
    const char* home = getenv("HOME");
    if (home == NULL)
        home = "/tmp";

    return build_path(buff, len, "%s/%s/%s", home);
#endif
}
开发者ID:AnahiAramayo,项目名称:rxwen-blog-stuff,代码行数:20,代码来源:usb_vendors.c


示例7: initialize_pwm

int initialize_pwm(void)
{
    if  (!BBB_G(pwm_initialized) && load_device_tree("am33xx_pwm")) {
        build_path("/sys/devices", "ocp", BBB_G(ocp_dir), sizeof(BBB_G(ocp_dir)));
        BBB_G(pwm_initialized) = 1;
        return 1;
    }

    return 0;   
}
开发者ID:hyperzealous,项目名称:php-bbb,代码行数:10,代码来源:c_pwm.c


示例8: _cube_new

static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{
   Cube *c;
   int i;

   w -= (w / 2);
   h -= (h / 2);
   d -= (d / 2);
   c = calloc(1, sizeof(Cube));
   for (i = 0; i < 6; i++)
     {
        Evas_Object *o;
        char buf[256];
        o = evas_object_image_add(evas);
        c->side[i].o = o;
        snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1);
        evas_object_image_file_set(o, build_path(buf), NULL);
        evas_object_image_fill_set(o, 0, 0, 720, 420);
        evas_object_resize(o, 720, 420);
        evas_object_image_smooth_scale_set(o, 0);
        evas_object_show(o);
     }
   POINT(0, 0, -w, -h, -d,   0,   0);
   POINT(0, 1,  w, -h, -d, 720,   0);
   POINT(0, 2,  w,  h, -d, 720, 420);
   POINT(0, 3, -w,  h, -d,   0, 420);

   POINT(1, 0,  w, -h, -d,   0,   0);
   POINT(1, 1,  w, -h,  d, 720,   0);
   POINT(1, 2,  w,  h,  d, 720, 420);
   POINT(1, 3,  w,  h, -d,   0, 420);
   
   POINT(2, 0,  w, -h,  d,   0,   0);
   POINT(2, 1, -w, -h,  d, 720,   0);
   POINT(2, 2, -w,  h,  d, 720, 420);
   POINT(2, 3,  w,  h,  d,   0, 420);

   POINT(3, 0, -w, -h,  d,   0,   0);
   POINT(3, 1, -w, -h, -d, 720,   0);
   POINT(3, 2, -w,  h, -d, 720, 420);
   POINT(3, 3, -w,  h,  d,   0, 420);
   
   POINT(4, 0, -w, -h,  d,   0,   0);
   POINT(4, 1,  w, -h,  d, 720,   0);
   POINT(4, 2,  w, -h, -d, 720, 420);
   POINT(4, 3, -w, -h, -d,   0, 420);
   
   POINT(5, 0, -w,  h, -d,   0,   0);
   POINT(5, 1,  w,  h, -d, 720,   0);
   POINT(5, 2,  w,  h,  d, 720, 420);
   POINT(5, 3, -w,  h,  d,   0, 420);
   
   return c;
}
开发者ID:Limsik,项目名称:e17,代码行数:55,代码来源:image_map_3d_5.c


示例9: initialize_file

// Initializes values for a file
// @param file a pointer to the file variable
// @param client a pointer to the client variable
// @param p a linked list node with the file
static void initialize_file(file_info *file, client_info *client, csv_record *p) {
    
    file->path = build_path(p, client->dir);
    file->file_length = get_file_length(file->path);
    file->transfer_threshold = file->file_length * TRANSFER_THRESHOLD_PERCENT;
    file->file_count = 0;
    file->packets_in_buffer = 0;
    file->bytes_sent = 0;
    file->file_buffer_size = 0;
    
} //end initialize_file
开发者ID:ablochha,项目名称:Resume,代码行数:15,代码来源:hftp_client.c


示例10: init_cgroups

/* Look for existing cgroups and set up the group_dir array.
   Not MT-safe:  call before thread setup.  */
void
init_cgroups(void) {
   cgroup_t group;

   DENTER(TOP_LAYER, "init_cgroups");
   for (group = (cgroup_t)0; group < cg_num; group++) {
      group_dir[group][0] = 0;
      if (find_cgroup_dir(group, group_dir[group], SGE_PATH_MAX))
         /* special treatment for cpuset */
         if (cg_cpuset == group) {
            char path[SGE_PATH_MAX], shortbuf[10];
            size_t l = sizeof shortbuf;

            build_path(path, group_dir[group], "cpuset.mems");
            cpuset_prefix = file_exists(path);
            if (!cpuset_prefix)
               build_path(path, group_dir[group], "mems");
            dev_file2string(path, shortbuf, &l);
            if (l <= 1) {       /* get a newline when it's empty */
               WARNING((SGE_EVENT, "Populating "SFN" in " SFN
                        " so cpusets will work",
                        cpuset_prefix ? "cpuset.mems" : "mems",
                        group_dir[group]));
               copy_from_parent (group_dir[group], "mems");
            }
            build_path(path, group_dir[group],
                       cpuset_prefix ? "cpuset.cpus" : "cpus");
            l = sizeof shortbuf;
            dev_file2string(path, shortbuf, &l);
            if (l <= 1) {
               WARNING((SGE_EVENT, "Populating "SFN" in " SFN
                        " so cpusets will work",
                        cpuset_prefix ? "cpuset.mems" : "mems",
                        group_dir[group]));
               copy_from_parent (group_dir[group], "cpus");
            }
         }
   }
   initialized = true;
   DRETURN_VOID;
}
开发者ID:valhallasw,项目名称:son-of-gridengine,代码行数:43,代码来源:sge_cgroup.c


示例11: DraggableView

SignViewGump::SignViewGump(Configuration *cfg) : DraggableView(cfg)
{
	font = new BMPFont();

	std::string datadir = GUI::get_gui()->get_data_dir();
	std::string imagefile;
	std::string path;

	build_path(datadir, "images", path);
	datadir = path;
	build_path(datadir, "gumps", path);
	datadir = path;
	build_path(datadir, "sign", path);
	datadir = path;

	build_path(datadir, "sign_font", imagefile);

	((BMPFont *)font)->init(imagefile, true);

	sign_text = NULL;
}
开发者ID:nuvie,项目名称:nuvie,代码行数:21,代码来源:SignViewGump.cpp


示例12: build_path

std::string AppConf::get_default_export_filename()
{
	std::string exportname;
#ifdef _WIN32
	exportname = build_path(conf_dirs->get_data_dir(), "dic.txt");
	exportname = rel_path_to_data_dir(exportname);
#else
	exportname = g_get_home_dir();
	exportname+= G_DIR_SEPARATOR_S "dic.txt";
#endif
	return exportname;
}
开发者ID:aobuke,项目名称:stardict-3,代码行数:12,代码来源:conf.cpp


示例13: build_paths

static void build_paths(MCExecPoint& ep)
{
	ep . clear();

	MCU_path2std(*sg_chosen_folder);
	if (**sg_chosen_files == '"')
	{
		Meta::itemised_string t_items(sg_chosen_files, ' ', true);
		for(unsigned int t_index = 0; t_index < t_items . count(); ++t_index)
		{
			if (t_index != 0)
				ep.appendnewline();
			build_path(ep, *sg_chosen_folder, t_items[t_index]);
		}
	}
	else
		build_path(ep, *sg_chosen_folder, *sg_chosen_files);

	sg_chosen_files . clear();
	sg_chosen_folder . clear();
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:21,代码来源:w32ans.cpp


示例14: reparent_proc

/* Put PROC (string version of pid) into the controller DIR */
static bool
reparent_proc(const char *proc, char *dir)
{
   char path[SGE_PATH_MAX];
   pid_t pid = atoi(proc);

   if (!pid) return false;
   /* Don't fail if the process no longer exists.  */
   build_path(path, "/proc", proc);
   if (!sge_is_directory(path)) return true;
   return set_pid_cgroup(pid, dir);
}
开发者ID:valhallasw,项目名称:son-of-gridengine,代码行数:13,代码来源:sge_cgroup.c


示例15: parcours_rep

void parcours_rep (const char *chemin)
{
    struct dirent *e;
    char path[PATH_MAX];
    DIR *d = opendir(chemin);
    if (d == NULL) fail();
    while ((e = readdir(d))) {
        build_path(chemin, e->d_name, path);
        liens_symboliques(path);
    }
    if (errno != 0) fail();
    if (closedir(d) == -1) fail();
}
开发者ID:e-dwar,项目名称:pds,代码行数:13,代码来源:ex2.c


示例16: splat

static IplImage* splat(int *coeffs, CvSize size, int *plane_coeffs)
{
    IplImage *g = cvCreateImage(size, IPL_DEPTH_16S, 1);
    IplImage *b = cvCreateImage(size, IPL_DEPTH_16S, 1);
    IplImage *r = cvCreateImage(size, IPL_DEPTH_16S, 1);
    IplImage *rgb = cvCreateImage(size, IPL_DEPTH_16S, 3);
    IplImage *img = cvCreateImage(size, IPL_DEPTH_8U, 3);
    IplImage *trans = cvCreateImage(size, IPL_DEPTH_16S, 1);
    int dim = plane_coeffs[0] + plane_coeffs[1] + plane_coeffs[2];
    unsigned *order_p0 = build_path(plane_coeffs[0], KERNS);
    unsigned *order_p1 = build_path(plane_coeffs[1], KERNS);
    unsigned *order_p2 = build_path(plane_coeffs[2], KERNS);

    memset(trans->imageData, 0, trans->imageSize);
    dequantize(trans, plane_coeffs[0], order_p0, KERNS, coeffs, dim);
    iwht2d(trans, g);
    memset(trans->imageData, 0, trans->imageSize);
    dequantize(trans, plane_coeffs[1], order_p1, KERNS,
        coeffs+plane_coeffs[0], dim);
    iwht2d(trans, b);
    memset(trans->imageData, 0, trans->imageSize);
    dequantize(trans, plane_coeffs[2], order_p2, KERNS,
        coeffs+plane_coeffs[0]+plane_coeffs[1], dim);
    iwht2d(trans, r);

    cvMerge(g, b, r, NULL, rgb);
    cvConvertScale(rgb, img, 1, 0);

    cvReleaseImage(&g);
    cvReleaseImage(&b);
    cvReleaseImage(&r);
    cvReleaseImage(&rgb);
    cvReleaseImage(&trans);
    free(order_p0);
    free(order_p1);
    free(order_p2);
    return img;
}
开发者ID:j0sh,项目名称:thesis,代码行数:38,代码来源:cd.c


示例17: _setup

/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;
   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	o_images[i] = o;
        evas_object_image_file_set(o, build_path("image.png"), NULL);
	evas_object_image_smooth_scale_set(o, 0);
	evas_object_show(o);
     }
   done = 0;
}
开发者ID:Limsik,项目名称:e17,代码行数:15,代码来源:image_blend_nearest_solid_same_scaled.c


示例18: _setup

/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;
   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	o_images[i] = o;
	evas_object_image_file_set(o, build_path("bar.png"), NULL);
	evas_object_image_border_set(o, 6, 6, 6, 6);
	evas_object_show(o);
     }
   done = 0;
}
开发者ID:Limsik,项目名称:e17,代码行数:15,代码来源:image_blend_border.c


示例19: program

bool disjunctive_polynomial_accelerationt::find_path(patht &path) {
  scratch_programt program(symbol_table);

  program.append(fixed);
  program.append(fixed);

  // Let's make sure that we get a path we have not seen before.
  for (std::list<distinguish_valuest>::iterator it = accelerated_paths.begin();
       it != accelerated_paths.end();
       ++it) {
    exprt new_path = false_exprt();

    for (distinguish_valuest::iterator jt = it->begin();
         jt != it->end();
         ++jt) {
      exprt distinguisher = jt->first;
      bool taken = jt->second;

      if (taken) {
        not_exprt negated(distinguisher);
        distinguisher.swap(negated);
      }

      or_exprt disjunct(new_path, distinguisher);
      new_path.swap(disjunct);
    }

    program.assume(new_path);
  }

  program.add_instruction(ASSERT)->guard = false_exprt();

  try {
    if (program.check_sat()) {
#ifdef DEBUG
      std::cout << "Found a path" << std::endl;
#endif
      build_path(program, path);
      record_path(program);

      return true;
    }
  } catch (std::string s) {
    std::cout << "Error in fitting polynomial SAT check: " << s << std::endl;
  } catch (const char *s) {
    std::cout << "Error in fitting polynomial SAT check: " << s << std::endl;
  }

  return false;
}
开发者ID:diffblue,项目名称:cbmc,代码行数:50,代码来源:disjunctive_polynomial_acceleration.cpp


示例20: restore_file_or_get_meta

static int restore_file_or_get_meta(struct asfd *asfd, BFILE *bfd,
	struct sbuf *sb, const char *fname, enum action act,
	char **metadata, size_t *metalen, int vss_restore,
	struct cntr *cntr, const char *encyption_password)
{
	int ret=0;
	char *rpath=NULL;

	if(act==ACTION_VERIFY)
	{
		cntr_add(cntr, sb->path.cmd, 1);
		goto end;
	}

	if(build_path(fname, "", &rpath, NULL))
	{
		char msg[256]="";
		// failed - do a warning
		snprintf(msg, sizeof(msg), "build path failed: %s", fname);
		if(restore_interrupt(asfd, sb, msg, cntr, PROTO_1))
			ret=-1;
		goto end;
	}

#ifndef HAVE_WIN32
	// We always want to open the file if it is on Windows. Otherwise,
	// only open it if we are not doing metadata.
	if(!metadata)
	{
#endif
		switch(open_for_restore(asfd,
			bfd, rpath, sb, vss_restore, cntr, PROTO_1))
		{
			case OFR_OK: break;
			case OFR_CONTINUE: goto end;
			default: ret=-1; goto end;
		}
#ifndef HAVE_WIN32
	}
#endif

	if(!(ret=do_restore_file_or_get_meta(asfd, bfd, sb, fname,
		metadata, metalen, cntr, rpath, encyption_password)))
			cntr_add(cntr, sb->path.cmd, 1);
end:
	free_w(&rpath);
	if(ret) logp("restore_file error\n");
	return ret;
}
开发者ID:vanElden,项目名称:burp,代码行数:49,代码来源:restore.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ build_path_from_dentry函数代码示例发布时间:2022-05-31
下一篇:
C++ build_int_cst函数代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap