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

C++ showmsg函数代码示例

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

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



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

示例1: test_local

/* test local file -----------------------------------------------------------*/
static int test_local(gtime_t ts, gtime_t te, double ti, const char *path,
                      const char *sta, const char *dir, int *nc, int *nt,
                      FILE *fp)
{
    gtime_t time;
    char remot[1024],remot_p[1024],dir_t[1024],local[1024],str[1024];
    int stat,abort=0;
    
    for (time=ts;timediff(time,te)<=1E-3;time=timeadd(time,ti)) {
        
        sprintf(str,"%s->%s",path,local);
        
        if (showmsg(str)) {
            abort=1;
            break;
        }
        genpath(path,sta,time,0,remot);
        genpath(dir ,sta,time,0,dir_t);
        remot2local(remot,dir_t,local);
        
        stat=test_file(local);
        
        fprintf(fp," %s",stat==0?"-":(stat==1?"o":"z"));
        
        showmsg("STAT=%s",stat==0?"x":(stat==1?"o":"z"));
        
        (*nt)++; if (stat) (*nc)++;
    }
    fprintf(fp,"\n");
    return abort;
}
开发者ID:Andreas-Krimbacher,项目名称:rtklib,代码行数:32,代码来源:download.c


示例2: lookup_keys

/** lookup all needed special keys not defined by ncurses */
void lookup_keys() {
    int not_ok = 0;

    key_kNXT3 = lookup_key("kNXT3");
    key_kPRV3 = lookup_key("kPRV3");
    key_kNXT5 = lookup_key("kNXT5");
    key_kPRV5 = lookup_key("kPRV5");

    if ((key_kNXT3 || key_kPRV3) == 0) {
	showmsg("Terminal does not support Alt-PgUp/PgDn keys");
	not_ok = 1;
    }

    if ((key_kNXT5 || key_kPRV5) == 0) {
	showmsg("Terminal does not support Ctrl-PgUp/PgDn keys");
	not_ok = 1;
    }

    if (not_ok == 1) {
	showmsg("See ':CQD' in man page for setting Auto_CQ delay");
	showmsg("");
	beep();
	sleep(2);
    }
}
开发者ID:wildj79,项目名称:tlf,代码行数:26,代码来源:ui_utils.c


示例3: hamlib_init

void hamlib_init() {

    int status;

    if (no_trx_control == 1) {
	trx_control = 0;
    }

    if (trx_control != 0) {

	shownr("Rignumber is", (int) myrig_model);
	shownr("Rig speed is", serial_rate);

	showmsg("Trying to start rig ctrl");

	status = init_tlf_rig();

	if (status  != 0) {
	    showmsg("Continue without rig control Y/(N)?");
	    if (toupper(key_get()) != 'Y') {
		endwin();
		exit(1);
	    }
	    trx_control = 0;
	    showmsg("Disabling rig control!");
	    sleep(1);
	}
    }
}
开发者ID:airween,项目名称:tlf,代码行数:29,代码来源:main.c


示例4: read_logcfg

int read_logcfg(void)
{
    extern int nodes;
    extern int node;
    extern char *config_file;

    char defltconf[80];

    int status = PARSE_OK;

    contest = 0;
    partials = 0;
    use_part = 0;
    keyerport = 0;
    portnum = 0;
    packetinterface = 0;
    tncport = 0;
    nodes = 0;
    node = 0;
    shortqsonr = 0;

    if (cabrillo != NULL) {
	free(cabrillo);
	cabrillo = NULL;
    }

    strcpy(defltconf, PACKAGE_DATA_DIR);
    strcat(defltconf, "/logcfg.dat");

    if (config_file == NULL)
	config_file = g_strdup("logcfg.dat");

    if ((fp = fopen(config_file, "r")) == NULL) {
	if ((fp = fopen(defltconf, "r")) == NULL) {
	    showmsg("Error opening logcfg.dat file.");
	    showmsg("Exiting...");
	    sleep(5);
	    endwin();
	    exit(1);
	} else {
	    showstring("Using (Read Only) file", defltconf);
	}

    } else
	showstring("Opening config file", config_file);

    while ( fgets(inputbuffer, 120, fp) != NULL ) {

	if ((inputbuffer[0] != '#') && (strlen(inputbuffer) > 1)) {
	    					/* skip comments and
						 * empty lines */
	    status |= parse_logcfg(inputbuffer);
	}
    }

    fclose(fp);

    return( status );
}
开发者ID:patlc,项目名称:tlf,代码行数:59,代码来源:parse_logcfg.c


