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

C++ RLOG函数代码示例

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

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



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

示例1: ffmpeg_hls_setopt

static int ffmpeg_hls_setopt(URLContext *h, int cmd,int flag,unsigned long info){
    if(h == NULL||h->priv_data == NULL){
        RLOG("Failed call :%s\n",__FUNCTION__);
        return -1;
    } 
    FFMPEG_HLS_CONTEXT* ctx = (FFMPEG_HLS_CONTEXT*)h->priv_data;
	int ret=-1;
	if(AVCMD_SET_CODEC_BUFFER_INFO==cmd){
		if(flag ==0){	
			ctx->codec_buf_level=info;
		}else if(flag ==1){
			ctx->codec_vbuf_size = info;
 		}else if(flag ==2){
			ctx->codec_abuf_size = info;
		}else if(flag ==3){
			ctx->codec_vdat_size = info;
		}else if(flag ==4){
			ctx->codec_adat_size = info;
		}
        if(ctx->bandwidth_num>0){
            int bw = 0;
            m3u_session_get_cur_bandwidth(ctx->hls_ctx,&bw);    
            int sec = _hls_estimate_buffer_time(ctx,bw);
            m3u_session_set_codec_data(ctx->hls_ctx,sec);
        
        }
        
        if(ctx->debug_level>3){
            RLOG("set codec buffer,type = %d,info=%d\n",flag,(int)info);
        }
		ret=0;
	}
	return ret;
}
开发者ID:bywayboy,项目名称:amlogic-libplayer,代码行数:34,代码来源:ffmpeg_hls_wrapper.c


示例2: CheckValueMap

