void appendtag() { addtag(); ewmh_update_net_number_of_desktops(); ewmh_process_net_desktop_names(); ewmh_process_net_desktop_layout(); }
void settags(unsigned int numtags) { if (1 > numtags || scr->nmons > numtags || numtags > MAXTAGS) return; while (scr->ntags < numtags) addtag(); while (scr->ntags > numtags) deltag(); ewmh_update_net_number_of_desktops(); ewmh_process_net_desktop_names(); ewmh_process_net_desktop_layout(); }
static int sflagfile(char *file) { struct stat st; char fpath[1024]; const char *s; memset(fpath, 0, 1024); if (stat(file, &st) == -1) return 0; s = filepart(file); strncpy(fpath, file, s - file); if (!S_ISREG(st.st_mode)) return 0; return flagres(addtag(fpath, s, 0, st.st_size, FLAG_FREE), s, st.st_size); }
int main(int argc, char *argv[]) { int result; char buf[255]; if(argc < 3) { printf("Invalid number of arguments supplied to addtag.\nUsage is 'addtag filename tag1 [tag2 tag3 ...]'\n"); return -1; } //printf("addtag(%s, %s, %d)\n", argv[1], argv[2], argc-2); result = addtag(argv[1], (const char **)&argv[2], argc-2); if(result == -1) { switch(errno) { case ENOSYS: printf("Function has not been implemented. Did you insert the tagfs module?\n"); break; default: printf("Function failed with error #%d\n", errno); break; } } }
bool group_proccessor::operator()() { boost::xtime xt; while (!terminated()) { try { if (init()) { while (getmessage(message)) { if (terminated()) break; switch (strategy()) { case STRATEGY_TYPE_REPORT: { if (message.mess == MSG_DVNCITAGREPORT) { if (message.some) { addtag(message.id); } else { removetag(message.id); } } break; } default: { if (selector->group_included(message.some)) { switch (message.mess) { case MSG_DVNCTAGDELFROMGR: case MSG_DVNCIREMREF: { removetag(message.id); break; } case MSG_DVNCTAGADDTOGR: case MSG_DVNCINEWREF: { addtag(message.id); break; } default: { if ((message.mess != MSG_DVNCIREMREF) && (message.mess != MSG_DVNCINEWREF)) optinalchangeid(message.id); } } } else { if ((message.mess != MSG_DVNCIREMREF) && (message.mess != MSG_DVNCINEWREF)) optinalchangeid(message.id); } break; } } } execute_impl(); addmillisec_to_now(xt, 1); } else addmillisec_to_now(xt, 1000); boost::thread::sleep(xt); } catch (boost::system::system_error& boosterr) { if (intf) intf->debugerror("group_proccessor error what=" + std::string(boosterr.what())); } catch (...) { if (intf) intf->debugerror("group_proccessor NODEF error "); } } uninit(); return true; }