示例5: dl_exec

/* execute download ------------------------------------------------------------
* execute download
* args   : gtime_t ts,te    I   time start and end
*          double tint      I   time interval (s)
*          int    seqnos    I   sequence number start
*          int    seqnoe    I   sequence number end
*          url_t  *urls     I   url address list
*          int    nurl      I   number of urls
*          char   **stas    I   station list
*          int    nsta      I   number of stations
*          char   *dir      I   local directory
*          char   *remote_p I   previous remote file path
*          char   *usr      I   login user for ftp
*          char   *pwd      I   login password for ftp
*          char   *proxy    I   proxy server address
*          int    opts      I   download options (or of the followings)
*                                 DLOPT_FORCE = force download existing file
*                                 DLOPT_KEEPCMP=keep compressed file
*                                 DLOPT_HOLDERR=hold on error file
*                                 DLOPT_HOLDLST=hold on listing file
*          char   *msg      O   output messages
*          FILE   *fp       IO  log file pointer (NULL: no output log)
* return : status (1:ok,0:error,-1:aborted)
* notes  : urls should be read by using dl_readurl()
*-----------------------------------------------------------------------------*/
extern int dl_exec(gtime_t ts, gtime_t te, double ti, int seqnos, int seqnoe,
                   const url_t *urls, int nurl, char **stas, int nsta,
                   const char *dir, const char *usr, const char *pwd,
                   const char *proxy, int opts, char *msg, FILE *fp)
{
    paths_t paths={0};
    gtime_t ts_p={0};
    char str[2048],remot_p[1024]="";
    int i,n[4]={0};
    unsigned int tick=tickget();
    
    showmsg("STAT=_");
    
    /* generate download paths  */
    while (timediff(ts,te)<1E-3) {
        
        for (i=0;i<nurl;i++) {
            if (!gen_paths(ts,ts_p,seqnos,seqnoe,urls+i,stas,nsta,dir,&paths)) {
                free_path(&paths);
                return 0;
            }
        }
        ts_p=ts; ts=timeadd(ts,ti);
    }
    /* compact download paths */
    compact_paths(&paths);
    
    if (paths.n<=0) {
        sprintf(msg,"no download data");
        return 0;
    }
    for (i=0;i<paths.n;i++) {
        
        sprintf(str,"%s->%s (%d/%d)",paths.path[i].remot,paths.path[i].local,i+1,
                paths.n);
        if (showmsg(str)) break;
        
        /* execute download */
        if (exec_down(paths.path+i,remot_p,usr,pwd,proxy,opts,n,fp)) {
            break;
        }
    }
    if (!(opts&DLOPT_HOLDLST)) {
        remove(FTP_LISTING);
    }
    sprintf(msg,"OK=%d No_File=%d Skip=%d Error=%d (Time=%.1f s)",n[0],n[1],n[2],
            n[3],(tickget()-tick)*0.001);
    
    free_path(&paths);
    
    return 1;
}
开发者ID:Andreas-Krimbacher,项目名称:rtklib,代码行数:77,代码来源:download.c


示例6: checkbrk

