Пример #1
0
/****************
 * MAINFUNCTION *
 ****************/
int
main(void) {

	struct state state;

	/* Einlesen der uebergebenen Argumente */
	read_env(param);
	
        /* 
	 * Initialisieren der Datenstruktur zum Abbilden des programminternen 
	 * Berechnungsstatus
	 */
	init_values(&state);

	/* Schreiben des KML-Headers */
	print_header(&state);

	/* Schreiben der zu verwendenden Farbkonfigurationen */
	print_colorstyles(&state);

	/* Plotten der einzelnen Netzelemente (Dichtedarstellung) und 
	 * verwendeten Trajketorien (unsichtbar) 
	 */ 
	plot(&state); 

	/* Schliessen der KML-Strukturen */
	print_end(&state);

	/* Reservierte Speicherbereiche wieder freigeben */
	reset_state(&state);

	return 0;
}
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_w_customer(void *row)
{
	struct W_CUSTOMER_TBL *r;

	if (row == NULL)
		r = &g_w_customer;
	else
		r = row;

	print_start(CUSTOMER);
	print_key(C_CUSTOMER_SK, r->c_customer_sk, 1);
	print_varchar(C_CUSTOMER_ID, r->c_customer_id, 1);
	print_key(C_CURRENT_CDEMO_SK, r->c_current_cdemo_sk, 1);
	print_key(C_CURRENT_HDEMO_SK, r->c_current_hdemo_sk, 1);
	print_key(C_CURRENT_ADDR_SK, r->c_current_addr_sk, 1);
	print_integer(C_FIRST_SHIPTO_DATE_ID, r->c_first_shipto_date_id, 1);
	print_integer(C_FIRST_SALES_DATE_ID, r->c_first_sales_date_id, 1);
	print_varchar(C_SALUTATION, r->c_salutation, 1);
	print_varchar(C_FIRST_NAME, r->c_first_name, 1);
	print_varchar(C_LAST_NAME, r->c_last_name, 1);
	print_boolean(C_PREFERRED_CUST_FLAG, r->c_preferred_cust_flag, 1);
	print_integer(C_BIRTH_DAY, r->c_birth_day, 1);
	print_integer(C_BIRTH_MONTH, r->c_birth_month, 1);
	print_integer(C_BIRTH_YEAR, r->c_birth_year, 1);
	print_varchar(C_BIRTH_COUNTRY, r->c_birth_country, 1);
	print_varchar(C_LOGIN, &r->c_login[0], 1);
	print_varchar(C_EMAIL_ADDRESS, &r->c_email_address[0], 1);
	print_integer(C_LAST_REVIEW_DATE, r->c_last_review_date, 0);
	print_end(CUSTOMER);

	return(0);
}
Пример #3
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_promotion(void *pSrc)
{
	struct W_PROMOTION_TBL *r;

	if (pSrc == NULL)
		r = &g_w_promotion;
	else
		r = pSrc;
	
	print_start(S_PROMOTION);
	print_varchar(P_PROMO_ID, r->p_promo_id, 1);
	print_varchar(P_PROMO_NAME, &r->p_promo_name[0], 1);
   print_date(P_START_DATE_ID, r->p_start_date_id, 1);
   print_date(P_START_DATE_ID, r->p_end_date_id, 1);
	print_decimal(P_COST, &r->p_cost, 1);
	print_integer(P_RESPONSE_TARGET, r->p_response_target, 1);
	print_boolean(P_CHANNEL_DMAIL, r->p_channel_dmail, 1);
	print_boolean(P_CHANNEL_EMAIL, r->p_channel_email, 1);
	print_boolean(P_CHANNEL_CATALOG, r->p_channel_catalog, 1);
	print_boolean(P_CHANNEL_TV, r->p_channel_tv, 1);
	print_boolean(P_CHANNEL_RADIO, r->p_channel_radio, 1);
	print_boolean(P_CHANNEL_PRESS, r->p_channel_press, 1);
	print_boolean(P_CHANNEL_EVENT, r->p_channel_event, 1);
	print_boolean(P_CHANNEL_DEMO, r->p_channel_demo, 1);
	print_varchar(P_CHANNEL_DETAILS, &r->p_channel_details[0], 1);
	print_varchar(P_PURPOSE, r->p_purpose, 1);
	print_boolean(P_DISCOUNT_ACTIVE, r->p_discount_active, 0);
	print_end(S_PROMOTION);
	
	return(0);
}
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_purchase(void *pSrc)
{
	struct S_PURCHASE_TBL *r;
   char szKey[RS_BKEY + 1];

   if (pSrc == NULL)
		r = &g_s_purchase;
	else
		r = pSrc;
	
	print_start(S_PURCHASE);
	print_key(S_PURCHASE_ID, r->kID, 1);
   mk_bkey(szKey, r->kID, 0);
   mk_bkey(szKey, r->kStoreID, 0);
	print_varchar(S_PURCHASE_STORE_ID, szKey, 1);
   mk_bkey(szKey, r->kCustomerID, 0);
	print_varchar(S_PURCHASE_CUSTOMER_ID, szKey, 1);
	print_date(S_PURCHASE_DATE, r->dtPurchaseDate.julian, 1);
	print_integer(S_PURCHASE_TIME, r->nPurchaseTime, 1);
	print_integer(S_PURCHASE_REGISTER, r->nRegister, 1);
	print_integer(S_PURCHASE_CLERK, r->nClerk, 1);
	print_varchar(S_PURCHASE_COMMENT, r->szComment, 0);
	print_end(S_PURCHASE);

	return(0);
}
Пример #5
0
Файл: cntr.c Проект: jkniiv/burp
void cntr_add(struct cntr *c, char ch, int print)
{
	struct cntr_ent *grand_total_ent;
	if(!c) return;
	if(!(grand_total_ent=c->ent[CMD_GRAND_TOTAL])) return;
	if(print)
	{
		struct cntr_ent *warning;
		if(!(warning=c->ent[CMD_WARNING])) return;
		if(!grand_total_ent->count
		  && !warning->count) logc("\n");
		logc("%c", ch);
	}
	if(ch==CMD_FILE_CHANGED)
	{
		incr_changed(c, CMD_FILE);
		incr_changed(c, CMD_TOTAL);
		incr_changed(c, CMD_GRAND_TOTAL);
	}
	else
	{
		incr_count(c, ch);
		if(ch==CMD_WARNING) return;
		incr_count(c, CMD_TOTAL);
	}

	if(!((++grand_total_ent->count)%64) && print)
		print_end(grand_total_ent->count);
	fflush(stdout);
}
Пример #6
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_item(void *pSrc)
{
	struct W_ITEM_TBL *r;

	if (pSrc == NULL)
		r = &g_w_item;
	else
		r = pSrc;
	
	print_start(S_ITEM);
	print_varchar(S_ITEM_ID, r->i_item_id, 1);
	print_varchar(S_ITEM_DESC, r->i_item_desc, 1);
	print_decimal(S_ITEM_LIST_PRICE, &r->i_current_price, 1);
	print_decimal(S_ITEM_WHOLESALE_COST, &r->i_wholesale_cost, 1);
	print_varchar(S_ITEM_SIZE, r->i_size, 1);
	print_varchar(S_ITEM_FORMULATION, r->i_formulation, 1);
	print_varchar(S_ITEM_FLAVOR, r->i_color, 1);
	print_varchar(S_ITEM_UNITS, r->i_units, 1);
	print_varchar(S_ITEM_CONTAINER, r->i_container, 1);
	print_key(S_ITEM_MANAGER_ID, r->i_manager_id, 0);
	print_end(S_ITEM);
	
	return(0);
}
Пример #7
0
void print_err()
{
    print_hdr();
    puts("<h1>ERROR IN DATA</h1>");
    print_end();
    exit(2);
}
Пример #8
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_w_store_returns(void *row)
{
	struct W_STORE_RETURNS_TBL *r;


	if (row == NULL)
		r = &g_w_store_returns;
	else
		r = row;
	print_start(STORE_RETURNS);
	print_key(SR_RETURNED_DATE_SK, r->sr_returned_date_sk, 1);
	print_key(SR_RETURNED_TIME_SK, r->sr_returned_time_sk, 1);
	print_key(SR_ITEM_SK, r->sr_item_sk, 1);
	print_key(SR_CUSTOMER_SK, r->sr_customer_sk, 1);
	print_key(SR_CDEMO_SK, r->sr_cdemo_sk, 1);
	print_key(SR_HDEMO_SK, r->sr_hdemo_sk, 1);
	print_key(SR_ADDR_SK, r->sr_addr_sk, 1);
	print_key(SR_STORE_SK, r->sr_store_sk, 1);
	print_key(SR_REASON_SK, r->sr_reason_sk, 1);
	print_key(SR_TICKET_NUMBER, r->sr_ticket_number, 1);
	print_integer(SR_PRICING_QUANTITY, r->sr_pricing.quantity, 1);
	print_decimal(SR_PRICING_NET_PAID, &r->sr_pricing.net_paid, 1);
	print_decimal(SR_PRICING_EXT_TAX, &r->sr_pricing.ext_tax, 1);
	print_decimal(SR_PRICING_NET_PAID_INC_TAX, &r->sr_pricing.net_paid_inc_tax, 1);
	print_decimal(SR_PRICING_FEE, &r->sr_pricing.fee, 1);
	print_decimal(SR_PRICING_EXT_SHIP_COST, &r->sr_pricing.ext_ship_cost, 1);
	print_decimal(SR_PRICING_REFUNDED_CASH, &r->sr_pricing.refunded_cash, 1);
	print_decimal(SR_PRICING_REVERSED_CHARGE, &r->sr_pricing.reversed_charge, 1);
	print_decimal(SR_PRICING_STORE_CREDIT, &r->sr_pricing.store_credit, 1);
	print_decimal(SR_PRICING_NET_LOSS, &r->sr_pricing.net_loss, 0);
	print_end(STORE_RETURNS);
	
	return(0);
}
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_web_return(void *pSrc)
{
	struct S_WEB_RETURNS_TBL *r;
	
	if (pSrc == NULL)
		r = &g_s_web_returns;
	else
		r = pSrc;
	
	print_start(S_WEB_RETURNS);
	print_id(S_WRET_SITE_ID, r->kSiteID, 1);
	print_key(S_WRET_ORDER_ID,r->kOrderID, 1);
	print_integer(S_WRET_LINE_NUMBER, r->nLineNumber, 1);
	print_id(S_WRET_ITEM_ID, r->kItemID, 1);
	print_id(S_WRET_RETURN_CUST_ID, r->kReturningCustomerID, 1);
	print_id(S_WRET_REFUND_CUST_ID,r->kRefundedCustomerID, 1);
	print_date(S_WRET_RETURN_DATE, r->dtReturnDate.julian, 1);
	print_time(S_WRET_RETURN_TIME, r->kReturnTime, 1);
	print_integer(S_WRET_PRICING, r->Pricing.quantity, 1);
	print_decimal(S_WRET_PRICING, &r->Pricing.ext_sales_price, 1);
	print_decimal(S_WRET_PRICING, &r->Pricing.ext_tax, 1);
   print_decimal(S_WRET_PRICING, &r->Pricing.fee, 1);
	print_decimal(S_WRET_PRICING, &r->Pricing.ext_ship_cost, 1);
	print_decimal(S_WRET_PRICING, &r->Pricing.refunded_cash, 1);
	print_decimal(S_WRET_PRICING, &r->Pricing.reversed_charge, 1);
	print_decimal(S_WRET_PRICING, &r->Pricing.store_credit, 1);
   print_id(S_WRET_REASON_ID, r->kReasonID, 0);
	print_end(S_WEB_RETURNS);
	
	return(0);
}
Пример #10
0
void print_Falsepath(FILE* f, Falsepath* fp){
    print_Timegroup(f,fp->tg_in);
    print_Timegroup(f,fp->tg_out);
    print_Nets(f,fp->tg_nets);
    print_end(f, fp);

}
Пример #11
0
void CFGPrinterOutput::print_state(BlockBegin* block) {
  print_begin("states");

  InstructionPrinter ip(true, output());

  ValueStack* state = block->state();
  int index;
  Value value;

  for_each_state(state) {
    print_begin("locals");
    print("size %d", state->locals_size());
    print("method \"%s\"", method_name(state->scope()->method()));

    for_each_local_value(state, index, value) {
      ip.print_phi(index, value, block);
      print_operand(value);
      output()->cr();
    }
    print_end("locals");

    if (state->stack_size() > 0) {
      print_begin("stack");
      print("size %d", state->stack_size());
      print("method \"%s\"", method_name(state->scope()->method()));

      for_each_stack_value(state, index, value) {
        ip.print_phi(index, value, block);
        print_operand(value);
        output()->cr();
      }
Пример #12
0
void CFGPrinterOutput::print_compilation() {
  print_begin("compilation");

  print("name \"%s\"", method_name(_compilation->method(), true));
  print("method \"%s\"", method_name(_compilation->method()));
  print("date "INT64_FORMAT, os::javaTimeMillis());

  print_end("compilation");
}
Пример #13
0
Файл: cntr.c Проект: jkniiv/burp
void cntr_print_end_phase1(struct cntr *cntr)
{
	struct cntr_ent *grand_total_ent=cntr->ent[CMD_GRAND_TOTAL];
	if(grand_total_ent)
	{
		print_end(grand_total_ent->phase1);
		logc("\n");
	}
}
Пример #14
0
END_TEST



START_TEST (test_map_iter_1)
{
  mapper_t map;
  int res;
  mapper_iter_t iter;
  mapper_node_info_t ni;
  int  n, cn, a;
  struct in_addr ip;
  
  print_start("test_map_iter_1");
  //msx_set_debug(MAP_DEBUG);
  
  map = BuildUserViewMap(userview_query_map_1,
			 strlen(userview_query_map_1) + 1, INPUT_MEM);
  fail_unless(map != NULL, "Failed to build map object from userview_query_map_1");

  inet_aton("192.168.4.5", &ip);
  n = mapperSetMyIP(map, &ip);
  fail_unless(n==1, "Setting my IP in mapper");


//res = mapperSetMyIP(map, PE_SET(6, 15));
  //fail_unless(res, "mapperSetMyIP failed, my IP is not in map");
  
  
  n = mapperTotalNodeNum(map);
  cn = mapperClusterNodeNum(map);
 
  // All iteratror
  iter = mapperIter(map, MAP_ITER_ALL);
  fail_unless(res, "Failed to create iterator");

  a = 0;
  while(mapperNext(iter, &ni))
	  a++;
  fail_unless(a == n, "Number of iterations is not the number of nodes");
  mapperIterDone(iter);
  
  // Cluster iteratror
  iter = mapperIter(map, MAP_ITER_CLUSTER);
  fail_unless(res, "Failed to create iterator");

  a = 0;
  while(mapperNext(iter, &ni))
	  a++;
  fail_unless(a == cn, "Number of iterations is not the number of cluster nodes");
  mapperIterDone(iter);
  
  mapperDone(map);
  msx_set_debug(0);
  print_end();
}
Пример #15
0
void BWCNC::Renderer::render_all( const BWCNC::PartContext & k, const std::string * /* filename */ )
{
    print_start( k.bbox );

    // c++11 forall construct. p is an element of partlist, a pointer
    for( const auto & part_ptr : k.partlist )
        part_ptr->render( this );

    print_end();
}
Пример #16
0
void BWCNC::Renderer::render_all_z_order( BWCNC::PartContext & k )
{
    k.refresh_z_ascending();

    print_start( k.bbox );

    for( const auto & part_ptr : k.partlist_z_ascending )
        part_ptr.second->render( this );

    print_end();
}
Пример #17
0
Файл: cntr.c Проект: jkniiv/burp
void cntr_add_phase1(struct cntr *c, char ch, int print)
{
	static struct cntr_ent *total;
	incr_phase1(c, ch);

	if(!print) return;
	total=c->ent[(uint8_t)CMD_GRAND_TOTAL];
	if(!total->phase1) logc("\n");
	logc("%c", ch);
	if(!((++total->phase1)%64))
		print_end(total->phase1);
	fflush(stdout);
}
Пример #18
0
END_TEST




START_TEST (test_bad)
{
        
        print_start("Testing good external info");
        msx_set_debug(1);

        print_end();
        msx_set_debug(0);
} 
Пример #19
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_w_web_sales(void *row)
{
	struct W_WEB_SALES_TBL *r;
	
	if (row == NULL)
		r = &g_w_web_sales;
	else
		r = row;
	
	print_start(WEB_SALES);
	print_key(WS_SOLD_DATE_SK, r->ws_sold_date_sk, 1);
	print_key(WS_SOLD_TIME_SK, r->ws_sold_time_sk, 1);
	print_key(WS_SHIP_DATE_SK, r->ws_ship_date_sk, 1);
	print_key(WS_ITEM_SK, r->ws_item_sk, 1);
	print_key(WS_BILL_CUSTOMER_SK, r->ws_bill_customer_sk, 1);
	print_key(WS_BILL_CDEMO_SK, r->ws_bill_cdemo_sk, 1);
	print_key(WS_BILL_HDEMO_SK, r->ws_bill_hdemo_sk, 1);
	print_key(WS_BILL_ADDR_SK, r->ws_bill_addr_sk, 1);
	print_key(WS_SHIP_CUSTOMER_SK, r->ws_ship_customer_sk, 1);
	print_key(WS_SHIP_CDEMO_SK, r->ws_ship_cdemo_sk, 1);
	print_key(WS_SHIP_HDEMO_SK, r->ws_ship_hdemo_sk, 1);
	print_key(WS_SHIP_ADDR_SK, r->ws_ship_addr_sk, 1);
	print_key(WS_WEB_PAGE_SK, r->ws_web_page_sk, 1);
	print_key(WS_WEB_SITE_SK, r->ws_web_site_sk, 1);
	print_key(WS_SHIP_MODE_SK, r->ws_ship_mode_sk, 1);
	print_key(WS_WAREHOUSE_SK, r->ws_warehouse_sk, 1);
	print_key(WS_PROMO_SK, r->ws_promo_sk, 1);
	print_key(WS_ORDER_NUMBER, r->ws_order_number, 1);
	print_integer(WS_PRICING_QUANTITY, r->ws_pricing.quantity, 1);
	print_decimal(WS_PRICING_WHOLESALE_COST, &r->ws_pricing.wholesale_cost, 1);
	print_decimal(WS_PRICING_LIST_PRICE, &r->ws_pricing.list_price, 1);
	print_decimal(WS_PRICING_SALES_PRICE, &r->ws_pricing.sales_price, 1);
	print_decimal(WS_PRICING_EXT_DISCOUNT_AMT, &r->ws_pricing.ext_discount_amt, 1);
	print_decimal(WS_PRICING_EXT_SALES_PRICE, &r->ws_pricing.ext_sales_price, 1);
	print_decimal(WS_PRICING_EXT_WHOLESALE_COST, &r->ws_pricing.ext_wholesale_cost, 1);
	print_decimal(WS_PRICING_EXT_LIST_PRICE, &r->ws_pricing.ext_list_price, 1);
	print_decimal(WS_PRICING_EXT_TAX, &r->ws_pricing.ext_tax, 1);
	print_decimal(WS_PRICING_COUPON_AMT, &r->ws_pricing.coupon_amt, 1);
	print_decimal(WS_PRICING_EXT_SHIP_COST, &r->ws_pricing.ext_ship_cost, 1);
	print_decimal(WS_PRICING_NET_PAID, &r->ws_pricing.net_paid, 1);
	print_decimal(WS_PRICING_NET_PAID_INC_TAX, &r->ws_pricing.net_paid_inc_tax, 1);
	print_decimal(WS_PRICING_NET_PAID_INC_SHIP, &r->ws_pricing.net_paid_inc_ship, 1);
	print_decimal(WS_PRICING_NET_PAID_INC_SHIP_TAX, &r->ws_pricing.net_paid_inc_ship_tax, 1);
	print_decimal(WS_PRICING_NET_PROFIT, &r->ws_pricing.net_profit, 0);
	print_end(WEB_SALES);

	return(0);
}
Пример #20
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_manager(void *pSrc)
{
	struct S_MANAGER_TBL *r;
	
	if (pSrc == NULL)
		r = &g_s_manager;
	else
		r = pSrc;
	
	print_start(S_MANAGER);
	print_key(S_MANAGER_ID, r->id, 1);
	print_varchar(S_MANAGER_NAME, r->name, 0);
	print_end(S_MANAGER);
	
	return(0);
}
Пример #21
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_reason(void *pSrc)
{
	struct S_REASON_TBL *r;
	
	if (pSrc == NULL)
		r = &g_s_reason;
	else
		r = pSrc;
	
	print_start(S_REASON);
	print_key(S_REASON_ID, r->kID, 1);
	print_varchar(S_REASON_DESC, r->szDesc, 0);
	print_end(S_REASON);
	
	return(0);
}
Пример #22
0
void dot_visitor::write_to_file(const char *fname)
{
	std::ofstream out(fname);
	if(out.fail())
		return;
	print_begin(out);
	for(auto iter = node_list.begin(); iter != node_list.end(); ++iter)
	{
		print_node(out, *iter);
	}
	for(auto iter = edge_list.begin(); iter != edge_list.end(); ++iter)
	{
		print_edge(out, *iter);
	}
	print_end(out);
	out.flush();
}
Пример #23
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_w_date(void *row)
{
	char sQuarterName[7];
	struct W_DATE_TBL *r;

	if (row == NULL)
		r = &g_w_date;
	else
		r = row;

	print_start(DATE);
	print_key(D_DATE_SK, r->d_date_sk, 1);
	print_varchar(D_DATE_ID, r->d_date_id, 1);
	/* output the same information in a different format */
	print_date(D_DATE_SK, r->d_date_sk, 1);
	print_integer(D_MONTH_SEQ, r->d_month_seq, 1);
	print_integer(D_WEEK_SEQ, r->d_week_seq, 1);
	print_integer(D_QUARTER_SEQ, r->d_quarter_seq, 1);
	print_integer(D_YEAR, r->d_year, 1);
	print_integer(D_DOW, r->d_dow, 1);
	print_integer(D_MOY, r->d_moy, 1);
	print_integer(D_DOM, r->d_dom, 1);
	print_integer(D_QOY, r->d_qoy, 1);
	print_integer(D_FY_YEAR, r->d_fy_year, 1);
	print_integer(D_FY_QUARTER_SEQ, r->d_fy_quarter_seq, 1);
	print_integer(D_FY_WEEK_SEQ, r->d_fy_week_seq, 1);
	print_varchar(D_DAY_NAME, r->d_day_name, 1);
	sprintf(sQuarterName, "%4dQ%d", r->d_year, r->d_qoy);
	print_varchar(D_QUARTER_NAME, sQuarterName, 1);
	print_boolean(D_HOLIDAY, r->d_holiday, 1);
	print_boolean(D_WEEKEND, r->d_weekend, 1);
	print_boolean(D_FOLLOWING_HOLIDAY, r->d_following_holiday, 1);
	print_integer(D_FIRST_DOM, r->d_first_dom, 1);
	print_integer(D_LAST_DOM, r->d_last_dom, 1);
	print_integer(D_SAME_DAY_LY, r->d_same_day_ly, 1);
	print_integer(D_SAME_DAY_LQ, r->d_same_day_lq, 1);
	print_boolean(D_CURRENT_DAY, r->d_current_day, 1);
	print_boolean(D_CURRENT_WEEK, r->d_current_week, 1);
	print_boolean(D_CURRENT_MONTH, r->d_current_month, 1);
	print_boolean(D_CURRENT_QUARTER, r->d_current_quarter, 1);
	print_boolean(D_CURRENT_YEAR, r->d_current_year, 0);
	print_end(DATE);

	return(0);
}
Пример #24
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_warehouse(void *pSrc)
{
	struct W_WAREHOUSE_TBL *r;

   if (pSrc == NULL)
		r = &g_w_warehouse;
	else
		r = pSrc;
	
	print_start(S_WAREHOUSE);
	print_varchar(W_WAREHOUSE_ID, r->w_warehouse_id, 1);
	print_varchar(W_WAREHOUSE_NAME, &r->w_warehouse_name[0], 1);
	print_integer(W_WAREHOUSE_SQ_FT, r->w_warehouse_sq_ft, 0);
	print_end(S_WAREHOUSE);
	
	return(0);
}
Пример #25
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_division(void *pSrc)
{
	struct S_DIVISION_TBL *r;
	
	if (pSrc == NULL)
		r = &g_s_division;
	else
		r = pSrc;
	
	print_start(S_DIVISION);
	print_key(S_DIVISION_ID, r->id, 1);
	print_varchar(S_DIVISION_NAME, r->name, 1);
	print_key(S_DIVISION_COMPANY, r->company, 1);
	print_end(S_DIVISION);
	
	return(0);
}
Пример #26
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_class(void *pSrc)
{
	struct S_CLASS_TBL *r;
	
	if (pSrc == NULL)
		r = &g_s_class;
	else
		r = pSrc;
	
	print_start(S_CLASS);
	print_key(S_CLASS_ID, r->id, 1);
	print_key(S_CLASS_SUBCAT_ID, r->subcat_id, 1);
	print_varchar(S_CLASS_DESC, r->desc, 0);
	print_end(S_CLASS);
	
	return(0);
}
Пример #27
0
/*
* Routine:
* Purpose:
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By:
* Calls:
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_catalog_promotional_item(void *pSrc)
{
    struct S_CATALOG_PROMOTIONAL_ITEM_TBL *r;

    if (pSrc == NULL)
        r = &g_s_catalog_promotional_item;
    else
        r = pSrc;

    print_start(S_CATALOG_PROMOTIONAL_ITEM);
    print_key(S_CATALOG_PROMOTIONAL_ITEM_CATALOG_NUMBER, r->catalog_promotional_item_catalog_number, 1);
    print_key(S_CATALOG_PROMOTIONAL_ITEM_CATALOG_PAGE_NUMBER, r->catalog_promotional_item_catalog_page_number, 1);
    print_key(S_CATALOG_PROMOTIONAL_ITEM_ITEM_ID, r->catalog_promotional_item_item_id, 1);
    print_key(S_CATALOG_PROMOTIONAL_ITEM_PROMOTION_ID, r->catalog_promotional_item_promotion_id, 0);
    print_end(S_CATALOG_PROMOTIONAL_ITEM);

    return(0);
}
Пример #28
0
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_s_catalog(void *pSrc)
{
	struct S_CATALOG_TBL *r;
	
	if (pSrc == NULL)
		r = &g_s_catalog;
	else
		r = pSrc;

	print_start(S_CATALOG);
	print_key(S_CATALOG_NUMBER, r->s_catalog_number, 1);
	print_date(S_CATALOG_START_DATE, r->s_catalog_start_date.julian, 1);
	print_date(S_CATALOG_END_DATE, r->s_catalog_end_date.julian, 1);
	print_varchar(S_CATALOG_DESC, r->s_catalog_catalog_desc, 1);
	print_integer(S_CATALOG_TYPE, r->s_catalog_catalog_type, 0);
	print_end(S_CATALOG);

	return(0);
}
Пример #29
0
END_TEST


START_TEST (test_write)
{
        int                res;
        proc_watch_entry_t arr[50];
        int                size = 50;
        char               buff[1024];
        
        print_start("Testing good external info");
        msx_set_debug(1);

        addProcToArr(arr, 0, "infod"  , 1, PS_OK);
        addProcToArr(arr, 1, "priod"  , 2, PS_NO_PID_FILE);
        addProcToArr(arr, 2, "qmd"    , 3, PS_NO_PROC);
        addProcToArr(arr, 3, "remoted", 4, PS_OK);


        writeProcWatchInfo(arr, 4, 0, buff);
        
        size = 50;
        res = getProcWatchInfo(buff, arr, &size);
        fail_unless(res == 1, "Failed to parse written buff");
        fail_unless(size == 4, "written buff: size != 4");
        
        fail_unless(arr[0].procPid == 1 && arr[0].procStat == PS_OK,
                    "written buff: 0 wrong pid or stat \n");
        fail_unless(arr[1].procPid == 2 && arr[1].procStat == PS_NO_PID_FILE,
                    "written buff: 1 wrong pid or stat \n");
        fail_unless(arr[2].procPid == 3 && arr[2].procStat == PS_NO_PROC,
                    "written buff: 2 wrong pid or stat \n");
        fail_unless(arr[3].procPid == 4 && arr[3].procStat == PS_OK,
                    "written buff: 3 wrong pid or stat \n");
        
        print_end();
        msx_set_debug(0);
} 
/*
* Routine: 
* Purpose: 
* Algorithm:
* Data Structures:
*
* Params:
* Returns:
* Called By: 
* Calls: 
* Assumptions:
* Side Effects:
* TODO: None
*/
int
pr_w_store_sales(void *row)
{
	struct W_STORE_SALES_TBL *r;
	
	if (row == NULL)
		r = &g_w_store_sales;
	else
		r = row;

	print_start(STORE_SALES);
	print_key(SS_SOLD_DATE_SK, r->ss_sold_date_sk, 1);
	print_key(SS_SOLD_TIME_SK, r->ss_sold_time_sk, 1);
	print_key(SS_SOLD_ITEM_SK, r->ss_sold_item_sk, 1);
	print_key(SS_SOLD_CUSTOMER_SK, r->ss_sold_customer_sk, 1);
	print_key(SS_SOLD_CDEMO_SK, r->ss_sold_cdemo_sk, 1);
	print_key(SS_SOLD_HDEMO_SK, r->ss_sold_hdemo_sk, 1);
	print_key(SS_SOLD_ADDR_SK, r->ss_sold_addr_sk, 1);
	print_key(SS_SOLD_STORE_SK, r->ss_sold_store_sk, 1);
	print_key(SS_SOLD_PROMO_SK, r->ss_sold_promo_sk, 1);
	print_key(SS_TICKET_NUMBER, r->ss_ticket_number, 1);
	print_integer(SS_PRICING_QUANTITY, r->ss_pricing.quantity, 1);
	print_decimal(SS_PRICING_WHOLESALE_COST, &r->ss_pricing.wholesale_cost, 1);
	print_decimal(SS_PRICING_LIST_PRICE, &r->ss_pricing.list_price, 1);
	print_decimal(SS_PRICING_SALES_PRICE, &r->ss_pricing.sales_price, 1);
	print_decimal(SS_PRICING_COUPON_AMT, &r->ss_pricing.coupon_amt, 1);
	print_decimal(SS_PRICING_EXT_SALES_PRICE, &r->ss_pricing.ext_sales_price, 1);
	print_decimal(SS_PRICING_EXT_WHOLESALE_COST, &r->ss_pricing.ext_wholesale_cost, 1);
	print_decimal(SS_PRICING_EXT_LIST_PRICE, &r->ss_pricing.ext_list_price, 1);
	print_decimal(SS_PRICING_EXT_TAX, &r->ss_pricing.ext_tax, 1);
	print_decimal(SS_PRICING_COUPON_AMT, &r->ss_pricing.coupon_amt, 1);
	print_decimal(SS_PRICING_NET_PAID, &r->ss_pricing.net_paid, 1);
	print_decimal(SS_PRICING_NET_PAID_INC_TAX, &r->ss_pricing.net_paid_inc_tax, 1);
	print_decimal(SS_PRICING_NET_PROFIT, &r->ss_pricing.net_profit, 0);
	print_end(STORE_SALES);

	return(0);
}