亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? util.c

?? disksim是一個非常優秀的磁盤仿真工具
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* libparam (version 1.0) * Authors: John Bucy, Greg Ganger * Contributors: John Griffin, Jiri Schindler, Steve Schlosser * * Copyright (c) of Carnegie Mellon University, 2001-2008. * * This software is being provided by the copyright holders under the * following license. By obtaining, using and/or copying this * software, you agree that you have read, understood, and will comply * with the following terms and conditions: * * Permission to reproduce, use, and prepare derivative works of this * software is granted provided the copyright and "No Warranty" * statements are included with all reproductions and derivative works * and associated documentation. This software may also be * redistributed without charge provided that the copyright and "No * Warranty" statements are included in all redistributions. * * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH * RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT * INFRINGEMENT.  COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY USE * OF THIS SOFTWARE OR DOCUMENTATION.   */#include <stdlib.h>#include <stdio.h>#include <ctype.h>#include <stdlib.h>#include <string.h>#include <libddbg/libddbg.h>#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <unistd.h>#include <fcntl.h>#include <libgen.h>#include "libparam.h"#include "bitvector.h"static lp_topoloader_t topoloader = 0;void lp_register_topoloader(lp_topoloader_t l) {  topoloader = l;}char *lp_builtin_names[] = {  0,  "Block",  "String",  "Int",  "Double",  "List",   "Topospec"};// FILE *libparamin = 0;struct lp_subtype **lp_typetbl;int lp_typetbl_len;struct lp_tlt **lp_tlts;int lp_tlts_len;//extern char lp_filename[];//extern char lp_cwd[];char **lp_searchpath = 0;int lp_searchpath_len = 0;extern int lp_lineno;static void destroy_block(struct lp_block *b);static void destroy_value(struct lp_value *v);static void destroy_param(struct lp_param *p);static void destroy_list(struct lp_list *l);static void destroy_topospec(struct lp_topospec *t);int dumb_split(char *s, char **t, int *i);int dumb_split2(char *s, char **s1, char **s2);static int lp_max_mod = 0;static int lp_mod_size = 0;struct lp_mod **lp_modules = 0;static char **overrides = 0;static int overrides_len = 0;#define outputfile stdoutstruct lp_value *lp_new_intv(int i) {  struct lp_value *v = calloc(1, sizeof(struct lp_value));  v->v.i = i;  v->t = I;  return v;}struct lp_value *lp_new_doublev(double d) {  struct lp_value *v = calloc(1, sizeof(struct lp_value));  v->v.d = d;  v->t = D;  return v;}struct lp_value *lp_new_stringv(char *s) {  struct lp_value *v = calloc(1, sizeof(struct lp_value));  v->v.s = s;  v->t = S;  return v;}struct lp_value *lp_new_listv(struct lp_list *l){  struct lp_value *v = calloc(1, sizeof(struct lp_value));  v->v.l = l;  v->t = LIST;  return v;}struct lp_value *lp_new_blockv(struct lp_block *b){  struct lp_value *v = calloc(1, sizeof(struct lp_value));  v->v.b = b;  v->t = b->type;  return v;}struct lp_param *lp_new_param(char *name, char *source, struct lp_value *v){  struct lp_param *result = calloc(1, sizeof(struct lp_param));  result->source_file = source;  result->name = name;  result->v = v;    return result;}struct lp_list *lp_new_list(void) {  struct lp_list *l = calloc(1, sizeof(struct lp_list));  l->values = calloc(8, sizeof(struct lp_value *));  l->values_len = 8;  l->values_pop = 0;  l->linelen = 1;  return l;}struct lp_block *lp_new_block(void){  struct lp_block *b = calloc(1, sizeof(struct lp_block));  b->params = calloc(8, sizeof(struct lp_param *));  b->params_len = 8;  return b;}struct lp_list *lp_new_intlist(int *intarr, int len){  int i;  struct lp_list *l = lp_new_list();  for(i = 0; i < len; i++) {    lp_list_add(l, lp_new_intv(intarr[i]));  }  return l;}int lp_register_module(struct lp_mod *m) {  int c;  for(c = 0; c < lp_max_mod; c++) {    if(!strcmp(m->name, lp_modules[c]->name)) {      return -1;    }  }  if(c >= lp_mod_size) {    lp_mod_size *= 2; lp_mod_size++;    lp_modules = realloc(lp_modules, lp_mod_size * sizeof(int *));  }  if(c > 0)     lp_modules[c] = m;  else     lp_modules[0] = m;  lp_max_mod++;  return c;}static void die(char *msg) {  fprintf(stderr, "*** error: FATAL: %s\n", msg);  exit(1);}static void destroy_param(struct lp_param *p){  free(p->name);  destroy_value(p->v);  free(p);}static void destroy_list(struct lp_list *l) {  int c;  for(c = 0; c < l->values_len; c++)    if(l->values[c])      destroy_value(l->values[c]);  free(l->values);  free(l);}static void destroy_value(struct lp_value *v) {  int d;  switch(v->t) {  case S:    free(v->v.s);     break;      case LIST:    destroy_list(v->v.l);    break;      case I:   case D: break;  case TOPOSPEC:    for(d = 0; d < v->v.t.len; d++)      destroy_topospec(&v->v.t.l[d]);    free(v->v.t.l);    break;        default:    destroy_block(v->v.b);  }  free(v);}static void destroy_block(struct lp_block *b) {  int c;  for(c = 0; c < b->params_len; c++) {    if(b->params[c]) {      destroy_param(b->params[c]);    }   }  free(b->name);  free(b->params);  free(b);}static void destroy_topospec(struct lp_topospec *t){  free(t->type);  free(t->name);  destroy_list(t->l);}static struct lp_block *copy_block(struct lp_block *);static struct lp_list *copy_list(struct lp_list *);static struct lp_value *copy_value(struct lp_value *);static struct lp_param *copy_param(struct lp_param *);static struct lp_block *copy_block(struct lp_block *b){  int c;  struct lp_block *result = calloc(1, sizeof(*result));  memcpy(result, b, sizeof(struct lp_block));  result->params = calloc(b->params_len, sizeof(result->params[0]));  if(b->name) {    result->name = strdup(b->name);  }  for(c = 0; c < b->params_len; c++) {    if(b->params[c]) {      result->params[c] = copy_param(b->params[c]);    }  }  return result;}static struct lp_list *copy_list(struct lp_list *l) {  int c;  struct lp_list *result = calloc(1, sizeof(*result));  memcpy(result, l, sizeof(struct lp_list));  result->values = calloc(l->values_len, sizeof(result->values[0]));  memcpy(result->values, l->values, l->values_len * sizeof(int *));  for(c = 0; c < l->values_len; c++) {    if(l->values[c]) {      result->values[c] = copy_value(l->values[c]);    }  }  return result;}static struct lp_value *copy_value(struct lp_value *v) {  struct lp_value *result = calloc(1, sizeof(struct lp_value));  memcpy(result, v, sizeof(struct lp_value));  switch(v->t) {  case S:    result->v.s = strdup(v->v.s);    break;  case LIST:    result->v.l = copy_list(v->v.l);    break;  case BLOCK:    result->v.b = copy_block(v->v.b);    break;  default:    break;  }    return result;}static struct lp_param *copy_param(struct lp_param *p) {  struct lp_param *result = calloc(1, sizeof(struct lp_param));  result->name = strdup(p->name);  result->v = copy_value(p->v);  return result;}static int indent_level = 0;static void indent(FILE *f) {  char *space = calloc(1, 3*indent_level+1);  memset(space, (int)' ', 3*indent_level);  space[3*indent_level] = 0;  fprintf(f, "%s", space);  free(space);}void unparse_source(char *source, FILE *outfile) {  fprintf(outfile, "source %s", source);}void unparse_type(int t, FILE *outfile) {  if(t < 0) {    fprintf(outfile, "%s", lp_builtin_names[abs(t)]);  }  else {    if(t > lp_max_mod) {      fprintf(outfile, "<UNKNOWN TYPE>");    }    else {      fprintf(outfile, "%s", lp_modules[t]->name);    }  }}void unparse_param(struct lp_param *p, FILE *outfile) {  fprintf(outfile, "%s = ", p->name);  if(p->source_file && p->v->source_file) {    if(strcmp(p->source_file, p->v->source_file)) {      unparse_source(p->v->source_file, outfile);      return;    }  }  unparse_value(p->v, outfile);}void unparse_value(struct lp_value *v, FILE *outfile) {  int c;  switch(v->t) {  case I:    fprintf(outfile, "%d", v->v.i);    break;  case D:    if(v->v.d == 0.0) {      fprintf(outfile, "0.0");    }    else {      fprintf(outfile, "%f", v->v.d);    }    break;  case S:    fprintf(outfile, "%s", v->v.s);    break;  case LIST:    unparse_list(v->v.l, outfile);    break;  case TOPOSPEC:    for(c = 0; c < v->v.t.len; c++)      unparse_topospec(&v->v.t.l[c], outfile);    break;  default:  case BLOCK:    unparse_block(v->v.b, outfile);    break;  }}void unparse_list(struct lp_list *l, FILE *outfile) {  int printed = 0;  int c;/*    indent(outfile); */  fprintf(outfile, "[ ");  indent_level++;  for(c = 0; c < l->values_len; c++) {     if(!l->values[c])       continue;    if(c) {      fprintf(outfile, ", ");      if(!(c % l->linelen)) {	fprintf(outfile, "\n");	indent(outfile);      }    }    else {      fprintf(outfile, "\n");      indent(outfile);    }    printed++;    unparse_value(l->values[c], outfile);  }  indent_level--;  if((c > 0) && printed) {    fprintf(outfile, "\n");    indent(outfile);  }  fprintf(outfile, "]");}void unparse_block(struct lp_block *b, FILE *outfile) {  int c;/*    indent(outfile); */  if(b->name) {    /* a block definition */    fprintf(outfile, "%s %s {\n", lp_modules[b->type]->name, b->name);  }  else {    /* a block value */    fprintf(outfile, "%s {\n", lp_modules[b->type]->name);  }  indent_level++;  for(c = 0; c < b->params_len; c++) {    if(!b->params[c]) continue;    if(c) fprintf(outfile, ",\n");    unparse_param(b->params[c], outfile);  }  indent_level--;  fprintf(outfile, "\n");  indent(outfile);  fprintf(outfile, "}");  if(b->name) {    fprintf(outfile, " # end of %s spec", b->name);    fprintf(outfile, "\n\n");  }}void unparse_topospec(struct lp_topospec *t, FILE *outfile) {  fprintf(outfile, "%s %s ", t->type, t->name);  unparse_list(t->l, outfile);  // unparse_list() prints a trailing newline...  //  fprintf(outputfile, "\n"); }// somewhat of a hackvoid unparse_tl_topospec(struct lp_topospec *t, FILE *outfile) {  fprintf(outfile, "topospec ");  unparse_topospec(t, outfile);  fprintf(outfile, "\n\n");}void unparse_inst(struct lp_inst *i, FILE *outfile) {  fprintf(outfile, "instantiate ");  unparse_list(i->l, outfile);  fprintf(outfile, " as %s\n\n", i->name);}void unparse_tlt(struct lp_tlt *tlt, FILE *outfile, char *infile) {  if(tlt->source_file && infile) {    if(strcmp(tlt->source_file, infile)) {      unparse_source(tlt->source_file, outfile);      return;    }  }    switch(tlt->what) {  case TLT_BLOCK: unparse_block(tlt->it.block, outfile); break;  case TLT_TOPO:  unparse_tl_topospec(tlt->it.topo, outfile); break;  case TLT_INST:  unparse_inst(tlt->it.inst, outfile); break;  default:        ddbg_assert(0); break;  };  }void lp_unparse_tlts(struct lp_tlt **tlts, 		     int tlts_len, 		     FILE *outfile, 		     char *infile) {  int c;  for(c = 0; c < tlts_len; c++) {    if(tlts[c] != 0) {      unparse_tlt(tlts[c], outfile, infile);    }  }}/* instantiate all the elements of <l> as <name> */int lp_inst_list(struct lp_inst *i){  int c;    /*      unparse_block(spec, outputfile); */  for(c = 0; c < i->l->values_len; c++) {    if(!i->l->values[c]) continue;        ddbg_assert3(i->l->values[c]->t == S, 	       ("bad type for component %s", i->l->values[c]->v.s));        lp_instantiate(i->l->values[c]->v.s, i->name);  }    return 0;}/* instantiate <targ> as <name> */int *lp_instantiate(char *targ, char *name) {  char *nametmp;  struct lp_block *spec;  int *obj;    /*    unparse_block(b, outputfile); */  spec = lp_lookup_spec(name);  ddbg_assert3(spec != 0, ("no such type %s.\n", name));  // this is a bit of a hack; we swap the name of the component  // being instantiated with the name of the module that's being  // instantiated so that the loader function sees the target  // name  nametmp = spec->name;  spec->name = targ;    //  fprintf(stderr, "*** Instantiating %s as %s\n", targ, name);  obj = lp_override_inst(spec, 			 targ,			 lp_modules[spec->type]->fn,			 overrides, 			 overrides_len);  // swap the name back  spec->name = nametmp;  if(!obj) {    return 0;  }    if(lp_modules[spec->type]->callback) {    lp_modules[spec->type]->callback(lp_modules[spec->type]->ctx, obj);  }  return obj;}/* 0 on success, nonzero on error */int check_types(struct lp_block *b) {  int c = 0;  /* we'll do all of the type checking here so that    * the per-mod loaders only have to sanitize values */  for(c = 0; c < b->params_len; c++) {    if(b->params[c]) {      if(lp_param_name(b->type, b->params[c]->name) == -1) {	fprintf(stderr, "*** warning: parameter %s not valid in context %s\n",		b->params[c]->name, lp_modules[b->type]->name);	      }      else if(lp_modules[b->type]->modvars[lp_param_name(b->type, b->params[c]->name)].type	 != PTYPE(b->params[c])) {	/* implicitly convert ints to doubles */	if((lp_modules[b->type]->modvars[lp_param_name(b->type, b->params[c]->name)].type	    == D)	   && (PTYPE(b->params[c]) == I)) {	  b->params[c]->v->t = D;	  DVAL(b->params[c]) = (double) IVAL(b->params[c]);	}	  	else { 	  fprintf(stderr, "*** error: type error: %s::\"%s\" cannot take type ",		  lp_modules[b->type]->name,		  b->params[c]->name);	  /*  	  unparse_type(PTYPE(b->params[c]), stderr); */	  fprintf(stderr, "\n");	  die("check_types() failed");	}      }            if(PTYPE(b->params[c]) >= BLOCK) {	check_types(BVAL(b->params[c]));      }      else if(PTYPE(b->params[c]) == LIST) {	int d;	struct lp_list *l = LVAL(b->params[c]);	for(d = 0; d < l->values_len; d++) {	  if(l->values[d]) {	    if(l->values[d]->t >= BLOCK) {	      check_types(l->values[d]->v.b);	    }	  }	}      }    }  }  return 0;}void load_block(struct lp_block *b) {  int n;  lp_lookup_type(b->name, &n);  lp_typetbl[n]->spec = b;}void load_topo(struct lp_topospec *t, int len) {/*    unparse_topospec(t, outputfile); */  topoloader(t, len);}void printvars(void) {  int c, d;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本久久电影网| 亚洲色图在线看| 亚洲欧美偷拍另类a∨色屁股| 丝袜美腿亚洲综合| www.欧美色图| 欧美精品一区视频| 人人精品人人爱| 欧美色综合网站| 国产精品福利av| 国产剧情一区在线| 欧美一级一区二区| 婷婷综合五月天| 日本精品免费观看高清观看| 国产日韩精品一区| 国内精品国产三级国产a久久 | 日韩美女视频一区| 国产在线不卡一区| 欧美一区二区久久| 亚洲成人av资源| 欧美亚日韩国产aⅴ精品中极品| 国产精品理论片| 国产不卡在线一区| 久久久99久久| 国产一区激情在线| 26uuuu精品一区二区| 男男成人高潮片免费网站| 3751色影院一区二区三区| 亚洲综合小说图片| 欧美在线一区二区三区| 亚洲精品日韩一| 色系网站成人免费| 亚洲精品综合在线| 色94色欧美sute亚洲线路一久| 最新日韩av在线| 99re热这里只有精品免费视频| 国产精品毛片久久久久久| 风间由美中文字幕在线看视频国产欧美| 久久婷婷国产综合国色天香| 麻豆91免费观看| 精品国产91亚洲一区二区三区婷婷| 日产精品久久久久久久性色| 91精品国产综合久久香蕉麻豆| 奇米色一区二区| 精品国产91久久久久久久妲己 | 99精品欧美一区二区蜜桃免费| 中文字幕av免费专区久久| www.久久精品| 亚洲主播在线播放| 777a∨成人精品桃花网| 精品夜夜嗨av一区二区三区| 国产日韩欧美制服另类| 一本色道久久综合亚洲精品按摩| 亚洲精品国产无天堂网2021| 欧美精品自拍偷拍| 极品瑜伽女神91| 国产精品传媒视频| 欧美日韩不卡一区二区| 精品一区二区三区在线视频| 国产精品天美传媒| 欧美日韩电影在线| 黑人巨大精品欧美一区| 国产精品第13页| 制服.丝袜.亚洲.另类.中文| 国产呦精品一区二区三区网站| 国产精品久久久一区麻豆最新章节| 欧美中文字幕一区二区三区 | jvid福利写真一区二区三区| 亚洲天堂精品视频| 日韩欧美国产1| 99这里只有精品| 久久国产精品色| 中文字幕一区二区三区在线观看| 欧美日韩精品欧美日韩精品 | 欧美日韩午夜影院| 国产成人在线视频网址| 亚洲综合男人的天堂| 久久综合色综合88| 欧美性色aⅴ视频一区日韩精品| 久久99国产精品麻豆| 中文字幕一区二区三区精华液 | 狠狠色丁香婷综合久久| 亚洲精品国产a久久久久久| 欧美精品一区二| 精品视频在线免费看| 成人免费视频国产在线观看| 视频一区视频二区中文| 国产精品九色蝌蚪自拍| 精品欧美一区二区在线观看| 欧美丝袜丝交足nylons图片| 国产精品一级片| 人人超碰91尤物精品国产| 自拍偷拍亚洲综合| 久久久久久久久久电影| 日韩欧美三级在线| 欧美日韩色综合| 在线一区二区观看| 成人aaaa免费全部观看| 国产伦精一区二区三区| 亚洲福利电影网| 亚洲综合久久久| 亚洲人成在线播放网站岛国| 国产嫩草影院久久久久| 久久综合成人精品亚洲另类欧美| 欧美一区二区性放荡片| 日本乱人伦一区| 一本一道综合狠狠老| 99久久久精品| 91碰在线视频| aa级大片欧美| 91麻豆精品在线观看| 91丨国产丨九色丨pron| 成人精品视频网站| 成人动漫一区二区| 97精品电影院| 色综合视频一区二区三区高清| 99久久婷婷国产| 白白色亚洲国产精品| 99精品欧美一区二区三区小说| 99久久久免费精品国产一区二区| 99综合影院在线| 色老头久久综合| 精品视频在线免费| 91精品国产麻豆国产自产在线| 欧美精品xxxxbbbb| 日韩一区二区三区视频在线观看| 日韩午夜三级在线| 欧美大片国产精品| 久久久久一区二区三区四区| 欧美国产一区视频在线观看| 国产精品免费久久| 亚洲精品成人a在线观看| 亚洲va欧美va人人爽午夜| 蜜臀国产一区二区三区在线播放 | 日韩精品一二三四| 麻豆国产欧美日韩综合精品二区 | 久久疯狂做爰流白浆xx| 久久99最新地址| 成人午夜视频在线观看| 99久久99久久综合| 欧美日韩一区二区三区免费看| 5566中文字幕一区二区电影| 欧美不卡视频一区| 最新日韩av在线| 日本在线不卡视频一二三区| 韩日av一区二区| 91视视频在线观看入口直接观看www | 久久综合色之久久综合| 国产精品国产a| 日韩电影网1区2区| 成人性生交大片免费看中文| 欧美色国产精品| 精品国产电影一区二区| 亚洲天堂久久久久久久| 麻豆精品一区二区三区| 成人小视频在线| 91精品综合久久久久久| 久久久久久亚洲综合影院红桃| 一区二区三区欧美视频| 加勒比av一区二区| 欧美视频中文字幕| 国产日产欧美一区二区视频| 亚洲影视在线观看| 狠狠色狠狠色合久久伊人| 在线观看日韩av先锋影音电影院| 欧美电影免费提供在线观看| 国产精品久久免费看| 久久精品国内一区二区三区| 色88888久久久久久影院按摩 | 成人自拍视频在线| 欧美日韩国产另类一区| 国产精品视频一二三区| 青青青爽久久午夜综合久久午夜| 91在线一区二区三区| 久久午夜电影网| 视频一区视频二区中文| 色网综合在线观看| 日韩一区在线播放| 国产suv一区二区三区88区| 欧美理论电影在线| 亚洲精品视频观看| jizz一区二区| 久久久久高清精品| 激情综合色综合久久| 91精品中文字幕一区二区三区| 亚洲人成影院在线观看| av欧美精品.com| 国产精品久久久久天堂| 国产精品白丝av| 久久久久久久久免费| 久久狠狠亚洲综合| 欧美一级国产精品| 丝袜美腿成人在线| 欧美三级中文字| 亚洲资源在线观看| 欧美在线free| 亚洲乱码精品一二三四区日韩在线| av电影在线不卡| 亚洲男人的天堂av| 一本色道久久综合亚洲精品按摩| 专区另类欧美日韩|