/* show message and check break ----------------------------------------------*/
static int checkbrk(const char *format, ...)
{
    va_list arg;
    char buff[1024],*p=buff;
    if (!*format) return showmsg("");
    va_start(arg,format);
    p+=vsprintf(p,format,arg);
    va_end(arg);
    if (*proc_rov&&*proc_base) sprintf(p," (%s-%s)",proc_rov,proc_base);
    else if (*proc_rov ) sprintf(p," (%s)",proc_rov );
    else if (*proc_base) sprintf(p," (%s)",proc_base);
    return showmsg(buff);
}
开发者ID:idaohang,项目名称:rtk-streamserver,代码行数:14,代码来源:postpos.c


示例7: lan_init

void lan_init() {
    if (lan_active == 1) {
	if (lanrecv_init() < 0)	/* set up the network */
	    showmsg("LAN receive  init failed");
	else
	    showmsg("LAN receive  initialized");

	if (lan_send_init() < 0)
	    showmsg("LAN send init failed");
	else
	    showmsg("LAN send initialized");
    }
}
开发者ID:airween,项目名称:tlf,代码行数:13,代码来源:main.c


示例8: openses

/* open procssing session ----------------------------------------------------*/
static int openses(const prcopt_t *popt, const solopt_t *sopt,
                   const filopt_t *fopt, nav_t *nav, pcvs_t *pcvs, pcvs_t *pcvr)
{
    char *ext;
    
    trace(3,"openses :\n");
    
    /* read satellite antenna parameters */
    if (*fopt->satantp&&!(readpcv(fopt->satantp,pcvs))) {
        showmsg("error : no sat ant pcv in %s",fopt->satantp);
        trace(1,"sat antenna pcv read error: %s\n",fopt->satantp);
        return 0;
    }
    /* read receiver antenna parameters */
    if (*fopt->rcvantp&&!(readpcv(fopt->rcvantp,pcvr))) {
        showmsg("error : no rec ant pcv in %s",fopt->rcvantp);
        trace(1,"rec antenna pcv read error: %s\n",fopt->rcvantp);
        return 0;
    }
    /* read dcb parameters */
    if (*fopt->dcb) {
        readdcb(fopt->dcb,nav);
    }
    /* read ionosphere data file */
    if (*fopt->iono&&(ext=strrchr(fopt->iono,'.'))) {
        if (strlen(ext)==4&&(ext[3]=='i'||ext[3]=='I')) {
            readtec(fopt->iono,nav,0);
        }
#ifdef EXTSTEC
        else if (!strcmp(ext,".stec")||!strcmp(ext,".STEC")) {
            stec_read(fopt->iono,nav);
        }
#endif
    }
    /* open geoid data */
    if (sopt->geoid>0&&*fopt->geoid) {
        if (!opengeoid(sopt->geoid,fopt->geoid)) {
            showmsg("error : no geoid data %s",fopt->geoid);
            trace(2,"no geoid data %s\n",fopt->geoid);
        }
    }
    /* read erp data */
    if (*fopt->eop) {
        if (!readerp(fopt->eop,&nav->erp)) {
            showmsg("error : no erp data %s",fopt->eop);
            trace(2,"no erp data %s\n",fopt->eop);
        }
    }
    return 1;
}
开发者ID:idaohang,项目名称:rtk-streamserver,代码行数:51,代码来源:postpos.c


示例9: showstat

/* show status message -------------------------------------------------------*/
static int showstat(int sess, gtime_t ts, gtime_t te, int *n)
{
    const char type[]="ONGHQLSE";
    char msg[1024]="",*p=msg,s[64];
    int i;
    
    if (sess>0) {
        p+=sprintf(p,"(%d) ",sess);
    }
    if (ts.time!=0) {
        time2str(ts,s,0);
        p+=sprintf(p,"%s",s);
    }
    if (te.time!=0&&timediff(te,ts)>0.9) {
        time2str(te,s,0);
        p+=sprintf(p,"-%s",s+5);
    }
    p+=sprintf(p,": ");
    
    for (i=0;i<NOUTFILE+1;i++) {
        if (n[i]==0) continue;
        p+=sprintf(p,"%c=%d%s",type[i],n[i],i<NOUTFILE?" ":"");
    }
    return showmsg(msg);
}
开发者ID:idaohang,项目名称:rtk-streamserver,代码行数:26,代码来源:convrnx.c


