// append an ascii-version of FastExtract into cachewa.qryText_ void FastExtract::generateCacheKey(CacheWA &cwa) const { RelExpr::generateCacheKeyNode(cwa); char buf[40]; cwa += " targType_ "; str_itoa(getTargetType(), buf); cwa += buf; cwa += " targName_ "; cwa += getTargetName(); cwa += " delim_ "; cwa += getDelimiter(); cwa += " isAppend_ "; cwa += isAppend() ? "1" : "0"; cwa += " includeHeader_ "; cwa += includeHeader() ? "1" : "0"; cwa += " cType_ "; str_itoa(getCompressionType(), buf); cwa += buf; cwa += " nullString_ "; cwa += getNullString(); cwa += " recSep_ "; cwa += getRecordSeparator(); generateCacheKeyForKids(cwa); }
// append an ascii-version of Trim into cachewa.qryText_ void Trim::generateCacheKey(CacheWA& cwa) const { BuiltinFunction::generateCacheKey(cwa); cwa += " tlb:"; char mode[20]; str_itoa(mode_, mode); cwa += mode; }
// append an ascii-version of UDFunction into cachewa.qryText_ void UDFunction::generateCacheKey(CacheWA& cwa) const { NARoutine *routine = NULL; NARoutine *action = NULL; cwa += " nam:"; cwa += functionName_.getExternalName().data(); if (cwa.getPhase() >= CmpMain::BIND && getRoutineDesc() && (routine=getRoutineDesc()->getNARoutine()) != NULL) { char redefTime[40]; convertInt64ToAscii(routine->getRedefTime(), redefTime); cwa += " redef:"; cwa += redefTime; if ((routine->getSchemaLabelFileName()) && (str_len(routine->getSchemaLabelFileName()) > 0)) { char schRedefTime[40]; convertInt64ToAscii(routine->getSchemaRedefTime(), schRedefTime); cwa += " schredef:"; cwa += schRedefTime; } } if (getRoutineDesc() && getRoutineDesc()->getActionNameAsGiven().length() != 0) { cwa += " actnam:"; cwa += getRoutineDesc()->getActionNameAsGiven(); if (cwa.getPhase() >= CmpMain::BIND && getRoutineDesc() && (action=getRoutineDesc()->getActionNARoutine()) != NULL) { char redefTime[40]; convertInt64ToAscii(action->getRedefTime(), redefTime); cwa += " actredef:"; cwa += redefTime; } } cwa += "("; Lng32 arity = (Lng32) getArity(); for (Lng32 i = 0; i < arity; i++) { if (i > 0) { cwa += ", "; } child(i)->generateCacheKey(cwa); } if (getRoutineDesc()->getLocale() != 0 ) { cwa += ", LOCALE: "; char dFmt[20]; str_itoa(getRoutineDesc()->getLocale(), dFmt); cwa += dFmt; } cwa += ")"; }
// append an ascii-version of DateFormat into cachewa.qryText_ void DateFormat::generateCacheKey(CacheWA& cwa) const { BuiltinFunction::generateCacheKey(cwa); cwa += " fmt:"; char dFmt[20]; str_itoa(dateFormat_, dFmt); cwa += dFmt; }
// append an ascii-version of Translate into cachewa.qryText_ void Translate::generateCacheKey(CacheWA& cwa) const { BuiltinFunction::generateCacheKey(cwa); cwa += " map:"; char map[20]; str_itoa(map_table_id_, map); cwa += map; }
void MvQueryRewriteHandler::dumpAnalysisToFile(QueryAnalysis* qa, RelExpr* expr) { // Dump the QueryAnalysis data to a file. NAString analysisFileName = fileNamePrefix_ + ".analysis"; NAString str; expr->unparse(str, OPTIMIZER_PHASE, MVINFO_FORMAT); str += "\n"; str += qa->getText(); // Add in some stuff to look at join predicates for the JBBCs. str += "Join Predicates\n"; str += "==============="; char buffer[20]; ARRAY(JBB*) jbbs = qa->getJBBs(); for (CollIndex jbbInx = 0; jbbInx < jbbs.entries(); jbbInx++) { JBB* jbb = jbbs[jbbInx]; str_itoa(jbbInx, buffer); ((str += "\nJBB #") += NAString(buffer)) += ":\n"; CANodeIdSet jbbcs = jbb->getJBBCs(); for (CANodeId jbbcId=jbbcs.init(); jbbcs.next(jbbcId); jbbcs.advance(jbbcId) ) { str_itoa(jbbcId, buffer); ((str += "\nJBBC with CANodeId ") += NAString(buffer)) += ":\n"; ValueIdSet joinPreds = jbbcId.getNodeAnalysis()->getJBBC()->getJoinPreds(); str += valueIdSetGetText(joinPreds); if (joinPreds.entries() > 0) { str.append("\n(value ids of predicates are "); NABoolean first = true; for (ValueId jpVid=joinPreds.init(); joinPreds.next(jpVid); joinPreds.advance(jpVid)) { if (first) first = FALSE; else str.append(", "); str_itoa(jpVid, buffer); str.append(buffer); } str.append(")\n"); } } str += '\n'; } dumpToFile(analysisFileName.data(), str.data()); } // dumpAnalysisToFile()
void SessionDefaults::updateDefaultsValueString(SessionDefaultAttribute sda, Lng32 value) { if (defaultsValueString_[sda]) NADELETEBASIC(defaultsValueString_[sda], heap_); defaultsValueString_[sda] = new(heap_) char[12]; if (value < 0) { defaultsValueString_[sda][0] = '-'; str_itoa((ULng32)(-value), &defaultsValueString_[sda][1]); } else str_itoa((ULng32)(value), defaultsValueString_[sda]); }
// append an ascii-version of Cast into cachewa.qryText_ void Extract::generateCacheKey(CacheWA& cwa) const { BuiltinFunction::generateCacheKey(cwa); cwa += " xFld:"; char xFld[20]; str_itoa(extractField_, xFld); cwa += xFld; cwa += " fldFun:"; cwa += fieldFunction_ ? "1" : "0"; }
static void add_frameFromTupleInt (const Tuple * tuple, int field, int id3_field, GHashTable * dict) { if (tuple_get_value_type (tuple, field) != TUPLE_INT) { remove_frame (id3_field, dict); return; } char scratch[16]; str_itoa (tuple_get_int (tuple, field), scratch, sizeof scratch); add_text_frame (id3_field, scratch, dict); }
int main(void) { char *str; int i = -12345; str = str_itoa(i); printf("input=[%d],output=[%s]\n", i, str); free(str); return 0; }
// append an ascii-version of biarith void BiArith::generateCacheKey(CacheWA& cwa) const { ItemExpr::generateCacheKey(cwa); // append an indication of rounding mode for datetime arithmetic functions if ( isKeepLastDay() ) cwa += "r1"; else if ( isStandardNormalization() ) cwa += "r0"; if (getOperatorType() == ITM_DIVIDE) { cwa += " arm:"; // arith rounding mode char dFmt[20]; str_itoa(roundingMode_, dFmt); cwa += dFmt; } }
NABoolean findAToken (HiveMetaData *md, NAText* tblStr, size_t& pos, const char* tok, const char* errStr, NABoolean raiseError) { size_t foundB = tblStr->find(tok, pos); if (foundB == std::string::npos) { if (raiseError) { NAText *errText = new (CmpCommon::statementHeap()) string(errStr); char xPos[7]; str_itoa(pos, xPos); errText->append(" at position "); errText->append(xPos); errText->append(tblStr->c_str()); md->recordParseError(1500, "PARSE_ERROR", errText->c_str(), tblStr->c_str()); } return FALSE; } pos = foundB; return TRUE; }
void resample_start (int * channels, int * rate) { if (state) { src_delete (state); state = NULL; } int new_rate = 0; if (aud_get_bool ("resample", "use-mappings")) { char rate_s[16]; str_itoa (* rate, rate_s, sizeof rate_s); new_rate = aud_get_int ("resample", rate_s); } if (! new_rate) new_rate = aud_get_int ("resample", "default-rate"); new_rate = CLAMP (new_rate, MIN_RATE, MAX_RATE); if (new_rate == * rate) return; int method = aud_get_int ("resample", "method"); int error; if ((state = src_new (method, * channels, & error)) == NULL) { RESAMPLE_ERROR (error); return; } stored_channels = * channels; ratio = (double) new_rate / * rate; * rate = new_rate; }
/* do_command(): do @cmd after replacing the format codes @cmd: command to run */ static void do_command (char * cmd) { int playlist = aud_playlist_get_playing (); int pos = aud_playlist_get_position (playlist); char *shstring = NULL, *temp, numbuf[32]; gboolean playing; Formatter *formatter; if (cmd && strlen(cmd) > 0) { formatter = formatter_new(); char * ctitle = aud_playlist_entry_get_title (playlist, pos, FALSE); if (ctitle) { temp = escape_shell_chars (ctitle); formatter_associate(formatter, 's', temp); formatter_associate(formatter, 'n', temp); g_free(temp); str_unref (ctitle); } else { formatter_associate(formatter, 's', ""); formatter_associate(formatter, 'n', ""); } char * filename = aud_playlist_entry_get_filename (playlist, pos); if (filename) { temp = escape_shell_chars (filename); formatter_associate(formatter, 'f', temp); g_free(temp); str_unref (filename); } else formatter_associate(formatter, 'f', ""); g_snprintf(numbuf, sizeof(numbuf), "%02d", pos + 1); formatter_associate(formatter, 't', numbuf); int length = aud_playlist_entry_get_length (playlist, pos, FALSE); if (length > 0) { str_itoa (length, numbuf, sizeof numbuf); formatter_associate(formatter, 'l', numbuf); } else formatter_associate(formatter, 'l', "0"); playing = aud_drct_get_playing(); str_itoa (playing, numbuf, sizeof numbuf); formatter_associate(formatter, 'p', numbuf); if (playing) { int brate, srate, chans; aud_drct_get_info (& brate, & srate, & chans); str_itoa (brate, numbuf, sizeof numbuf); formatter_associate (formatter, 'r', numbuf); str_itoa (srate, numbuf, sizeof numbuf); formatter_associate (formatter, 'F', numbuf); str_itoa (chans, numbuf, sizeof numbuf); formatter_associate (formatter, 'c', numbuf); } Tuple * tuple = aud_playlist_entry_get_tuple (aud_playlist_get_active (), pos, 0); char * artist = tuple ? tuple_get_str (tuple, FIELD_ARTIST) : NULL; if (artist) { formatter_associate(formatter, 'a', artist); str_unref(artist); } else formatter_associate(formatter, 'a', ""); char * album = tuple ? tuple_get_str (tuple, FIELD_ALBUM) : NULL; if (album) { formatter_associate(formatter, 'b', album); str_unref(album); } else formatter_associate(formatter, 'b', ""); char * title = tuple ? tuple_get_str (tuple, FIELD_TITLE) : NULL; if (title) { formatter_associate(formatter, 'T', title); str_unref(title); } else formatter_associate(formatter, 'T', ""); if (tuple) tuple_unref (tuple); shstring = formatter_format(formatter, cmd); formatter_destroy(formatter); if (shstring) { execute_command(shstring); /* FIXME: This can possibly be freed too early */ g_free(shstring); } } }
// append an ascii-version of RelRoot into cachewa.qryText_ void RelRoot::generateCacheKey(CacheWA &cwa) const { RelExpr::generateCacheKey(cwa); ItemExpr *cExpr = compExprTree_ ? compExprTree_ : compExpr_.rebuildExprTree(); if (cExpr) { // append any select list into cache key cwa += " cExpr:"; cExpr->generateCacheKey(cwa); // reflect any "[first n]" cwa += ((RelRoot*)this)->needFirstSortedRows() ? " 1stN" : " "; // Should the select_list aliases be a part of the cache key? // Their not affecting the compiled plan argues for their exclusion. // Their affecting sqlci's expected output argues for their inclusion. RETDesc *rDesc = getRETDesc(); CollIndex degree, x; if (rDesc && (degree=rDesc->getDegree()) > 0) { cwa += " sla:"; for (x = 0; x < degree; x++){ cwa += rDesc->getColRefNameObj(x).getColName().data(); cwa += " "; } // fix 0-061115-0532 (query cache didn't handle select with embedded // update correctly). New/Old corr. names are recorded for embedded // updates here for exact match. This is important because otherwise // a reuse of a query returning the old/new version of values for // a query requesting new/old version is totally possible and // unacceptable. // // Sample embedded update queries // select * from (update tab1 set x = x + 1 where x > 1 return new.*) y; // select * from (update tab1 set x = x + 1 where x > 1 return new.x, old.y) y; // if ( cwa.isUpdate() && isTrueRoot() == FALSE ) { cwa += " corrNamTok:"; cwa += rDesc->getBindWA()->getCorrNameTokens(); } } } // order by clause is important ItemExpr *orderBy = orderByTree_ ? orderByTree_ : reqdOrder_.rebuildExprTree(); if (orderBy) { cwa += " order:"; orderBy->generateCacheKey(cwa); } // statement-level access type & lock mode are important for multiuser // applications. both are reflected in the stmt-level and/or context-wide // TransMode. So, we mimic RelRoot::codeGen logic here: "copy the current // context-wide TransMode, then overlay with this stmt's 'FOR xxx ACCESS' // setting, if any". TransMode tmode; tmode.updateTransMode(CmpCommon::transMode()); StmtLevelAccessOptions &opts = ((RelRoot*)this)->accessOptions(); if (opts.accessType() != ACCESS_TYPE_NOT_SPECIFIED_) { tmode.updateAccessModeFromIsolationLevel (TransMode::ATtoIL(opts.accessType())); tmode.setStmtLevelAccessOptions(); } if (isTrueRoot()) { // these are needed by Javier's qc stats virtual tbl interface cwa.setIsoLvl(tmode.getIsolationLevel()); cwa.setAccessMode(tmode.getAccessMode()); cwa.setAutoCommit(tmode.getAutoCommit()); cwa.setFlags(tmode.getFlags()); cwa.setRollbackMode(tmode.getRollbackMode()); cwa.setAutoabortInterval(tmode.getAutoAbortIntervalInSeconds()); cwa.setMultiCommit(tmode.getMultiCommit()); } // needed to distinguish these queries and avoid a false hit // select * from (delete from t where a=2) as t; // select * from (delete from t where a=2 for SKIP CONFLICT ACCESS) as t; char mode[40]; str_itoa(tmode.getIsolationLevel(), mode); cwa += " il:"; cwa += mode; str_itoa(tmode.getAccessMode(), mode); cwa += " am:"; cwa += mode; // Solution: 10-060418-5903 str_itoa(cwa.getIsoLvlForUpdates(), mode); cwa += " ilu:"; cwa += mode; str_itoa(tmode.getAutoCommit(), mode); cwa += " ac:"; cwa += mode; str_itoa(tmode.getFlags(), mode); cwa += " fl:"; cwa += mode; str_itoa(tmode.getRollbackMode(), mode); cwa += " rm:"; cwa += mode; str_itoa(tmode.getAutoAbortIntervalInSeconds(), mode); cwa += " ai:"; cwa += mode; str_itoa(tmode.getMultiCommit(), mode); cwa += " mc:"; cwa += mode; if (opts.lockMode() != LOCK_MODE_NOT_SPECIFIED_) { // need to distinguish these queries and avoid a false hit // select * from t in share mode; // select * from t in exclusive mode; str_itoa(opts.lockMode(), mode); cwa += " lm:"; cwa += mode; } // updatableSelect_ is essential. Otherwise, queries like // "select * from t" and "select * from t for update" can confuse // query caching into a false hit, causing fullstack/test051 to fail. if (updatableSelect_) { cwa += " 4updt "; } // for update of col [,col]... clause is important ItemExpr *updCol = updateColTree_ ? updateColTree_ : updateCol_.rebuildExprTree(); if (updCol) { cwa += " updCol:"; updCol->generateCacheKey(cwa); } // making the CQS part of the key is more efficient than calling // CompilerEnv::changeEnv() in ControlDB::setRequiredShape() if (reqdShape_) { reqdShape_->unparse(cwa.reqdShape_); } }
ItemExpr * buildEncodeTree(desc_struct * column, desc_struct * key, NAString * dataBuffer, //IN:contains original value Generator * generator, ComDiagsArea * diagsArea) { ExpGenerator * expGen = generator->getExpGenerator(); // values are encoded by evaluating the expression: // encode (cast (<dataBuffer> as <datatype>)) // where <dataBuffer> points to the string representation of the // data value to be encoded, and <datatype> contains the // PIC repsentation of the columns's datatype. // create the CAST part of the expression using the parser. // if this is a nullable column and the key value passed in // is a NULL value, then treat it as a special case. A NULL value // is passed in as an unquoted string of characters NULL in the // dataBuffer. This case has to be treated different since the // parser doesn't recognize the syntax "CAST (NULL as <datatype>)". NAString ns; ItemExpr * itemExpr; NABoolean nullValue = FALSE; NABoolean caseinsensitiveEncode = FALSE; if (column->body.columns_desc.caseinsensitive) caseinsensitiveEncode = TRUE; if (column->body.columns_desc.null_flag && dataBuffer->length() >= 4 && str_cmp(*dataBuffer, "NULL", 4) == 0) { nullValue = TRUE; ns = "CAST ( @A1 AS "; ns += column->body.columns_desc.pictureText; ns += ");"; // create a NULL constant ConstValue * nullConst = new(expGen->wHeap()) ConstValue(); nullConst->synthTypeAndValueId(); itemExpr = expGen->createExprTree(ns, CharInfo::UTF8, ns.length(), 1, nullConst); } else { ns = "CAST ( "; ns += *dataBuffer; ns += " AS "; ns += column->body.columns_desc.pictureText; ns += ");"; itemExpr = expGen->createExprTree(ns, CharInfo::UTF8, ns.length()); } CMPASSERT(itemExpr != NULL); ItemExpr *boundItemExpr = itemExpr->bindNode(generator->getBindWA()); if (boundItemExpr == NULL) return NULL; // make sure that the source and target values have compatible type. // Do this only if source is not a null value. NAString srcval; srcval = ""; srcval += *dataBuffer; srcval += ";"; ItemExpr * srcNode = expGen->createExprTree(srcval, CharInfo::UTF8, srcval.length()); CMPASSERT(srcNode != NULL); srcNode->synthTypeAndValueId(); if ((NOT nullValue) && (NOT srcNode->getValueId().getType().isCompatible(itemExpr->getValueId().getType()))) { if (diagsArea) { emitDyadicTypeSQLnameMsg(-4039, itemExpr->getValueId().getType(), srcNode->getValueId().getType(), column->body.columns_desc.colname, NULL, diagsArea); } return NULL; } if (column->body.columns_desc.null_flag) ((NAType *)&(itemExpr->getValueId().getType()))->setNullable(TRUE); else ((NAType *)&(itemExpr->getValueId().getType()))->setNullable(FALSE); // Explode varchars by moving them to a fixed field // whose length is equal to the max length of varchar. ////collation?? DataType datatype = column->body.columns_desc.datatype; if (DFS2REC::isSQLVarChar(datatype)) { char lenBuf[10]; NAString vc((NASize_T)100); // preallocate a big-enough buf size_t len = column->body.columns_desc.length; if (datatype == REC_BYTE_V_DOUBLE) len /= SQL_DBCHAR_SIZE; vc = "CAST (@A1 as CHAR("; vc += str_itoa(len, lenBuf); if ( column->body.columns_desc.character_set == CharInfo::UTF8 || ( column->body.columns_desc.character_set == CharInfo::SJIS && column->body.columns_desc.encoding_charset == CharInfo::SJIS ) ) { vc += " BYTE"; if (len > 1) vc += "S"; } vc += ") CHARACTER SET "; vc += CharInfo::getCharSetName(column->body.columns_desc.character_set); vc += ");"; itemExpr = expGen->createExprTree(vc, CharInfo::UTF8, vc.length(), 1, itemExpr); itemExpr->synthTypeAndValueId(); ((NAType *)&(itemExpr->getValueId().getType()))-> setNullable(column->body.columns_desc.null_flag); } // add the encode node on top of it. short desc_flag = TRUE; if (key->body.keys_desc.ordering == 0) // ascending desc_flag = FALSE; itemExpr = new(expGen->wHeap()) CompEncode(itemExpr, desc_flag); itemExpr->synthTypeAndValueId(); ((CompEncode*)itemExpr)->setCaseinsensitiveEncode(caseinsensitiveEncode); return itemExpr; }
int init_nuauthconf(struct nuauth_params **result) { struct nuauth_params *conf; char *gwsrv_addr = NULL; int connect_policy = POLICY_MULTIPLE_LOGIN; conf = g_new0(struct nuauth_params, 1); *result = conf; conf->client_srv = nuauth_config_table_get_or_default("nuauth_client_listen_addr", AUTHREQ_CLIENT_LISTEN_ADDR); conf->nufw_srv = nuauth_config_table_get_or_default("nuauth_nufw_listen_addr", AUTHREQ_NUFW_LISTEN_ADDR); gwsrv_addr = nuauth_config_table_get_or_default("nufw_gw_addr", GWSRV_ADDR); conf->authreq_port = nuauth_config_table_get_or_default("nuauth_gw_packet_port", str_itoa(AUTHREQ_PORT)); conf->userpckt_port = nuauth_config_table_get_or_default("nuauth_user_packet_port", str_itoa(USERPCKT_PORT)); conf->nbuser_check = nuauth_config_table_get_or_default_int("nuauth_number_usercheckers", NB_USERCHECK); conf->nbacl_check = nuauth_config_table_get_or_default_int("nuauth_number_aclcheckers", NB_ACLCHECK); conf->nbipauth_check = nuauth_config_table_get_or_default_int("nuauth_number_ipauthcheckers", NB_ACLCHECK); conf->log_users = nuauth_config_table_get_or_default_int("nuauth_log_users", 9); conf->log_users_sync = nuauth_config_table_get_or_default_int("nuauth_log_users_sync", 1); conf->log_users_strict = nuauth_config_table_get_or_default_int("nuauth_log_users_strict", 1); conf->log_users_without_realm = nuauth_config_table_get_or_default_int("nuauth_log_users_without_realm", 1); conf->prio_to_nok = nuauth_config_table_get_or_default_int("nuauth_prio_to_nok", 2); conf->single_user_client_limit = nuauth_config_table_get_or_default_int("nuauth_single_user_client_limit", 0); conf->single_ip_client_limit = nuauth_config_table_get_or_default_int("nuauth_single_ip_client_limit", 0); connect_policy = nuauth_config_table_get_or_default_int("nuauth_connect_policy", POLICY_MULTIPLE_LOGIN); conf->reject_after_timeout = nuauth_config_table_get_or_default_int("nuauth_reject_after_timeout", 0); conf->reject_authenticated_drop = nuauth_config_table_get_or_default_int("nuauth_reject_authenticated_drop", 0); conf->nbloggers = nuauth_config_table_get_or_default_int("nuauth_number_loggers", NB_LOGGERS); conf->nb_session_loggers = nuauth_config_table_get_or_default_int("nuauth_number_session_loggers", NB_LOGGERS); conf->nb_auth_checkers = nuauth_config_table_get_or_default_int("nuauth_number_authcheckers", NB_AUTHCHECK); conf->packet_timeout = nuauth_config_table_get_or_default_int("nuauth_packet_timeout", PACKET_TIMEOUT); conf->session_duration = nuauth_config_table_get_or_default_int("nuauth_session_duration", SESSION_DURATION); conf->datas_persistance = nuauth_config_table_get_or_default_int("nuauth_datas_persistance", 9); conf->push = nuauth_config_table_get_or_default_int("nuauth_push_to_client", 1); conf->user_check_ip_equality = nuauth_config_table_get_or_default_int("nuauth_user_check_ip_equality", 1); conf->do_ip_authentication = nuauth_config_table_get_or_default_int("nuauth_do_ip_authentication", 0); conf->acl_cache = nuauth_config_table_get_or_default_int("nuauth_acl_cache", 0); conf->user_cache = nuauth_config_table_get_or_default_int("nuauth_user_cache", 0); #if USE_UTF8 conf->uses_utf8 = nuauth_config_table_get_or_default_int("nuauth_uses_utf8", 1); #else conf->uses_utf8 = nuauth_config_table_get_or_default_int("nuauth_uses_utf8", 0); #endif conf->hello_authentication = nuauth_config_table_get_or_default_int("nuauth_hello_authentication", 0); conf->use_groups_name = nuauth_config_table_get_or_default_int("nuauth_use_groups_name", 0); conf->debug_areas = nuauth_config_table_get_or_default_int("nuauth_debug_areas", DEFAULT_DEBUG_AREAS); debug_areas = conf->debug_areas; conf->debug_level = nuauth_config_table_get_or_default_int("nuauth_debug_level", DEFAULT_DEBUG_LEVEL); debug_level = conf->debug_level; conf->log_to_syslog = nuauth_config_table_get_or_default_int("nuauth_log_to_syslog", 1); conf->nuauth_uses_fake_sasl = nuauth_config_table_get_or_default_int("nuauth_uses_fake_sasl", 1); #ifdef BUILD_NUAUTH_COMMAND conf->use_command_server = nuauth_config_table_get_or_default_int("nuauth_use_command_server", 1); #endif conf->proto_wait_delay = nuauth_config_table_get_or_default_int("nuauth_proto_wait_delay", DEFAULT_PROTO_WAIT_DELAY); conf->drop_if_no_logging = nuauth_config_table_get_or_default_int("nuauth_drop_if_no_logging", FALSE); conf->max_unassigned_messages = nuauth_config_table_get_or_default_int("nuauth_max_unassigned_messages", MAX_UNASSIGNED_MESSAGES); conf->push_delay = nuauth_config_table_get_or_default_int("nuauth_push_delay", PUSH_DELAY); conf->krb5_service = nuauth_config_table_get_or_default("nuauth_krb5_service", DEFAULT_KRB5_SERVICE); conf->krb5_hostname = nuauth_config_table_get("nuauth_krb5_hostname"); conf->krb5_realm = nuauth_config_table_get("nuauth_krb5_realm"); conf->hash_algo = nuauth_config_table_get_or_default_int("nuauth_client_hash_algo", NUSSL_HASH_SHA512); if (conf->debug_level > 9) { conf->debug_level = 9; } build_prenuauthconf(conf, gwsrv_addr, connect_policy); //g_free(gwsrv_addr); return 1; }
static void append_number(char *buf, const int sz, const int num) { char s[32]; str_itoa (num, s, sizeof s); append_string(buf, sz, s); }