//----------------------------------------------------------------------------- struct mac_data_req rlc_am_mac_data_request_on_second_channel (void *rlcP) { //----------------------------------------------------------------------------- struct mac_data_req data_req; // from TS25.322 V4.2.0 p13 // In case two logical channels are configured in the uplink, AMD PDUs are transmitted // on the first logical channel, and control PDUs are transmitted on the second logical // channel. In case two logical channels are configured in the downlink, AMD and Control // PDUs can be transmitted on any of the two logical channels. #ifdef NODE_RG rlc_am_get_pdus (rlcP, RLC_AM_TRAFFIC_ALLOWED_FOR_STATUS | RLC_AM_TRAFFIC_ALLOWED_FOR_DATA); #else rlc_am_get_pdus (rlcP, RLC_AM_TRAFFIC_ALLOWED_FOR_STATUS); #endif list_init (&data_req.data, NULL); list_add_list (&((struct rlc_am_entity *) rlcP)->pdus_to_mac_layer_ch2, &data_req.data); #ifdef DEBUG_RLC_AM_TX msg ("[RLC_AM][RB %d] MAC_DATA_REQUEST (CONTROL) %d TBs\n", ((struct rlc_am_entity *) rlcP)->rb_id, data_req.data.nb_elements); #endif data_req.buffer_occupancy_in_pdus = rlc_am_get_buffer_occupancy_in_pdus_ch2 ((struct rlc_am_entity *) rlcP); data_req.buffer_occupancy_in_bytes = rlc_am_get_buffer_occupancy_in_bytes_ch2 ((struct rlc_am_entity *) rlcP); data_req.rlc_info.rlc_protocol_state = ((struct rlc_am_entity *) rlcP)->protocol_state; return data_req; }
//----------------------------------------------------------------------------- struct mac_data_req rlc_um_mac_data_request (void *rlcP) { //----------------------------------------------------------------------------- struct mac_data_req data_req; rlc_um_get_pdus (rlcP); list_init (&data_req.data, NULL); list_add_list (&((rlc_um_entity_t *) rlcP)->pdus_to_mac_layer, &data_req.data); #ifdef DEBUG_RLC_STATS ((rlc_um_entity_t *) rlcP)->tx_pdus += data_req.data.nb_elements; #endif #ifdef DEBUG_RLC_UM_MAC_DATA_REQUEST msg ("[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_REQUEST %d TBs\n", ((rlc_um_entity_t *) rlcP)->module_id, ((rlc_um_entity_t *) rlcP)->rb_id, mac_xface->frame, data_req.data.nb_elements); #endif data_req.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy ((rlc_um_entity_t *) rlcP); if (data_req.buffer_occupancy_in_bytes > 0) { data_req.buffer_occupancy_in_bytes += ((rlc_um_entity_t *) rlcP)->header_min_length_in_bytes; } data_req.rlc_info.rlc_protocol_state = ((rlc_um_entity_t *) rlcP)->protocol_state; return data_req; }
/* * Parse the configuration file's layer element and all child layers */ static void ows_parse_config_layer(ows * o, xmlTextReaderPtr r) { ows_layer *layer; xmlChar *a; list *l; assert(o); assert(r); layer = ows_layer_init(); layer->depth = xmlTextReaderDepth(r); layer->parent = ows_parse_config_layer_get_parent(o, layer->depth); a = xmlTextReaderGetAttribute(r, (xmlChar *) "table"); if (a) { buffer_add_str(layer->storage->table, (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "name"); if (a) { layer->name = buffer_init(); buffer_add_str(layer->name, (char *) a); if (!layer->storage->table->use) buffer_add_str(layer->storage->table, (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "title"); if (a) { layer->title = buffer_init(); buffer_add_str(layer->title, (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "abstract"); if (a) { layer->abstract = buffer_init(); buffer_add_str(layer->abstract, (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "keywords"); if (a) { layer->keywords = list_explode_str(',', (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "gml_ns"); if (a) { layer->gml_ns = list_explode_str(',', (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "schema"); if (a) { buffer_add_str(layer->storage->schema, (char *) a); xmlFree(a); } else buffer_add_str(layer->storage->schema, "public"); /* inherits from layer parent and replaces with specified value if defined */ a = xmlTextReaderGetAttribute(r, (xmlChar *) "retrievable"); if (a && atoi((char *) a) == 1) { layer->retrievable = true; xmlFree(a); } else if (!a && layer->parent && layer->parent->retrievable) layer->retrievable = true; else xmlFree(a); /* inherits from layer parent and replaces with specified value if defined */ a = xmlTextReaderGetAttribute(r, (xmlChar *) "writable"); if (a && atoi((char *) a) == 1) { layer->writable = true; xmlFree(a); } else if (!a && layer->parent && layer->parent->writable) layer->writable = true; else xmlFree(a); /* inherits from layer parent and adds specified value */ if (layer->parent && layer->parent->srid) { layer->srid = list_init(); list_add_list(layer->srid, layer->parent->srid); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "srid"); if (a) { if (!layer->srid) layer->srid = list_explode_str(',', (char *) a); else { l = list_explode_str(',', (char *) a); list_add_list(layer->srid, l); list_free(l); } xmlFree(a); } /* Inherits from layer parent and replaces with specified value if defined */ a = xmlTextReaderGetAttribute(r, (xmlChar *) "geobbox"); if (a) { layer->geobbox = ows_geobbox_init(); ows_geobbox_set_from_str(o, layer->geobbox, (char *) a); xmlFree(a); } else if (!a && layer->parent && layer->parent->geobbox) { layer->geobbox = ows_geobbox_copy(layer->parent->geobbox); } else xmlFree(a); /* Inherits from layer parent and replaces with specified value if defined */ a = xmlTextReaderGetAttribute(r, (xmlChar *) "ns_prefix"); if (a) { buffer_add_str(layer->ns_prefix, (char *) a); xmlFree(a); } else if (!a && layer->parent && layer->parent->ns_prefix) { buffer_copy(layer->ns_prefix, layer->parent->ns_prefix); } else xmlFree(a); /* Inherits from layer parent and replaces with specified value if defined */ a = xmlTextReaderGetAttribute(r, (xmlChar *) "ns_uri"); if (a) { buffer_add_str(layer->ns_uri, (char *) a); xmlFree(a); } else if (!a && layer->parent && layer->parent->ns_uri) { buffer_copy(layer->ns_uri, layer->parent->ns_uri); } else xmlFree(a); a = xmlTextReaderGetAttribute(r, (xmlChar *) "exclude_items"); if (a) { layer->exclude_items = list_explode_str_trim(',', (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "include_items"); if (a) { layer->include_items = list_explode_str_trim(',', (char *) a); xmlFree(a); } a = xmlTextReaderGetAttribute(r, (xmlChar *) "pkey"); if (a) { layer->pkey = buffer_init(); buffer_add_str(layer->pkey, (char *) a); xmlFree(a); } ows_layer_list_add(o->layers, layer); }
static int asm_exec(const char *infile, const char *outfile) { list_t *l; const char *file; int rv; if (opt.prog_asm == NULL) error("No assembler is defined"); l = list_alloc(); list_add_file(l, opt.prog_asm, &progdirs, X_OK); Wflag_add(l, W_ASM); list_add_list(l, opt.Wa); { -p gnu -f <type> #if defined(USE_YASM) av[na++] = "-p"; av[na++] = "gnu"; av[na++] = "-f"; #if defined(os_win32) av[na++] = "win32"; #elif defined(os_darwin) av[na++] = "macho"; #else av[na++] = "elf"; #endif #endif #if defined(os_sunos) && defined(mach_sparc64) av[na++] = "-m64"; #endif #if defined(os_darwin) if (Bstatic) av[na++] = "-static"; #endif #if !defined(USE_YASM) if (vflag) av[na++] = "-v"; #endif if (kflag) av[na++] = "-k"; #ifdef os_darwin av[na++] = "-arch"; #if mach_amd64 av[na++] = amd64_i386 ? "i386" : "x86_64"; #else av[na++] = "i386"; #endif #else #ifdef mach_amd64 if (amd64_i386) av[na++] = "--32"; #endif #endif av[na++] = "-o"; if (outfile && cflag) ermfile = av[na++] = outfile; else if (cflag) ermfile = av[na++] = olist[i] = setsuf(clist[i], 'o'); else ermfile = av[na++] = olist[i] = gettmp(); av[na++] = assource; av[na++] = 0; if (callsys(as, av)) { cflag++; eflag++; cunlink(tmp4); continue; } } if (infile != NULL) list_add(l, infile); else if (outfile != NULL) list_add(l, "-"); if (outfile != NULL) { list_add(l, "-o"); list_add(l, outfile); } rv = list_exec(l); list_free(l); return rv; }