示例10: describekeybriefly

int
describekeybriefly(UNUSED(char **args))
{
    char *seq, *str, *msg, *is;
    Thingy func;

    if (statusline)
	return 1;
    clearlist = 1;
    statusline = "Describe key briefly: _";
    zrefresh();
    seq = getkeymapcmd(curkeymap, &func, &str);
    statusline = NULL;
    if(!*seq)
	return 1;
    msg = bindztrdup(seq);
    msg = appstr(msg, " is ");
    if (!func)
	is = bindztrdup(str);
    else
	is = nicedup(func->nam, 0);
    msg = appstr(msg, is);
    zsfree(is);
    showmsg(msg);
    zsfree(msg);
    return 0;
}
开发者ID:xyzy,项目名称:mips-zsh_5.2,代码行数:27,代码来源:zle_main.c


示例11: Complain

/** Complain about problems in configuration
 *
 * Complains in standout mode about some problem. Beep and wait for
 * 2 seconds
 *
 * \param msg  The reason for the problem to be shown
 */
void Complain(char *msg) {
    attron(A_STANDOUT);
    showmsg(msg);
    attroff(A_STANDOUT);
    confirmation_needed = PARSE_CONFIRM;
    beep();
}
开发者ID:patlc,项目名称:tlf,代码行数:14,代码来源:parse_logcfg.c


示例12: ParseReturnErrorComponent

int
ParseReturnErrorComponent(struct Aoc *chanp, u_char *p, u_char *end, int dummy)
{
	int invokeId;
	int errorValue;
	char error[80];
	INIT;

	XSEQUENCE_1(ParseInvokeId, ASN1_TAG_INTEGER, ASN1_NOT_TAGGED, &invokeId);
	XSEQUENCE_1(ParseErrorValue, ASN1_TAG_INTEGER, ASN1_NOT_TAGGED, &errorValue);

	switch (errorValue) {
	case 0: sprintf(error, "not subscribed"); break;
	case 3: sprintf(error, "not available"); break;
	case 4: sprintf(error, "not implemented"); break;
	case 6: sprintf(error, "invalid served user nr"); break;
	case 7: sprintf(error, "invalid call state"); break;
	case 8: sprintf(error, "basic service not provided"); break;
	case 9: sprintf(error, "not incoming call"); break;
	case 10: sprintf(error, "supplementary service interaction not allowed"); break;
	case 11: sprintf(error, "resource unavailable"); break;
	case 12: sprintf(error, "invalid diverted-to nr"); break;
	case 14: sprintf(error, "special service nr"); break;
	case 15: sprintf(error, "diversion to served user nr"); break;
	case 23: sprintf(error, "incoming call accepted"); break;
	case 24: sprintf(error, "number of diversions exceeded"); break;
	case 46: sprintf(error, "not activated"); break;
	case 48: sprintf(error, "request already accepted"); break;
	default: sprintf(error, "(%d)", errorValue); break;
	}
	showmsg("ReturnError: %s\n", error);

	return p - beg;
}
开发者ID:marschap,项目名称:isdn4k-utils,代码行数:34,代码来源:asn1_comp.c


示例13: convrnx

