本文整理汇总了C++中TRC函数的典型用法代码示例。如果您正苦于以下问题:C++ TRC函数的具体用法?C++ TRC怎么用?C++ TRC使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TRC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: physical_read
/*
** physical_read: attempt to read 'num' physical blocks starting at physical
** block 'start' into st->buf. Fails if st->buf is not large enough,
** suceeds otherwise (for now!)
*/
PUBLIC bool_t physical_read(ext2fs_st *st,
block_t start,
uint32_t num,
char *buf,
uint32_t buf_size)
{
USD_Extent extent;
USDCtl_Error rc;
uint32_t readlen;
readlen = num * st->disk.phys_block_size;
/* Check we're initialised, and have enough space for the read */
if(!st->disk.usdctl || (readlen > buf_size))
return False;
extent.base = start;
extent.len = num;
TRC(printf("EXT2: %d,%d -> %p\n", start, num, buf));
TRC(printf("[%d]\n", block));
rc = USDCtl$Request(st->disk.usdctl, &extent, FileIO_Op_Read, buf);
if (rc != USDCtl_Error_None) return False;
return True;
}
示例2: TR
void CUpdateDlg::DoUpdates()
{
::ShowWindow(GetDlgItem(IDOK), SW_HIDE);
::ShowWindow(GetDlgItem(IDC_UPDATEINFO), SW_HIDE);
m_listView.DeleteAllItems();
for (size_t i = 0; i < m_UpdateManager.m_updateList.size(); i++)
{
m_listView.AddItem(i, 0, m_UpdateManager.m_updateList[i].displayName());
m_listView.AddItem(i, 1, TR("В очереди"));
}
m_listView.ShowWindow(SW_SHOW);
m_UpdateManager.DoUpdates();
if (m_UpdateManager.successPackageUpdatesCount())
{
::ShowWindow(GetDlgItem(IDCANCEL), SW_HIDE);
::ShowWindow(GetDlgItem(IDOK), SW_SHOW);
TRC(IDOK, "Завершить");
m_bUpdateFinished = true;
}
else
{
::ShowWindow(GetDlgItem(IDCANCEL), SW_SHOW);
::ShowWindow(GetDlgItem(IDOK), SW_HIDE);
TRC(IDCANCEL, "Закрыть");
m_bUpdateFinished = false;
}
m_Checked = false;
}
示例3: MapInitialHeap
/*
** At startup we create a physical heap; while this is fine, the idea
** of protection is closely tied to that of stretches. Hence this function
** maps a stretch over the existing heap.
** This allows us to map it read/write for us, and read-only to everyone else.
*/
void MapInitialHeap(HeapMod_clp hmod, Heap_clp heap,
word_t heap_size, ProtectionDomain_ID pdom)
{
Stretch_clp str;
Heap_clp realheap;
addr_t a = (addr_t)((size_t)heap & ~(PAGE_SIZE-1));
TRC(eprintf(" + Mapping stretch over heap: 0x%x bytes at %p\n",
heap_size, a));
str = StretchAllocatorF$NewOver((StretchAllocatorF_cl *)Pvs(salloc),
heap_size, AXS_R, a, 0,
PAGE_WIDTH, NULL);
ASSERT_ADDRESS(str, a);
TRC(eprintf(" + Done!\n"));
realheap = HeapMod$Realize(hmod, heap, str);
if(realheap != heap)
eprintf("WARNING: HeapMod$Realize(%p) => %p\n",
heap, realheap);
/* Map our heap as local read/write */
STR_SETPROT(str, pdom, (SET_ELEM(Stretch_Right_Read)|
SET_ELEM(Stretch_Right_Write)));
}
示例4: TRC
LRESULT CNewFolderDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
TRC(IDC_FOLDERNAMELABEL, "Название папки/альбома:");
TRC(IDC_FOLDERDESCRLABEL, "Описание:");
TRC(IDC_ACCESSTYPELABEL, "Доступ:");
TRC(IDCANCEL, "Отмена");
TRC(IDOK, "OK");
DlgResize_Init();
CenterWindow(GetParent());
if(m_bCreateNewFolder)
SetWindowText(TR("Новая папка (альбом)"));
else
SetWindowText(TR("Редактирование папки"));
SetDlgItemText(IDC_FOLDERTITLEEDIT, Utf8ToWCstring(m_folder.title));
CString text = Utf8ToWCstring(m_folder.summary);
text.Replace(_T("\r"), _T(""));
text.Replace(_T("\n"), _T("\r\n"));
SetDlgItemText(IDC_FOLDERDESCREDIT, text);
for(size_t i=0; i< m_accessTypeList.size(); i++)
{
SendDlgItemMessage(IDC_ACCESSTYPECOMBO, CB_ADDSTRING, 0, (LPARAM) (LPCTSTR)Utf8ToWCstring(m_accessTypeList[i].c_str()));
}
SendDlgItemMessage(IDC_ACCESSTYPECOMBO, CB_SETCURSEL, m_folder.accessType);
::SetFocus(GetDlgItem(IDC_FOLDERTITLEEDIT));
return 0; // Let the system set the focus
}
示例5: Login_Validate_m
static bool_t Login_Validate_m (
Login_cl *self,
string_t certificate,
Domain_ID domain )
{
Login_st *st = self->st;
UnixLoginMod_st *lst = st->lst;
Certificate *c;
MU_LOCK(&lst->mu);
/* Find the certificate */
if (!StringTbl$Get(lst->certificate_tbl, certificate, (void *)&c)) {
MU_RELEASE(&lst->mu);
TRC(printf("Login_Validate: unknown certificate %s\n",certificate));
return False; /* Not a valid certificate */
}
/* Check the certificate */
if (!Security$CheckTag(lst->sec, c->tag, domain)) {
MU_RELEASE(&lst->mu);
TRC(printf("Login_Validate: certificate %s (%s) may not be used by"
"domain %qx\n",certificate, c->u->username, domain));
return False; /* Domain does not own certificate */
}
MU_RELEASE(&lst->mu);
return True; /* Certificate is valid for domain to use */
}
示例6: ModData_Register_m
static void ModData_Register_m (
ModData_cl *self,
string_t name /* IN */,
word_t offset /* IN */ )
{
mod_data_rec *m;
mod_data_entry *e;
TRC(fprintf(stderr, "ModData: Adding module %s, address %p\n", name,
offset));
if (!INFO_PAGE.mod_data) {
eprintf("ModData: no module data rec\n");
return;
}
m = INFO_PAGE.mod_data;
if (m->max_entries == m->num_entries) {
TRC(fprintf(stderr, "ModData: Expanding data area\n"));
m->max_entries += 10;
m->entries = Heap$Realloc(Pvs(heap),
m->entries,
m->max_entries * sizeof(*m->entries));
}
e = &m->entries[m->num_entries++];
e->name = strdup(name);
e->offset = offset;
}
示例7: IDCCallback_Closed_m
static void IDCCallback_Closed_m (
IDCCallback_cl *self,
IDCOffer_clp offer /* IN */,
IDCServerBinding_clp binding /* IN */,
const Type_Any *server /* IN */ )
{
ext2fs_st *st=self->st;
Client_st *c=NULL, *head;
int i;
/* A client has gone away. We have to close all of their files,
remove their stream from the USD, and delete all of the state
associated with them. */
/* set head to the start of the client list */
head= (&st->client.clients)->next;
/* search through the list to find the current client */
for (c=head; c!=(&st->client.clients); c=c->next)
{
if (c->binding==binding)
{
TRC(printf("ext2fs: disconnecting client %p\n", c));
TRC(printf("ext2fs: closing client's files\n"));
/* attempt to close the client's files (Ext2$Free
checks whether a handle is valid or not) */
for (i=0; i<MAX_CLIENT_HANDLES; i++)
{
Ext2$Free(&(c->cl), (Ext2_Handle)i, True);
}
/* destroy client's stream to the USD */
TRC(printf("ext2fs: deleting client's stream from USD\n"));
if ( USDCtl$DestroyStream(st->disk.usdctl, c->usd_stream) != USDCtl_Error_None)
printf("ext2fs: error deleting stream from USD\n");
/* remove client from client list */
LINK_REMOVE(c);
/* free client's state */
FREE(c);
TRC(printf("ext2fs: finished deleting stream\n"));
return;
}
}
printf("ext2fs: a client has disconnected. Couldn't find it's binding though. Oh dear.\n");
printf("ext2fs: a client has disconnected. Oh dear.\n");
}
示例8: Login_Login_m
static bool_t Login_Login_m (
Login_cl *self,
Security_Tag tag /* IN */,
string_t username /* IN */,
string_t password /* IN */
/* RETURNS */,
string_t *certificate )
{
Login_st *st = self->st;
UnixLoginMod_st *lst = st->lst;
User *u;
Certificate *c;
/* Check that caller owns the tag */
if (!Security$CheckTag(lst->sec, tag, st->id)) {
TRC(printf("Login: domain %qx doesn't have tag %qx\n",st->id,tag));
*certificate=strduph("invalid", lst->heap);
return False; /* Bad tag */
}
/* Lookup username */
if (!StringTbl$Get(lst->users, username, (void *)&u)) {
*certificate=strduph("invalid", lst->heap);
TRC(printf("Login: domain %qx tried to login with unknown "
"username %s\n",st->id,username));
return False; /* Bad username */
}
/* XXX Check password; skip for now */
/* Proceed: generate a new certificate */
c=Heap$Malloc(lst->heap, sizeof(*c));
if (!c) {
TRC(printf("Login: out of memory\n"));
return False; /* Out of memory */
}
MU_LOCK(&lst->mu);
c->tag=tag;
c->u=u;
c->cert=Heap$Malloc(lst->heap, 18+strlen(username));
sprintf(c->cert, "%s:%x", username, lst->certificate_id++);
LINK_ADD_TO_HEAD(&lst->certificate_list, c);
StringTbl$Put(lst->certificate_tbl, c->cert, c);
MU_RELEASE(&lst->mu);
*certificate=strduph(c->cert, lst->heap);
TRC(printf("Login: user %s logged in; issued certificate %s\n"
" bound to tag %qx\n",c->u->username,c->cert,tag));
return True; /* User logged on */
}
示例9: MuxDispatch_m
static void MuxDispatch_m(IDCServerStubs_clp self)
{
MuxServer_t *st = self->st;
ShmConnection_t *conn = st->conn;
word_t *id;
/* If it's been smoked, then let dispatch return happily */
if(DCB_EPRW(RO(Pvs(vp)), conn->eps.tx)->state == Channel_State_Dead)
return;
while(conn->call < VP$Poll (Pvs(vp), conn->eps.rx)) {
/* Unmarshall the binding id (first in the buf) */
id = conn->rxbuf.base;
/* Frob the rxbuf so that the servers underneath us are happy.
We will frob them back when we leave. */
conn->rxbuf.base += sizeof(*id);
conn->rxsize -= sizeof(*id);
conn->rxbuf.space = conn->rxsize;
/* We hijack the rx event count as marker so that the
ServerBinding knows it is being called from the
muxed dispatcher (rather than via the while {..}
in the Dispatch method of the stubs. */
conn->evs.rx = NULL_EVENT;
TRC(eprintf("call=%x, rx ep is %x (current val is %x).\n",
conn->call, conn->eps.rx,
VP$Poll(Pvs(vp), conn->eps.rx)));
if(*id >= st->nstubs) {
eprintf("Critical Error: got binding_id as %d (nstubs is %d)!\n",
*id, st->nstubs);
ntsc_dbgstop();
}
TRC(eprintf("=> server stubs are at %p\n", st->stubs[binding_id]));
TRC(eprintf("=> op = %p, st = %p, op->Dispatch = %p\n",
st->stubs[*id]->op,
st->stubs[*id]->st,
st->stubs[*id]->op->Dispatch));
IDCServerStubs$Dispatch(st->stubs[*id]);
TRC(eprintf("done dispatch!\n"));
/* Now we frob the rxbuf back again */
conn->rxbuf.base -= sizeof(*id);
conn->rxsize += sizeof(*id);
conn->rxbuf.space = conn->rxsize;
}
return;
}
示例10: SetDlgItemText
void CUpdateDlg::CheckUpdates()
{
m_listView.ShowWindow(SW_HIDE);
::ShowWindow(GetDlgItem(IDC_UPDATEINFO), SW_SHOW);
m_Checked = true;
SetDlgItemText(IDC_UPDATEINFO, TR("Проверка обновлений..."));
if (!m_UpdateManager.CheckUpdates())
{
TRC(IDCANCEL, "Закрыть");
m_Checked = false;
CString errorStr = TR("Ошибка при получении данных об обновлениях.");
errorStr += "\r\n";
errorStr += m_UpdateManager.ErrorString();
SetDlgItemText(IDC_UPDATEINFO, errorStr);
return;
}
Settings.LastUpdateTime = static_cast<int>(time(0));
if (m_UpdateManager.AreUpdatesAvailable())
{
if ( !m_UpdateManager.AreCoreUpdates() ) {
DoUpdates();
return;
}
if (CmdLine.IsOption(_T("update")))
{
DoUpdates();
return;
}
::ShowWindow(GetDlgItem(IDOK), SW_SHOW);
TRC(IDOK, "Обновить");
if (m_UpdateCallback)
m_UpdateCallback->UpdateAvailabilityChanged(true);
if (ShouldStop())
return;
if (!IsWindowVisible())
SetTimer(2, 2000, 0);
CString text = m_UpdateManager.generateReport();
SetDlgItemText(IDC_UPDATEINFO, text);
return;
}
else
{
TRC(IDCANCEL, "Закрыть");
SetDlgItemText(IDC_UPDATEINFO, TR("Обновление не требуется."));
}
}
示例11: TRC
LRESULT CTraySettingsPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
TRC(IDC_SHOWTRAYICON,"Показывать значок в трее");
TRC(IDC_MOUSEREACTIONGROUP,"Реакция на действия мыши");
TRC(IDC_LEFTBUTTONDOUBLECLICKLABEL,"Двойной клик левой кнопкой");
TRC(IDC_LEFTBUTTONCLICKLABEL,"Одиночный клик левой кнопкой");
TRC(IDC_MIDDLEBUTTONCLICKLABEL,"Клик средней кнопкой");
TRC(IDC_RIGHTBUTTONCLICKLABEL,"Клик правой кнопкой");
TRC(IDC_ONEINSTANCE,"Не запускать новые копии программы из трея");
TRC(IDC_AUTOSTARTUP, "Запуск программы при старте Windows");
//CTrayActions trayActions;
for(size_t i=0; i< Settings.Hotkeys/*trayActions*/.size(); i++)
{
SendDlgItemMessage(IDC_LEFTBUTTONDOUBLECLICKCOMBO, CB_ADDSTRING,0, (LPARAM)(LPCTSTR)Settings.Hotkeys[i].GetDisplayName());
SendDlgItemMessage(IDC_LEFTBUTTONCLICKCOMBO, CB_ADDSTRING,0, (LPARAM)(LPCTSTR)Settings.Hotkeys[i].GetDisplayName());
SendDlgItemMessage(IDC_MIDDLEBUTTONCLICKCOMBO, CB_ADDSTRING,0, (LPARAM)(LPCTSTR)Settings.Hotkeys[i].GetDisplayName());
SendDlgItemMessage(IDC_RIGHTBUTTONCLICKCOMBO, CB_ADDSTRING,0, (LPARAM)(LPCTSTR)Settings.Hotkeys[i].GetDisplayName());
}
SendDlgItemMessage(IDC_SHOWTRAYICON, BM_SETCHECK,Settings.ShowTrayIcon);
SendDlgItemMessage(IDC_AUTOSTARTUP, BM_SETCHECK,Settings.AutoStartup);
SendDlgItemMessage(IDC_ONEINSTANCE, BM_SETCHECK,Settings.TrayIconSettings.DontLaunchCopy);
OnShowTrayIconBnClicked(BN_CLICKED, IDC_SHOWTRAYICON, 0);
SendDlgItemMessage(IDC_LEFTBUTTONDOUBLECLICKCOMBO, CB_SETCURSEL,Settings.TrayIconSettings.LeftDoubleClickCommand);
SendDlgItemMessage(IDC_LEFTBUTTONCLICKCOMBO, CB_SETCURSEL,Settings.TrayIconSettings.LeftClickCommand);
SendDlgItemMessage(IDC_MIDDLEBUTTONCLICKCOMBO, CB_SETCURSEL,Settings.TrayIconSettings.MiddleClickCommand);
SendDlgItemMessage(IDC_RIGHTBUTTONCLICKCOMBO, CB_SETCURSEL,Settings.TrayIconSettings.RightClickCommand);
return 1; // Let the system set the focus
}
示例12: TRC
bool ServiceBase::OnCommand(DWORD dwControl, DWORD dwEventType, void *lpEventData) {
TRC(2, ServiceName << ": " << ServiceControlToString(dwControl));
switch (dwControl) {
case SERVICE_CONTROL_STOP:
Stop();
break;
case SERVICE_CONTROL_SHUTDOWN:
Status = SERVICE_STOP_PENDING;
OnShutdown();
break;
case SERVICE_CONTROL_PAUSE:
Status = SERVICE_PAUSE_PENDING;
OnPause();
break;
case SERVICE_CONTROL_CONTINUE:
Status = SERVICE_CONTINUE_PENDING;
OnContinue();
break;
case SERVICE_CONTROL_INTERROGATE:
Status = m_status;
break;
case SERVICE_CONTROL_POWEREVENT:
OnPowerEvent((PowerBroadcastStatus)dwEventType);
break;
case SERVICE_CONTROL_SESSIONCHANGE:
{
SessionChangeDescription scd = { (SessionChangeReason)dwEventType, (int)((WTSSESSION_NOTIFICATION*)lpEventData)->dwSessionId };
TRC(2, ReasonToString(scd.Reason));
OnSessionChange(scd);
}
break;
case SERVICE_CONTROL_PARAMCHANGE:
OnParamChange();
break;
case SERVICE_CONTROL_TIMECHANGE:
OnTimeChange();
break;
case SERVICE_CONTROL_HARDWAREPROFILECHANGE:
OnHardwareProfileChange();
break;
default:
if (dwControl >= 128 && dwControl <= 255)
OnCustomCommand(dwControl);
else
return false;
}
return true;
}
示例13: Binder_Done
/*
* This routine is called by the domain manager to complete initialisation
* of the first domain.
*/
void Binder_Done(DomainMgr_st *dm_st)
{
PerDomain_st *bst = ROP_TO_PDS(dm_st->dm_dom);
Closure_clp cl;
bst->callback = dm_st->bcb;
TRC(eprintf ("Binder_Done: bst=%x callback=%x.\n", bst, bst->callback));
cl = Entry$Closure (Pvs(entry));
Threads$Fork (Pvs(thds), cl->op->Apply, cl, 0);
Threads$Fork (Pvs(thds), cl->op->Apply, cl, 0);
#if 0
Threads$Fork (Pvs(thds), cl->op->Apply, cl, 0);
#endif /* 0 */
TRC(eprintf ("Binder_Done: forked server thread\n"));
}
示例14: sub_image
int sub_image (imageptr iptr, regionptr rptr, imageptr *optr)
{
int nx,ny,nz, nx1,ny1,nz1, ix,iy,iz, ix0,iy0,iz0;
size_t np, np1;
nx = Nx(iptr);
ny = Ny(iptr);
nz = Nz(iptr);
np = nx*ny*nz;
/* grab the bounding box */
ix0 = BLC(rptr)[0];
iy0 = BLC(rptr)[1];
iz0 = BLC(rptr)[2];
nx1 = TRC(rptr)[0] - ix0;
ny1 = TRC(rptr)[1] - iy0;
nz1 = TRC(rptr)[2] - iz0;
np1 = nx1*ny1*nz1;
*optr = (imageptr ) allocate(sizeof(image));
dprintf (DLEV,"copy_image:Allocated image @ %d size=%d * %d * %d",*optr,nx1,ny1,nz1);
Frame(*optr) = (real *) allocate(np1*sizeof(real));
dprintf (DLEV,"Frame allocated @ %d ",Frame(*optr));
Nx(*optr) = nx1;
Ny(*optr) = ny1;
Nz(*optr) = nz1;
Xmin(*optr) = Xmin(iptr) + ix0*Dx(iptr);
Ymin(*optr) = Ymin(iptr) + iy0*Dy(iptr);
Zmin(*optr) = Zmin(iptr) + iz0*Dz(iptr);
Dx(*optr) = Dx(iptr);
Dy(*optr) = Dy(iptr);
Dz(*optr) = Dz(iptr);
Namex(*optr) = mystrcpy(Namex(iptr));
Namey(*optr) = mystrcpy(Namey(iptr));
Namez(*optr) = mystrcpy(Namez(iptr));
Xref(*optr) = Xref(iptr) + ix0;
Yref(*optr) = Yref(iptr) + iy0;
Zref(*optr) = Zref(iptr) + iz0;
for (iz=0; iz<nz1; iz++)
for (iy=0; iy<ny1; iy++)
for (ix=0; ix<nx1; ix++)
CubeValue(*optr,ix,iy,iz) = CubeValue(iptr,ix-ix0,iy-iy0,iz-iy0);
Storage(*optr) = matdef[idef];
Axis(*optr) = Axis(iptr);
set_iarray(*optr);
return 1; /* succes return code */
}
示例15: udev_unref
LIBUDEV_EXPORT void
udev_unref(struct udev *udev)
{
TRC("(%p) refcount=%d", udev, udev->refcount);
_udev_unref(udev);
}