void CheckValueMap()
{
    RLOG("------------------------------");
    RLOG("CheckValueMap");
    Value x = 123;
    Value y = x;
    ValueMap h;
    h.Add("0", 123);
    RDUMP(h["0"]);
    h.Add("1", Date(2001, 12, 1));
    h.Add("2", "test");

    Value v = h;
    ASSERT(v.GetCount() == 3);
    RDUMP(v["0"]);
    ASSERT(v["0"] == 123);
    ASSERT(v["1"] == Date(2001, 12, 1));
    ASSERT(v["2"] == "test");
    ASSERT(IsValueMap(v));
    ASSERT(IsValueArray(v));

    ValueMap hh = v;
    ASSERT(hh == h);
    hh.Add(123, "foo");
    ASSERT(hh.GetCount() == 4);
    ASSERT(v.GetCount() == 3);
    ASSERT(hh[123] == "foo");

    ValueArray va = v;
    ASSERT(va.GetCount() == 3);
    ASSERT(va[0] == 123);
    ASSERT(va[1] == Date(2001, 12, 1));
    ASSERT(va[2] == "test");
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:34,代码来源:Checks.cpp


示例3: LOGINVOKE

HRESULT OcxObject::RawInvoke(IRef<ITypeInfo>& typeinfo, IDispatch *dispatch, DISPID dispid, word flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excep, unsigned *arg_err)
{
	LOGINVOKE("IDispatch::Invoke");
	if(dispid == 0) { // convert object to dispatch value
		if(!result) return E_INVALIDARG;
		result->vt = VT_DISPATCH;
		result->pdispVal = dispatch;
		if(dispatch) dispatch->AddRef();
		return S_OK;
	}
	if(!typeinfo) {
		LOG("dispid = " << FormatIntHex(dispid) << ": typeinfo = NULL");
		return E_FAIL;
	}
#if LOG_INVOKES >= 1
	BSTR names[1] = { NULL };
	unsigned count = 0;
	typeinfo->GetNames(dispid, names, 1, &count);
	String name;
	if(names[0])
		name = BSTRToString(names[0]);
	else
		name = FormatIntHex(dispid);
	switch(flags) {
	case DISPATCH_METHOD:         name << " - method"; break;
	case DISPATCH_PROPERTYGET:    name << " - propget"; break;
	case DISPATCH_PROPERTYPUT:    name << " - propput"; break;
	case DISPATCH_PROPERTYPUTREF: name << " - propputref"; break;
	}
	LOG("Member name: " << name);
#endif
	if(!typeinfo)
		return E_FAIL;
	TYPEATTR *attr;
	typeinfo->GetTypeAttr(&attr);
	LOGINVOKE("GetTypeInfo: typekind = " << (int)attr->typekind);
//	HRESULT res = typeinfo->Invoke(dispatch, dispid, flags, params, result, excep, arg_err);
	HRESULT res = DispInvoke(dispatch, ~typeinfo, dispid, flags, params, result, excep, arg_err);
	if(FAILED(res)) {
		RLOG("failure: dispid = " << (int)dispid << ", #args = " << (int)params->cArgs
			<< ", #named args = " << (int)params->cNamedArgs << ", return " << FormatIntHex(result));
		for(int i = 0; i < (int)params->cArgs; i++) {
			RLOG("arg[" << i << "] (vt = " << (int)params->rgvarg[i].vt << "): " << StdFormat(AsValue(params->rgvarg[i])));
		}
		RLOG("#funcs = " << attr->cFuncs);
		for(int i = 0; i < attr->cFuncs; i++) {
			FUNCDESC *func;
			typeinfo->GetFuncDesc(i, &func);
			RLOG("memid = " << func->memid << ", cParams " << func->cParams
			<< ", cParamsOpt = " << func->cParamsOpt << ", cScodes " << func->cScodes
			<< ", funckind = " << (int)func->funckind << ", invkind " << (int)func->invkind
			<< ", flags = " << FormatIntHex(func->wFuncFlags));

			typeinfo->ReleaseFuncDesc(func);
		}
	}
	typeinfo->ReleaseTypeAttr(attr);
	LOGINVOKE("//IDispatch::Invoke");
	return LOGRESULT(res);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:60,代码来源:util.cpp


示例4: warning

PropertyTest::PropertyTest()

//initializer space for constant Properties or Accessors

#pragma warning(push)
#pragma warning(disable:4355)
	: vp( THISBACK(SetD), THISBACK(GetD) )
	, va( THISBACK(SetDa), THISBACK(GetDa) )
#pragma warning(pop)

{
	CtrlLayout(*this, "Window title");

	//setting, will call SetD
	vp = 123;

	//getting, will call GetD
	Value v = vp;
	RLOG(v);
	
	///
	
	bool b;
	b = va.Set(456); //will call SetDa
	
	v = Value();
	b = va.Get(v); //will call GetDa
	if(b) RLOG(v);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:29,代码来源:main.cpp


示例5: ffmpeg_hls_read

static int ffmpeg_hls_read(URLContext *h, unsigned char *buf, int size){
    if(h == NULL||h->priv_data == NULL||size<=0){
        RLOG("failed to read data\n");
        return -1;
    }
    FFMPEG_HLS_CONTEXT* ctx = (FFMPEG_HLS_CONTEXT*)h->priv_data;
    void * hSession = ctx->hls_ctx;
    int len = AVERROR(EIO);
    int counts = 10;
    
    do {
        if (url_interrupt_cb()>0) {
            RLOG("url_interrupt_cb\n");
            len = 0;
            break;
        }
        len = m3u_session_read_data(hSession, buf,size);

        if (len <0) {
            if(len == AVERROR(EAGAIN)){
                usleep(1000*100);
            }else{
                break;
            }
        }
        if (len >= 0) {
            break;
        }
    } while (counts-- > 0);
    if(ctx->debug_level>5){
        RLOG("%s,want:%d,got:%d\n",__FUNCTION__,size,len);
    }
    return len;
}
开发者ID:bywayboy,项目名称:amlogic-libplayer,代码行数:34,代码来源:ffmpeg_hls_wrapper.c


示例6: VLOG

void RenameOp::undo() {
  VLOG(1) << "in undoRename";

  if (last == renameList->begin()) {
    VLOG(1) << "nothing to undo";
    return;  // nothing to undo
  }

  // list has to be processed backwards, otherwise we may rename
  // directories and directory contents in the wrong order!
  int undoCount = 0;
  list<RenameEl>::const_iterator it = last;

  while (it != renameList->begin()) {
    --it;

    VLOG(1) << "undo: renaming " << it->newCName << " -> " << it->oldCName;

    unix::rename(it->newCName.c_str(), it->oldCName.c_str());
    try {
      dn->renameNode(it->newPName.c_str(), it->oldPName.c_str(), false);
    } catch (encfs::Error &err) {
      RLOG(WARNING) << err.what();
      // continue on anyway...
    }
    ++undoCount;
  };

  RLOG(WARNING) << "Undo rename count: " << undoCount;
}
开发者ID:irslambouf,项目名称:encfs4win,代码行数:30,代码来源:DirNode.cpp


示例7: sizeof

void ObjectFile::Dump() const
{
	int sym_size = (ref_sections.GetCount() + ref_externals.GetCount()) * sizeof(int);
	int sec_size = sections.GetCount() * sizeof(Section);
	int mapped_size = sizeof(ObjectFile) + sym_size + sec_size;

	RLOG("ObjectFile(" << library_file << ":" << object_file << "), mapped size = " << mapped_size
		<< " (" << sym_size << " in symbols, " << sec_size << " in sections)");
//	RLOG("Linker directives: " << directives);
	RLOG("#sections = " << sections.GetCount());
/*
	for(int i = 0; i < sections.GetCount(); i++)
	{
		const Section& sec = sections[i];
		RLOG(NFormat("[%d]: %s", i, linkjob[sec.name_atom]));
		int end_ext = (i + 1 < sections.GetCount() ? sections[i + 1].ref_ext_index : ref_externals.GetCount());
		int end_sec = (i + 1 < sections.GetCount() ? sections[i + 1].ref_sec_index : ref_sections.GetCount());
		RLOG("#external references = " << (end_ext - sec.ref_ext_index));
		int r;
		for(r = sec.ref_ext_index; r < end_ext; r++)
			RLOG(linkjob[linkjob.globals.GetKey(ref_externals[r])]);
		RLOG("#section references = " << (end_sec - sec.ref_sec_index));
		for(r = sec.ref_sec_index; r < end_sec; r++)
			RLOG(NFormat("%04x", ref_sections[r]));
	}
*/
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:27,代码来源:object.cpp


示例8: ServiceSignal

static void WINAPI ServiceSignal(DWORD OpCode)
{
	switch(OpCode) {
		case SERVICE_CONTROL_PAUSE: {
			RLOG(ThreadId() << "service pause");
			ServiceStatus.dwControlsAccepted = 0;
			ServiceStatus.dwCheckPoint = 1;
			ServiceStatus.dwCurrentState = SERVICE_PAUSE_PENDING;
			if(!SetServiceStatus(ServiceStatusHandle, &ServiceStatus))
				break;
			PauseService();
			ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE
				| SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP;;
			ServiceStatus.dwCheckPoint = 0;
			ServiceStatus.dwCurrentState = SERVICE_PAUSED;
			SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
			break;
		}

		case SERVICE_CONTROL_CONTINUE: {
			RLOG(ThreadId() << "service continue");
			ServiceStatus.dwControlsAccepted = 0;
			ServiceStatus.dwCheckPoint = 1;
			ServiceStatus.dwCurrentState = SERVICE_CONTINUE_PENDING;
			if(!SetServiceStatus(ServiceStatusHandle, &ServiceStatus))
				break;
			ContinueService();
			ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE
				| SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP;
			ServiceStatus.dwCheckPoint = 0;
			ServiceStatus.dwCurrentState = SERVICE_RUNNING;
			SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
			break;
		}

		case SERVICE_CONTROL_SHUTDOWN:
		case SERVICE_CONTROL_STOP: {
			RLOG(ThreadId() << "service stop / shutdown");
			ServiceStatus.dwControlsAccepted = 0;
			ServiceStatus.dwCheckPoint = 1;
			ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
			ServiceStatus.dwWaitHint = 5000;
			if(!SetServiceStatus(ServiceStatusHandle, &ServiceStatus))
				break;
			StopService();
			ServiceStatus.dwCheckPoint = 0;
			ServiceStatus.dwCurrentState = SERVICE_STOPPED;
			SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
			break;
		}

		default: {
			break;
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:56,代码来源:service.cpp


示例9: EventHandler

static BOOL WINAPI EventHandler(DWORD CtrlType)
{
	RLOG("EventHandler (CtrlType = " << (int)CtrlType << ")");
	if(CtrlType == CTRL_LOGOFF_EVENT)
		RLOG("LOGOFF_EVENT (ignored)");
	else {
		RLOG("exiting");
		service_stopped = true;
	}
	return true;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:11,代码来源:service.cpp


示例10: RLOG

bool ElfRelocations::ResolveSymbol(ELF::Word rel_type,
                                   ELF::Word rel_symbol,
                                   const ElfSymbols* symbols,
                                   SymbolResolver* resolver,
                                   ELF::Addr reloc,
                                   ELF::Addr* sym_addr,
                                   Error* error) {
  const char* sym_name = symbols->LookupNameById(rel_symbol);
  RLOG("    symbol name='%s'\n", sym_name);
  void* address = resolver->Lookup(sym_name);

  if (address) {
    // The symbol was found, so compute its address.
    RLOG("%s: symbol %s resolved to %p\n", __FUNCTION__, sym_name, address);
    *sym_addr = reinterpret_cast<ELF::Addr>(address);
    return true;
  }

  // The symbol was not found. Normally this is an error except
  // if this is a weak reference.
  if (!symbols->IsWeakById(rel_symbol)) {
    error->Format("Could not find symbol '%s'", sym_name);
    return false;
  }

  RLOG("%s: weak reference to unresolved symbol %s\n", __FUNCTION__, sym_name);

  // IHI0044C AAELF 4.5.1.1:
  // Libraries are not searched to resolve weak references.
  // It is not an error for a weak reference to remain
  // unsatisfied.
  //
  // During linking, the value of an undefined weak reference is:
  // - Zero if the relocation type is absolute
  // - The address of the place if the relocation is pc-relative
  // - The address of nominal base address if the relocation
  //   type is base-relative.
  RelocationType r = GetRelocationType(rel_type);
  if (r == RELOCATION_TYPE_ABSOLUTE || r == RELOCATION_TYPE_RELATIVE) {
    *sym_addr = 0;
    return true;
  }

  if (r == RELOCATION_TYPE_PC_RELATIVE) {
    *sym_addr = reloc;
    return true;
  }

  error->Format(
      "Invalid weak relocation type (%d) for unknown symbol '%s'",
      r,
      sym_name);
  return false;
}
开发者ID:freiling,项目名称:mojo,代码行数:54,代码来源:crazy_linker_elf_relocations.cpp


示例11: RLOG

int dbDatabase::PutRecord(const String &tbname, int recno, dbRecord& Record, bool f) {
  int h;

#ifdef _WITH_DEBUG
RLOG("Put record: " + FormatInt(recno));
RLOG("Table: " + tbname);
#endif
  if((h = GetTableHandle(tbname)) == MTDB_TB_NOT_FOUND)
  	return MTDB_TB_NOT_FOUND;

	return PutRecord(h, recno, Record, f);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:12,代码来源:records.cpp


示例12: RunServiceDispatcher

void RunServiceDispatcher(String service_name_)
{
	ASSERT(service_name_.GetLength() < __countof(service_name));
	strcpy(service_name, service_name);
	static SERVICE_TABLE_ENTRY servicetable[] = {
		{ service_name, &ServiceInit },
		{ NULL, NULL }
	};

	RLOG(ThreadId() << "starting service control dispatcher");
	StartServiceCtrlDispatcher(servicetable);
	RLOG(ThreadId() << "exiting main thread");
	return;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:14,代码来源:service.cpp


示例13: recovery_usb

/* main menu activity */
void recovery_usb(int parent_id,LIBAROMA_RECTP rect){
  USBMENU var={0};
  
  /* init window */
  LIBAROMA_WINDOWP win = libaroma_ctl_fragment_new_window(
    recovery()->fragment, ID_USB_FRAGMENT
  );
  
  if (win){
    if (recovery_usb_init(win,&var)){
      libaroma_ctl_fragment_set_active_window(
        recovery()->fragment, ID_USB_FRAGMENT,
        1, 300, 0,
        recovery_usb_transition_cb, rect, NULL
      );
      libaroma_ctl_bar_set_color(
        recovery()->appbar, 
        RGB(555555),
        RGB(ffffff),
        0
      );
      recovery_usb_reset_appbar(win,&var);
      recovery_statusbar_setcolor(RGB(555555));
      
      recovery_usb_pool(win,&var);
      
      /* restore parent and delete usb fragment */
      libaroma_ctl_fragment_set_active_window(
        recovery()->fragment, parent_id,
        1, 300, 1,
        recovery_usb_transition_cb, NULL, rect
      );
      
      libaroma_ctl_bar_set_color(
        recovery()->appbar, 
        libaroma_colorget(NULL,recovery()->win)->primary,
        libaroma_colorget(NULL,recovery()->win)->primary_text,
        0
      );
      recovery_statusbar_setcolor(libaroma_colorget(NULL,win)->primary);
    }
    else{
      RLOG("recovery_usb: init window control failed");
      libaroma_ctl_fragment_del_window(recovery()->fragment,ID_USB_FRAGMENT);
    }
  }
  else{
    RLOG("recovery_usb: create main window failed");
  }
}
开发者ID:Ever-Never,项目名称:libaroma,代码行数:51,代码来源:recovery_usb.c


示例14: VLOG

/*
    We shouldn't have to support all possible open flags, so untaint the flags
    argument by only taking ones we understand and accept.
    -  Since the kernel has already done permission tests before calling us, we
       shouldn't have to worry about access control.
    -  Basically we just need to distinguish between read and write flags
    -  Also keep the O_LARGEFILE flag, in case the underlying filesystem needs
       it..
*/
int RawFileIO::open(int flags) {
  bool requestWrite = ((flags & O_RDWR) || (flags & O_WRONLY));
  VLOG(1) << "open call, requestWrite = " << requestWrite;

  int result = 0;

  // if we have a descriptor and it is writable, or we don't need writable..
  if ((fd >= 0) && (canWrite || !requestWrite)) {
    VLOG(1) << "using existing file descriptor";
    result = fd;  // success
  } else {
    int finalFlags = requestWrite ? O_RDWR : O_RDONLY;

#if defined(O_LARGEFILE)
    if (flags & O_LARGEFILE) finalFlags |= O_LARGEFILE;
#else
#ifndef _WIN32
#warning O_LARGEFILE not supported
#endif
#endif

    int newFd = ::my_open(name.c_str(), finalFlags);

    VLOG(1) << "open file with flags " << finalFlags << ", result = " << newFd;

    if ((newFd == -1) && (errno == EACCES)) {
      VLOG(1) << "using readonly workaround for open";
      newFd = open_readonly_workaround(name.c_str(), finalFlags);
    }

    if (newFd >= 0) {
      if (oldfd >= 0) {
        RLOG(ERROR) << "leaking FD?: oldfd = " << oldfd << ", fd = " << fd
                    << ", newfd = " << newFd;
      }

      // the old fd might still be in use, so just keep it around for
      // now.
      canWrite = requestWrite;
      oldfd = fd;
      result = fd = newFd;
    } else {
      result = -errno;
      RLOG(DEBUG) << "::open error: " << strerror(errno);
    }
  }

  return result;
}
开发者ID:succeedmr123,项目名称:encfs4win,代码行数:58,代码来源:RawFileIO.cpp


示例15: ffmpeg_hls_exseek

static int64_t ffmpeg_hls_exseek(URLContext *h, int64_t pos, int whence){
    if(h == NULL||h->priv_data == NULL){
        RLOG("Failed call :%s\n",__FUNCTION__);
        return -1;
    } 
    FFMPEG_HLS_CONTEXT* ctx = (FFMPEG_HLS_CONTEXT*)h->priv_data;
    void * hSession = ctx->hls_ctx;
    int ret;
    if(whence == AVSEEK_FULLTIME){
        if(ctx->durationUs>0){
            return  (int64_t)(ctx->durationUs/1000000);   
        }else{
            return -1;
        }
        
    }else if(whence == AVSEEK_BUFFERED_TIME){
        if(ctx->durationUs>0){
            int sec;
            m3u_session_get_cached_data_time(hSession,&sec);
            if(ctx->debug_level>3){
                RLOG("Got buffered time:%d\n",sec);
            }
            return sec;
        }else{
            return -1;
        }

    }else if(whence == AVSEEK_TO_TIME){
        if(ctx->durationUs>0&&pos>=0&&(pos*1000000)<ctx->durationUs){
            int64_t seekToUs = m3u_session_seekUs(hSession,pos*1000000,interrupt_call_cb);
            RLOG("Seek to time:%lld\n",seekToUs);
            return (seekToUs/1000000);
        }

    }else if(whence == AVSEEK_ITEM_TIME){//just for get will-download item time,for xiaomi,by zc
        if(ctx->durationUs>0){
            int64_t item_st = m3u_session_get_next_segment_st(hSession);
            if(ctx->debug_level>3){
                RLOG("Got next item start time:%lld us\n",item_st);
            }
            return item_st/1000000;
        }
    }else if(_get_system_prop(PROP_CMF_SUPPORT)>0&&ctx->durationUs>0){//only vod
        return _ffmpeg_cmf_exseek(h,pos,whence);        
    }
    RLOG("Never support this case,pos:%lld,whence:%d\n",(long long)pos,whence);
    return -1;
}
开发者ID:bywayboy,项目名称:amlogic-libplayer,代码行数:48,代码来源:ffmpeg_hls_wrapper.c


示例16: rAssert

int DirNode::mkdir(const char *plaintextPath, mode_t mode, uid_t uid,
                   gid_t gid) {
  string cyName = rootDir + naming->encodePath(plaintextPath);
  rAssert(!cyName.empty());

  VLOG(1) << "mkdir on " << cyName;

  // if uid or gid are set, then that should be the directory owner
#if 0
  int olduid = -1;
  int oldgid = -1;
  if (uid != 0) olduid = setfsuid(uid);
  if (gid != 0) oldgid = setfsgid(gid);
#endif

  int res = unix::mkdir(cyName.c_str(), mode);

#if 0
  if (olduid >= 0) setfsuid(olduid);
  if (oldgid >= 0) setfsgid(oldgid);
#endif

  if (res == -1) {
    int eno = errno;
    RLOG(WARNING) << "mkdir error on " << cyName << " mode " << mode << ": "
                  << strerror(eno);
    res = -eno;
  } else
    res = 0;

  return res;
}
开发者ID:irslambouf,项目名称:encfs4win,代码行数:32,代码来源:DirNode.cpp


示例17: InterlockedDecrement

int OcxTypeInfo::DecRef()
{
	int res = InterlockedDecrement(&refcount);
	RLOG("OcxTypeInfo::DecRef(" << name << " -> " << res << ")");
	VERIFY(res > 0); // if this throws, the factory has been over-released
	return res;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:7,代码来源:util.cpp


示例18: VLOG

bool CipherFileIO::writeHeader() {
  if (!base->isWritable()) {
    // open for write..
    int newFlags = lastFlags | O_RDWR;
    if (base->open(newFlags) < 0) {
      VLOG(1) << "writeHeader failed to re-open for write";
      return false;
    }
  }

  if (fileIV == 0) {
    RLOG(ERROR) << "Internal error: fileIV == 0 in writeHeader!!!";
  }
  VLOG(1) << "writing fileIV " << fileIV;

  unsigned char buf[8] = {0};
  for (int i = 0; i < 8; ++i) {
    buf[sizeof(buf) - 1 - i] = (unsigned char)(fileIV & 0xff);
    fileIV >>= 8;
  }

  cipher->streamEncode(buf, sizeof(buf), externalIV, key);

  IORequest req;
  req.offset = 0;
  req.data = buf;
  req.dataLen = 8;

  base->write(req);

  return true;
}
开发者ID:irslambouf,项目名称:encfs4win,代码行数:32,代码来源:CipherFileIO.cpp


示例19: withCipherPath

// helper function -- apply a functor to a cipher path, given the plain path
static int withCipherPath(const char *opName, const char *path,
                          function<int(EncFS_Context *, const string &)> op,
                          bool passReturnCode = false) {
  EncFS_Context *ctx = context();

  int res = -EIO;
  std::shared_ptr<DirNode> FSRoot = ctx->getRoot(&res);
  if (!FSRoot) return res;

  try {
    string cyName = FSRoot->cipherPath(path);
    VLOG(1) << "op: " << opName << " : " << cyName;

    res = op(ctx, cyName);

    if (res == -1) {
      int eno = errno;
      VLOG(1) << "op: " << opName << " error: " << strerror(eno);
      res = -eno;
    } else if (!passReturnCode) {
      res = ESUCCESS;
    }
  } catch (encfs::Error &err) {
    RLOG(ERROR) << "withCipherPath: error caught in " << opName << ": "
                << err.what();
  }
  return res;
}
开发者ID:aidan-fitz,项目名称:encfs,代码行数:29,代码来源:encfs.cpp


示例20: LLOG

bool Thread::Run(Callback _cb)
{
	LLOG("Thread::Run");
	AtomicInc(sThreadCount);
	if(!threadr)
#ifndef CPU_BLACKFIN
		threadr = sMain = true;
#else
	{
		threadr = true;
		//the sMain replacement
#ifdef PLATFORM_POSIX
		pthread_t thid = pthread_self();
		vm.Enter();
		if(threadsv.Find(thid) < 0){
			//thread not yet present, mark present
			threadsv.Add(thid);
		}
		else
			RLOG("BUG: Multiple Add in Mt.cpp");
		vm.Leave();
#endif
	}
#endif
	Detach();
	Callback *cb = new Callback(_cb);
#ifdef PLATFORM_WIN32
	handle = (HANDLE)_beginthreadex(0, 0, sThreadRoutine, cb, 0, ((unsigned int *)(&thread_id)));
#endif
#ifdef PLATFORM_POSIX
	if(pthread_create(&handle, 0, sThreadRoutine, cb))
		handle = 0;
#endif
	return handle;
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:35,代码来源:Mt.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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