/* rinex converter -------------------------------------------------------------
* convert receiver log file to rinex obs/nav, sbas log files
* args   : int    format I      receiver raw format (STRFMT_???)
*          rnxopt_t *opt IO     rinex options (see below)
*          char   *file  I      rtcm, receiver raw or rinex file
*                               (wild-cards (*) are expanded)
*          char   **ofile IO    output files
*                               ofile[0] rinex obs file   ("": no output)
*                               ofile[1] rinex nav file   ("": no output)
*                               ofile[2] rinex gnav file  ("": no output)
*                               ofile[3] rinex hnav file  ("": no output)
*                               ofile[4] rinex qnav file  ("": no output)
*                               ofile[5] rinex lnav file  ("": no output)
*                               ofile[6] sbas/lex log file("": no output)
* return : status (1:ok,0:error,-1:abort)
* notes  : the following members of opt are replaced by information in last
*          converted rinex: opt->tstart, opt->tend, opt->obstype, opt->nobs
*          keywords in ofile[] are replaced by first obs date/time and station
*          id (%r)
*          the order of wild-card expanded files must be in-order by time
*-----------------------------------------------------------------------------*/
extern int convrnx(int format, rnxopt_t *opt, const char *file, char **ofile)
{
    gtime_t t0={0};
    rnxopt_t opt_=*opt;
    double tu,ts;
    int i,week,stat=1;
    
    trace(3,"convrnx: format=%d file=%s ofile=%s %s %s %s %s %s %s\n",
          format,file,ofile[0],ofile[1],ofile[2],ofile[3],ofile[4],ofile[5],
          ofile[6]);
    
    showmsg("");
    
    if (opt->ts.time==0||opt->te.time==0||opt->tunit<=0.0) {
        
        /* single-session */
        opt_.tstart=opt_.tend=t0;
        stat=convrnx_s(0,format,&opt_,file,ofile);
    }
    else if (timediff(opt->ts,opt->te)<=0.0) {
        
        /* multiple-session */
        tu=opt->tunit<86400.0?opt->tunit:86400.0;
        ts=tu*(int)floor(time2gpst(opt->ts,&week)/tu);
        
        for (i=0;;i++) { /* for each session */
            opt_.ts=gpst2time(week,ts+i*tu);
            opt_.te=timeadd(opt_.ts,tu-DTTOL-0.001);
            opt_.trtcm=timeadd(opt->trtcm,timediff(opt_.ts,opt->ts));
            if (timediff(opt_.ts,opt->te)>0.0) break;
            
            if (timediff(opt_.ts,opt->ts)<0.0) opt_.ts=opt->ts;
            if (timediff(opt_.te,opt->te)>0.0) opt_.te=opt->te;
            opt_.tstart=opt_.tend=t0;
            if ((stat=convrnx_s(i+1,format,&opt_,file,ofile))<0) break;
        }
    }
    else {
        showmsg("no period");
        return 0;
    }
    /* output start/end time */
    opt->tstart=opt_.tstart; opt->tend=opt_.tend;
    
    return stat;
}
开发者ID:HoughtonAssoc,项目名称:rtklib-mops,代码行数:67,代码来源:convrnx.c


示例14: repair_log

/** Repair log file
 *
 * Try to repair log file if some limes are too short.
 * Same is used to convert old logfile format v1 to new v2 
 *
 * \return 0 on success
 */
int repair_log(char *filename) {

    gchar *backupfile;
    gchar *cmd;
    char buffer[200];
    gchar *fill;
    int rc;
    FILE *infp;
    FILE *outfp;

    /* make a backup of the original file */
    backupfile = g_strconcat(filename, ".bak", NULL);
    showstring ( "Backing up original file as: ", backupfile);

    cmd = g_strconcat("cp ", filename, " ", backupfile, NULL);
    rc = system(cmd);
    g_free(cmd);

    showmsg( "Converting file to new format");
    infp = fopen(backupfile, "r");
    outfp = fopen(filename, "w");

    while (fgets(buffer, sizeof(buffer), infp)) {

	/* strip trailing whitespace (and newline) */
	g_strchomp(buffer);

	/* append spaces */
	fill = g_strnfill( (LOGLINELEN-1) - strlen(buffer), ' ' );
	strcat(buffer, fill);
	g_free(fill);

	fputs(buffer, outfp);
	fputs("\n", outfp);
    }

    fclose(outfp);
    fclose(infp);

    g_free(backupfile);

    showmsg( "Done" );
    sleep(2);

    return 0;
}
开发者ID:patlc,项目名称:tlf,代码行数:53,代码来源:checklogfile.c


