int plfs_opendir_c(const char *path, Plfs_dirp **pdirp) { debug_enter(__FUNCTION__,path); plfs_dir *pdir = new plfs_dir; *pdirp = (Plfs_dirp *)pdir; int ret = plfs_readdir(path, (void*)&(pdir->entries)); if (ret != 0) { delete pdir; *pdirp = NULL; } else { pdir->itr = pdir->entries.begin(); pdir->path = path; } debug_exit(__FUNCTION__,path,ret); return ret; }
int plfs_chown(const char *path, uid_t u, gid_t g) { int ret = 0; debug_enter(__FUNCTION__,path); char stripped_path[PATH_MAX]; stripPrefixPath(path, stripped_path); LogicalFileSystem *logicalfs = plfs_get_logical_fs(stripped_path); if (logicalfs == NULL) { ret = -EINVAL; }else{ ret = logicalfs->chown(stripped_path, u, g); } debug_exit(__FUNCTION__,path,ret); return ret; }
static GList * nemo_python_object_get_file_items (NemoMenuProvider *provider, GtkWidget *window, GList *files) { NemoPythonObject *object = (NemoPythonObject*)provider; GList *ret = NULL; PyObject *py_ret = NULL, *py_files; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); if (PyObject_HasAttrString(object->instance, "get_file_items_full")) { CONVERT_LIST(py_files, files); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_file_items_full", "(NNN)", pygobject_new((GObject *)provider), pygobject_new((GObject *)window), py_files); } else if (PyObject_HasAttrString(object->instance, "get_file_items")) { CONVERT_LIST(py_files, files); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", pygobject_new((GObject *)window), py_files); } else { goto beach; } HANDLE_RETVAL(py_ret); HANDLE_LIST(py_ret, NemoMenuItem, "Nemo.MenuItem"); beach: free_pygobject_data_list(files); Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; }
int plfs_query(Plfs_fd *fd, size_t *writers, size_t *readers, size_t *bytes_written, int *lazy_stat) { debug_enter(__FUNCTION__,fd->getPath()); bool reopen; int ret = 0; assert( fd != NULL); ret = fd->query(writers, readers, bytes_written, &reopen); if (lazy_stat) { PlfsConf *pconf = get_plfs_conf(); *lazy_stat = pconf->lazy_stat && !reopen; mlog(MLOG_DBG, "plfs_query lazy_stat: %d.\n", *lazy_stat); } debug_exit(__FUNCTION__,fd->getPath(),ret); return ret; }
/** * To be called whenever an itemset was updated. If it is the * displayed itemset it will be merged against the item list * tree view. */ void itemlist_merge_itemset (itemSetPtr itemSet) { gint folder_display_mode; debug_enter ("itemlist_merge_itemset"); debug_start_measurement (DEBUG_GUI); /* No node check when loading search results directly */ if (!itemlist_priv.isSearchResult) { nodePtr node = node_from_id (itemSet->nodeId); if (!itemlist_priv.currentNode) return; /* Nothing to do if nothing is displayed */ if (!IS_VFOLDER (itemlist_priv.currentNode) && (itemlist_priv.currentNode != node) && !node_is_ancestor (itemlist_priv.currentNode, node)) return; /* Nothing to do if the item set does not belong to this node, or this is a search folder */ conf_get_int_value (FOLDER_DISPLAY_MODE, &folder_display_mode); if (IS_FOLDER (itemlist_priv.currentNode) && !folder_display_mode) return; /* Bail out if it is a folder without the recursive display preference set */ debug1 (DEBUG_GUI, "reloading item list with node \"%s\"", node_get_title (node)); } else { /* If we are loading a search result we must never merge anything besides the search items. In fact if we already have items we just return. */ if (itemlist_priv.searchResultComplete) return; itemlist_priv.searchResultComplete = TRUE; } /* merge items into item view */ itemset_foreach (itemSet, itemlist_merge_item); itemview_update (); debug_end_measurement (DEBUG_GUI, "itemlist merge"); debug_exit ("itemlist_merge_itemset"); }
static void default_source_export (nodePtr node) { gchar *filename; if (feedlistImport) return; debug_enter ("default_source_source_export"); g_assert (node->source->root == feedlist_get_root ()); filename = default_source_source_get_feedlist (node); export_OPML_feedlist (filename, node->source->root, TRUE); g_free (filename); debug_exit ("default_source_source_export"); }
int plfs_link(const char *path, const char *to) { debug_enter(__FUNCTION__,path); int ret = 0; char stripped_path[PATH_MAX]; stripPrefixPath(path, stripped_path); char stripped_to[PATH_MAX]; stripPrefixPath(to, stripped_to); LogicalFileSystem *logicalfs = plfs_get_logical_fs(stripped_to); if (logicalfs == NULL) { ret = -EINVAL; }else{ ret = logicalfs->link(stripped_path, stripped_to); } debug_exit(__FUNCTION__,path,ret); return ret; }
static GList * caja_python_object_get_background_items (CajaMenuProvider *provider, GtkWidget *window, CajaFileInfo *file) { CajaPythonObject *object = (CajaPythonObject*)provider; GList *ret = NULL; PyObject *py_ret = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); if (PyObject_HasAttrString(object->instance, "get_background_items_full")) { py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_background_items_full", "(NNN)", pygobject_new((GObject *)provider), pygobject_new((GObject *)window), pygobject_new((GObject *)file)); } else if (PyObject_HasAttrString(object->instance, "get_background_items")) { py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", pygobject_new((GObject *)window), pygobject_new((GObject *)file)); } else { goto beach; } HANDLE_RETVAL(py_ret); HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem"); beach: free_pygobject_data(file, NULL); Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; }
/* * Class: org_jnetpcap_packet_JScanner * Method: init * Signature: (Lorg.jnetpcap.packet.JScan;)V */ JNIEXPORT void JNICALL Java_org_jnetpcap_packet_JScanner_init (JNIEnv *env, jobject obj, jobject jscan) { #ifdef DEBUG debug_enter("JScanner_init"); #endif if (jscan == NULL) { throwException(env, NULL_PTR_EXCEPTION, "JScan parameter can not be null"); return; } void *block = (char *)getJMemoryPhysical(env, obj); size_t size = (size_t)env->GetIntField(obj, jmemorySizeFID); memset(block, 0, size); scanner_t *scanner = (scanner_t *)block; scanner->sc_jscan = env->NewGlobalRef(jscan); scanner->sc_len = size - sizeof(scanner_t); scanner->sc_offset = 0; scanner->sc_packet = (packet_state_t *)((char *)block + sizeof(scanner_t)); for (int i = 0; i < MAX_ID_COUNT; i++) { scanner->sc_scan_table[i] = native_protocols[i]; } for (int i = 0; i < MAX_ID_COUNT; i++) { for (int j = 0; j < MAX_ID_COUNT; j++) { scanner->sc_heuristics_table[i][j] = native_heuristics[i][j]; } } /* Initialize sub-header area - allocate 1/10th */ scanner->sc_sublen = size / 10; scanner->sc_subindex = 0; scanner->sc_subheader = (header_t *)malloc(scanner->sc_sublen); #ifdef DEBUG debug_exit("JScanner_init"); #endif }
int plfs_access(const char *path, int mask) { int ret = 0; debug_enter(__FUNCTION__,path); LogicalFileSystem *logicalfs = plfs_get_logical_fs(path); if (logicalfs == NULL) { if (plfs_is_mnt_ancestor(path) == true){ ret = 0; } else{ ret = -EINVAL; } }else { ret = logicalfs->access(path, mask); } debug_exit(__FUNCTION__,path,ret); return ret; }
int plfs_trunc(Plfs_fd *fd, const char *path, off_t offset, int open_file) { debug_enter(__FUNCTION__,fd ? fd->getPath():path); int ret; if (fd) { ret = fd->trunc(path, offset); } else{ LogicalFileSystem *logicalfs = plfs_get_logical_fs(path); if (logicalfs == NULL) { ret = -EINVAL; } else { ret = logicalfs->trunc(path, offset, open_file); } } debug_exit(__FUNCTION__,fd ? fd->getPath():path,ret); return ret; }
/* returns a gboolean because it is a GSourceFunc */ gboolean nautilus_dropbox_hooks_force_reconnect(NautilusDropboxHookserv *hookserv) { debug_enter(); if (hookserv->connected == FALSE) { return FALSE; } debug("forcing hook to reconnect"); g_assert(hookserv->event_source >= 0); if (hookserv->event_source > 0) { g_source_remove(hookserv->event_source); } else if (hookserv->event_source == 0) { debug("event source was zero!!!!!"); } return FALSE; }
static void nautilus_python_object_cancel_update (NautilusInfoProvider *provider, NautilusOperationHandle *handle) { NautilusPythonObject *object = (NautilusPythonObject*)provider; PyGILState_STATE state = pyg_gil_state_ensure(); PyObject *py_handle = nautilus_python_boxed_new (_PyNautilusOperationHandle_Type, handle, FALSE); debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", pygobject_new((GObject*)provider), py_handle); beach: pyg_gil_state_release(state); }
int plfs_open(Plfs_fd **pfd, const char *path, int flags, pid_t pid, mode_t m, Plfs_open_opt *open_opt) { assert( *pfd || path ); int ret = 0; debug_enter(__FUNCTION__,(*pfd) ? (*pfd)->getPath(): path); if (*pfd) { ret = (*pfd)->open(path, flags, pid, m, open_opt); } else { LogicalFileSystem *logicalfs = plfs_get_logical_fs(path); if (logicalfs == NULL) { ret = -EINVAL; } else { ret = logicalfs->open(pfd, path, flags, pid, m, open_opt); } } debug_exit(__FUNCTION__,(*pfd) ? (*pfd)->getPath(): path,ret); return ret; }
static void comphy_mux_reg_write(struct comphy_mux_data *mux_data, struct comphy_map *comphy_map_data, int comphy_max_lanes, void __iomem *selector_base, u32 bitcount) { u32 lane, value, offset, mask; debug_enter(); for (lane = 0; lane < comphy_max_lanes; lane++, comphy_map_data++, mux_data++) { offset = lane * bitcount; mask = (((1 << bitcount) - 1) << offset); value = (comphy_mux_get_mux_value(mux_data, comphy_map_data->type, lane) << offset); reg_set(selector_base, value, mask); } debug_exit(); }
int plfs_getattr(Plfs_fd *fd, const char *path, struct stat *st, int size_only) { debug_enter(__FUNCTION__,path); int ret = 0; if (fd) { ret = plfs_sync(fd); // sync before attr if (ret == 0) { ret = fd->getattr(path, st, size_only); } } else { LogicalFileSystem *logicalfs = plfs_get_logical_fs(path); if (logicalfs == NULL) { ret = -EINVAL; }else{ ret = logicalfs->getattr(path, st, size_only); } } debug_exit(__FUNCTION__,path,ret); return ret; }
static u32 comphy_mux_get_mux_value(struct comphy_mux_data *mux_data, u32 type, int lane) { struct comphy_mux_options *mux_opt; int opt; u32 value = 0; debug_enter(); mux_opt = mux_data->mux_values; for (opt = 0 ; opt < mux_data->max_lane_values; opt++, mux_opt++) { if (mux_opt->type == type) { value = mux_opt->mux_value; break; } } debug_exit(); return value; }
int plfs_rename(const char *from, const char *to) { int ret = 0; ostringstream oss; oss << from << " -> " << to; char stripped_from[PATH_MAX]; stripPrefixPath(from, stripped_from); char stripped_to[PATH_MAX]; stripPrefixPath(to, stripped_to); debug_enter(__FUNCTION__,oss.str()); LogicalFileSystem *logicalfs = plfs_get_logical_fs(stripped_from); if (logicalfs == NULL) { ret = -EINVAL; }else{ ret = logicalfs->rename(stripped_from, stripped_to); } debug_exit(__FUNCTION__,oss.str(),ret); return ret; }
void db_deinit (void) { debug_enter ("db_deinit"); if (FALSE == sqlite3_get_autocommit (db)) g_warning ("Fatal: DB not in auto-commit mode. This is a bug. Data may be lost!"); if (statements) { g_hash_table_destroy (statements); statements = NULL; } if (SQLITE_OK != sqlite3_close (db)) g_warning ("DB close failed: %s", sqlite3_errmsg (db)); db = NULL; debug_exit ("db_deinit"); }
void comphy_mux_init(struct chip_serdes_phy_config *chip_cfg, struct comphy_map *comphy_map_data, void __iomem *selector_base) { struct comphy_mux_data *mux_data; u32 mux_bitcount; u32 comphy_max_lanes; debug_enter(); comphy_max_lanes = chip_cfg->comphy_lanes_count; mux_data = chip_cfg->mux_data; mux_bitcount = chip_cfg->comphy_mux_bitcount; /* check if the configuration is valid */ comphy_mux_check_config(mux_data, comphy_map_data, comphy_max_lanes); /* Init COMPHY selectors */ comphy_mux_reg_write(mux_data, comphy_map_data, comphy_max_lanes, selector_base, mux_bitcount); debug_exit(); }
int plfs_readdir_c(Plfs_dirp *pdirp, char *dname, size_t bufsz) { plfs_dir *pdir = (plfs_dir*)pdirp; debug_enter(__FUNCTION__,pdir->path); int ret = 0; if (pdir->itr == pdir->entries.end()) { dname[0] = '\0'; } else { string path = *(pdir->itr); if (path.size() >= bufsz) { // user provided insufficient space into which to write dname ret = -ENOMEM; dname[0] = '\0'; } else { strncpy(dname,path.c_str(),bufsz); pdir->itr++; // move to next entry } } debug_exit(__FUNCTION__,pdir->path,ret); return ret; }
static GtkWidget * nemo_python_object_get_widget (NemoLocationWidgetProvider *provider, const char *uri, GtkWidget *window) { NemoPythonObject *object = (NemoPythonObject*)provider; GtkWidget *ret = NULL; PyObject *py_ret = NULL; PyGObject *py_ret_gobj; PyObject *py_uri = NULL; PyGILState_STATE state = pyg_gil_state_ensure(); debug_enter(); CHECK_OBJECT(object); CHECK_METHOD_NAME(object->instance); py_uri = PyString_FromString(uri); py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME, "(NN)", py_uri, pygobject_new((GObject *)window)); HANDLE_RETVAL(py_ret); py_ret_gobj = (PyGObject *)py_ret; if (!pygobject_check(py_ret_gobj, &PyGtkWidget_Type)) { PyErr_SetString(PyExc_TypeError, METHOD_NAME "should return a gtk.Widget"); goto beach; } ret = (GtkWidget *)g_object_ref(py_ret_gobj->obj); beach: Py_XDECREF(py_ret); pyg_gil_state_release(state); return ret; }
static gboolean on_shutdown (gpointer user_data) { debug_enter ("liferea_shutdown"); /* prevents signal handler from calling us a second time */ if (runState == STATE_SHUTDOWN) return FALSE; runState = STATE_SHUTDOWN; /* order is important ! */ update_deinit (); liferea_shell_destroy (); db_deinit (); social_free (); conf_deinit (); debug_exit ("liferea_shutdown"); return FALSE; }
vfolderPtr vfolder_new (nodePtr node) { vfolderPtr vfolder; debug_enter ("vfolder_new"); vfolder = g_new0 (struct vfolder, 1); vfolder->itemset = g_new0 (struct itemSet, 1); vfolder->itemset->nodeId = node->id; vfolder->itemset->ids = NULL; vfolder->itemset->anyMatch = TRUE; vfolder->node = node; vfolders = g_slist_append (vfolders, vfolder); if (!node->title) node_set_title (node, _("New Search Folder")); /* set default title */ node_set_data (node, (gpointer) vfolder); debug_exit ("vfolder_new"); return vfolder; }
/** * To be called whenever a node was selected and should * replace the current itemlist. */ void itemlist_load (nodePtr node) { itemSetPtr itemSet; gint folder_display_mode; gboolean folder_display_hide_read; debug_enter ("itemlist_load"); g_return_if_fail (NULL != node); debug1 (DEBUG_GUI, "loading item list with node \"%s\"", node_get_title (node)); g_assert (!itemlist_priv.guids); g_assert (!itemlist_priv.filter); itemlist_priv.isSearchResult = FALSE; /* 1. Filter check. Don't continue if folder is selected and no folder viewing is configured. If folder viewing is enabled set up a "unread items only" rule depending on the prefences. */ /* for folders and other heirarchic nodes do filtering */ if (IS_FOLDER (node) || node->children) { liferea_shell_update_allitems_actions (FALSE, 0 != node->unreadCount); conf_get_int_value (FOLDER_DISPLAY_MODE, &folder_display_mode); if (!folder_display_mode) return; conf_get_bool_value (FOLDER_DISPLAY_HIDE_READ, &folder_display_hide_read); if (folder_display_hide_read) { itemlist_priv.filter = g_new0(struct itemSet, 1); itemlist_priv.filter->anyMatch = TRUE; itemset_add_rule (itemlist_priv.filter, "unread", "", TRUE); } } else {
/** * Scan packet buffer by dispatching to JBinding java objects */ void callJavaHeaderScanner(scan_t *scan) { #ifdef DEBUG debug_enter("callJavaHeaderScanner"); #endif JNIEnv *env = scan->env; jobject jscanner = scan->scanner->sc_java_header_scanners[scan->id]; if (jscanner == NULL) { sprintf(str_buf, "java header scanner not set for ID=%d (%s)", scan->id, id2str(scan->id)); #ifdef DEBUG debug_error("callJavaHeaderScanner()", str_buf); #endif throwException(scan->env, NULL_PTR_EXCEPTION, str_buf); return; } env->CallVoidMethod(jscanner, scanHeaderMID, scan->scanner->sc_jscan); #ifdef DEBUG debug_exit("callJavaHeaderScanner"); #endif }
static void vfolder_export (nodePtr node, xmlNodePtr cur, gboolean trusted) { vfolderPtr vfolder = (vfolderPtr) node->data; xmlNodePtr ruleNode; rulePtr rule; GSList *iter; debug_enter ("vfolder_export"); g_assert (TRUE == trusted); xmlNewProp (cur, BAD_CAST"matchType", BAD_CAST (vfolder->itemset->anyMatch?"any":"all")); iter = vfolder->itemset->rules; while (iter) { rule = iter->data; ruleNode = xmlNewChild (cur, NULL, BAD_CAST"outline", NULL); xmlNewProp (ruleNode, BAD_CAST"type", BAD_CAST "rule"); xmlNewProp (ruleNode, BAD_CAST"text", BAD_CAST rule->ruleInfo->title); xmlNewProp (ruleNode, BAD_CAST"rule", BAD_CAST rule->ruleInfo->ruleId); xmlNewProp (ruleNode, BAD_CAST"value", BAD_CAST rule->value); if (rule->additive) xmlNewProp (ruleNode, BAD_CAST"additive", BAD_CAST "true"); else xmlNewProp (ruleNode, BAD_CAST"additive", BAD_CAST "false"); iter = g_slist_next (iter); } debug1 (DEBUG_CACHE, "adding vfolder: title=%s", node_get_title (node)); debug_exit ("vfolder_export"); }
/* Set the exteded attribute */ int plfs_setxattr(Plfs_fd *fd, const void *value, const char *key, size_t len) { debug_enter(__FUNCTION__,fd->getPath()); int ret = fd->setxattr(value, key, len); debug_exit(__FUNCTION__,fd->getPath(),ret); return ret; }
/* * handler for APIC Error interrupt. Just print a warning and continue */ int apic_error_intr() { uint_t error0, error1, error; uint_t i; /* * We need to write before read as per 7.4.17 of system prog manual. * We do both and or the results to be safe */ error0 = apic_reg_ops->apic_read(APIC_ERROR_STATUS); apic_reg_ops->apic_write(APIC_ERROR_STATUS, 0); error1 = apic_reg_ops->apic_read(APIC_ERROR_STATUS); error = error0 | error1; /* * Clear the APIC error status (do this on all cpus that enter here) * (two writes are required due to the semantics of accessing the * error status register.) */ apic_reg_ops->apic_write(APIC_ERROR_STATUS, 0); apic_reg_ops->apic_write(APIC_ERROR_STATUS, 0); /* * Prevent more than 1 CPU from handling error interrupt causing * double printing (interleave of characters from multiple * CPU's when using prom_printf) */ if (lock_try(&apic_error_lock) == 0) return (error ? DDI_INTR_CLAIMED : DDI_INTR_UNCLAIMED); if (error) { #if DEBUG if (apic_debug) debug_enter("pcplusmp: APIC Error interrupt received"); #endif /* DEBUG */ if (apic_panic_on_apic_error) cmn_err(CE_PANIC, "APIC Error interrupt on CPU %d. Status = %x", psm_get_cpu_id(), error); else { if ((error & ~APIC_CS_ERRORS) == 0) { /* cksum error only */ apic_error |= APIC_ERR_APIC_ERROR; apic_apic_error |= error; apic_num_apic_errors++; apic_num_cksum_errors++; } else { /* * prom_printf is the best shot we have of * something which is problem free from * high level/NMI type of interrupts */ prom_printf("APIC Error interrupt on CPU %d. " "Status 0 = %x, Status 1 = %x\n", psm_get_cpu_id(), error0, error1); apic_error |= APIC_ERR_APIC_ERROR; apic_apic_error |= error; apic_num_apic_errors++; for (i = 0; i < apic_error_display_delay; i++) { tenmicrosec(); } /* * provide more delay next time limited to * roughly 1 clock tick time */ if (apic_error_display_delay < 500) apic_error_display_delay *= 2; } } lock_clear(&apic_error_lock); return (DDI_INTR_CLAIMED); } else { lock_clear(&apic_error_lock); return (DDI_INTR_UNCLAIMED); } }
void VISIBLE16 handle_40(struct bregs *regs) { debug_enter(regs, DEBUG_HDL_40); handle_legacy_disk(regs, regs->dl); }