示例15: keyer_init

void keyer_init() {
    char keyerbuff[3];

    if (cwkeyer == NET_KEYER) {
	showmsg("CW-Keyer is cwdaemon");

	if (netkeyer_init() < 0) {
	    showmsg("Cannot open NET keyer daemon ");
	    refreshp();
	    sleep(1);

	} else {
	    netkeyer(K_RESET, "0");

	    sprintf(weightbuf, "%d", weight);

	    write_tone();

	    snprintf(keyerbuff, 3, "%2d", GetCWSpeed());
	    netkeyer(K_SPEED, keyerbuff);		// set speed

	    netkeyer(K_WEIGHT, weightbuf);		// set weight

	    if (*keyer_device != '\0')
		netkeyer(K_DEVICE, keyer_device);	// set device

	    sprintf(keyerbuff, "%d", txdelay);
	    netkeyer(K_TOD, keyerbuff);		// set TOD

	    if (sc_sidetone != 0)			// set soundcard output
		netkeyer(K_SIDETONE, "");

	    if (*sc_volume != '\0')			// set soundcard volume
		netkeyer(K_STVOLUME, sc_volume);
	}

    }

    if (cwkeyer == MFJ1278_KEYER || digikeyer == MFJ1278_KEYER ||
	    digikeyer == GMFSK) {
	init_controller();
    }

}
开发者ID:airween,项目名称:tlf,代码行数:44,代码来源:main.c


示例16: trace

/* generate stream file ------------------------------------------------------*/
static strfile_t *gen_strfile(int format, const char *opt, gtime_t time)
{
    strfile_t *str;
    
    trace(3,"init_strfile:\n");
    
    if (!(str=(strfile_t *)malloc(sizeof(strfile_t)))) return NULL;
    
    if (format==STRFMT_RTCM2||format==STRFMT_RTCM3) {
        if (!init_rtcm(&str->rtcm)) {
            showmsg("init rtcm error");
            return 0;
        }
        str->rtcm.time=time;
        str->obs=&str->rtcm.obs;
        str->nav=&str->rtcm.nav; 
        strcpy(str->rtcm.opt,opt);
    }
    else if (format<=MAXRCVFMT) {
        if (!init_raw(&str->raw)) {
            showmsg("init raw error");
            return 0;
        }
        str->raw.time=time;
        str->obs=&str->raw.obs;
        str->nav=&str->raw.nav;
        str->pvt=&str->raw.pvt;
        strcpy(str->raw.opt,opt);
    }
    else if (format==STRFMT_RINEX) {
        if (!init_rnxctr(&str->rnx)) {
            showmsg("init rnx error");
            return 0;
        }
        str->obs=&str->rnx.obs;
        str->nav=&str->rnx.nav;
        strcpy(str->rnx.opt,opt);
    }
    str->format=format;
    str->sat=0;
    str->fp=NULL;
    str->time=time;
    return str;
}
开发者ID:REC-SPb-ETU,项目名称:RTKLIB,代码行数:45,代码来源:convrnx.c


示例17: mgv_unmangle

/*
 * Uncompress a file and return the new file name, if the file doesn't
 * appear to be compressed or the uncompression fails, the original
 * file name will be returned.  In all cases, the return value is
 * allocated with XtNewString().
 *
 * We use "system()" in here to avoid the hassle of converting the
 * decompression commands from strings to argv's but this means that
 * some kludging is needed to grab the error output.  This would be
 * "cleaner" (in some sense) if pipe/dup2/fork/exec/XtAppAddInput
 * were used instead but sometimes laziness is good.
 */
char *
mgv_unmangle(MGV *m, char *file)
{
#	define  CMD_FMT "%s <%s >%s 2>%s"
	char    *cmd, *out, *tmp, *s;
	int     t, cmd_size;
	MGV_APP *r = mgv_appres(m->main);

	if((t = filetype(file)) == FT_NORM
	|| (tempdir == NULL && !mk_tmp(r->temp_dir)))
		return XtNewString(file);

	if((s = strrchr(file, '/')) == NULL)
		s = file;
	else
		++s;

	out = XtCalloc(strlen(tempdir) + 1 + strlen(s) + 1 + 64 + 1, 1);
	tmp = XtCalloc(strlen(tempdir) + 1 + 64 + 1 + 1, 1);

	sprintf(out, "%s/%s.%ld.%d", tempdir, s,
				(long)XtWindow(m->main), m->inst_num);
	sprintf(tmp, "%s/%ld.%d", tempdir, (long)getpid(), m->inst_num);

	cmd_size = strlen(file) + strlen(out) + strlen(tmp) + sizeof(CMD_FMT);

	switch(t) {
	case FT_GZIP:
		cmd = XtCalloc(cmd_size + strlen(r->gunzip), 1);
		sprintf(cmd, "%s <%s >%s 2>%s", r->gunzip, file, out, tmp);
		break;
	case FT_BZIP:
		cmd = XtCalloc(cmd_size + strlen(r->bunzip), 1);
		sprintf(cmd, "%s <%s >%s 2>%s", r->bunzip, file, out, tmp);
		break;
	default:
		assert("mgv_unmangle(): confused by file type!" != NULL);
		XtFree(out);
		XtFree(tmp);
		return XtNewString(file);
		break;
	}

	errno = 0;
	if(system(cmd) != 0 && errno != 0) {
		XtFree(out);
		out = XtNewString(file);
	}
	showmsg(m, file, &tmp[0]);

	XtFree(tmp);
	XtFree(cmd);

	return out;
#	undef CMD_FMT
}
开发者ID:idunham,项目名称:dtextra,代码行数:68,代码来源:unmangle.c


示例18: readpreceph

/* read prec ephemeris, sbas data, lex data, tec grid and open rtcm ----------*/
static void readpreceph(char **infile, int n, const prcopt_t *prcopt,
                        nav_t *nav, sbs_t *sbs, lex_t *lex)
{
    seph_t seph0={0};
    int i;
    char *ext;
    
    trace(3,"readpreceph: n=%d\n",n);
    
    nav->ne=nav->nemax=0;
    nav->nc=nav->ncmax=0;
    sbs->n =sbs->nmax =0;
    lex->n =lex->nmax =0;
    
    /* read precise ephemeris files */
    for (i=0;i<n;i++) {
        if (strstr(infile[i],"%r")||strstr(infile[i],"%b")) continue;
        readsp3(infile[i],nav,0);
    }
    /* read precise clock files */
    for (i=0;i<n;i++) {
        if (strstr(infile[i],"%r")||strstr(infile[i],"%b")) continue;
        readrnxc(infile[i],nav);
    }
    /* read sbas message files */
    for (i=0;i<n;i++) {
        if (strstr(infile[i],"%r")||strstr(infile[i],"%b")) continue;
        sbsreadmsg(infile[i],prcopt->sbassatsel,sbs);
    }
    /* read lex message files */
    for (i=0;i<n;i++) {
        if (strstr(infile[i],"%r")||strstr(infile[i],"%b")) continue;
        lexreadmsg(infile[i],0,lex);
    }
    /* allocate sbas ephemeris */
    nav->ns=nav->nsmax=NSATSBS*2;
    if (!(nav->seph=(seph_t *)malloc(sizeof(seph_t)*nav->ns))) {
         showmsg("error : sbas ephem memory allocation");
         trace(1,"error : sbas ephem memory allocation");
         return;
    }
    for (i=0;i<nav->ns;i++) nav->seph[i]=seph0;
    
    /* set rtcm file and initialize rtcm struct */
    rtcm_file[0]=rtcm_path[0]='\0'; fp_rtcm=NULL;
    
    for (i=0;i<n;i++) {
        if ((ext=strrchr(infile[i],'.'))&&
            (!strcmp(ext,".rtcm3")||!strcmp(ext,".RTCM3"))) {
            strcpy(rtcm_file,infile[i]);
            init_rtcm(&rtcm);
            break;
        }
    }
}
开发者ID:idaohang,项目名称:rtk-streamserver,代码行数:56,代码来源:postpos.c


示例19: antpos

/* antenna phase center position ---------------------------------------------*/
static int antpos(prcopt_t *opt, int rcvno, const obs_t *obs, const nav_t *nav,
                  const sta_t *sta, const char *posfile)
{
    double *rr=rcvno==1?opt->ru:opt->rb,del[3],pos[3],dr[3]={0};
    int i,postype=rcvno==1?opt->rovpos:opt->refpos;
    char *name;
    
    trace(3,"antpos  : rcvno=%d\n",rcvno);
    
    if (postype==1) { /* average of single position */
        if (!avepos(rr,rcvno,obs,nav,opt)) {
            showmsg("error : station pos computation");
            return 0;
        }
    }
    else if (postype==2) { /* read from position file */
        name=stas[rcvno==1?0:1].name;
        if (!getstapos(posfile,name,rr)) {
            showmsg("error : no position of %s in %s",name,posfile);
            return 0;
        }
    }
    else if (postype==3) { /* get from rinex header */
        if (norm(stas[rcvno==1?0:1].pos,3)<=0.0) {
            showmsg("error : no position in rinex header");
            trace(1,"no position position in rinex header\n");
            return 0;
        }
        /* antenna delta */
        if (stas[rcvno==1?0:1].deltype==0) { /* enu */
            for (i=0;i<3;i++) del[i]=stas[rcvno==1?0:1].del[i];
            del[2]+=stas[rcvno==1?0:1].hgt;
            ecef2pos(stas[rcvno==1?0:1].pos,pos);
            enu2ecef(pos,del,dr);
        }
        else { /* xyz */
            for (i=0;i<3;i++) dr[i]=stas[rcvno==1?0:1].del[i];
        }
        for (i=0;i<3;i++) rr[i]=stas[rcvno==1?0:1].pos[i]+dr[i];
    }
    return 1;
}
开发者ID:idaohang,项目名称:rtk-streamserver,代码行数:43,代码来源:postpos.c


示例20: showmsg

void
showmsg(int m, int rflag)
{
	long addr, len;
	int n, f, c, nl;
	uchar *ip; char *sp, *cp;

	if(m <= 0 || m > ncnotes){
Bad:
		fprint(2, "no footnote %d\n", m);
		return;
	}
	ip = &findex[8*(m-1)];
	addr = LONG(ip);
	len = SHORT(ip+4);
	if(len == 0)
		goto Bad;
	Read(msg, addr, len);
	if(m > nfnotes && rflag){
		cp = sp = malloc(len);
		memcpy(cp, msg, len);
		n = strtol(cp, &cp, 10);
		while(--n >= 0){
			f = strtol(cp, &cp, 10);
			if(f > 0)
				showmsg(f, 0);
		}
		free(sp);
		return;
	}
	Bprint(out, "%d\t", m);
	ip = msg; nl = 0;
	while(ip<&msg[len]){
		switch(c = *ip++){
		case 0:
		case '\r':
			break;
		case '\n':
			BPUTC(out, c);
			++nl;
			break;
		default:
			if(nl){
				BPUTC(out, '\t');
				nl = 0;
			}
			BPUTC(out, c);
			break;
		}
	}
	for(; nl<2; nl++)
		BPUTC(out, '\n');
}
开发者ID:kahrs,项目名称:cda,代码行数:53,代码来源:notes.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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